Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

problem with sending different trigger to BrainVision Recorder with V-Amp, serial port

Dear community

Hi, I'm Lee, and it's my first time asking a question. Please understand If I'm not good at English.


I'm making simple oddball task for my ERP Experiment.

So I want to send different trigger at different stimuli.

but, BrainVision Recorder was received same trigger. just "S11".


at first, before start the experiment, I wrote the code like below at inline script(run).

import serial
import time

try:
	exp.port= serial.Serial('COM3')
	print 'serial port read', exp.port.name, exp.port.baudrate, exp.port.bytesize, exp.port.parity
except: 
	print 'serial port not read'

and the printed result of first inline script is here.

serial port read COM3 9600 8 N


and after each stimuli, I wrote the code like below.

value = var.triggervalue

t = time.time()
count = 0

try:	
	while (time.time()-t) < 0.005 : #500Hz: >4ms / 250Hz: >8ms
		exp.port.write(str(value)) # or whatever is appropriate
		count += 1
	print('trigger has been sent')
	print('value:',value,'    time:',time.time()-t,'    count:',count)
except:
	print 'trigger not sent'

self.sleep(200)

and the printed result is here. (value 1: prominent / value 2: odd)

trigger has been sent
('value:', 1, '  time:', 0.005000114440917969, '  count:', 58)

trigger has been sent
('value:', 1, '  time:', 0.00599980354309082, '  count:', 32)

trigger has been sent
('value:', 2, '  time:', 0.006000041961669922, '  count:', 36)

trigger has been sent
('value:', 1, '  time:', 0.006000041961669922, '  count:', 34)

trigger has been sent
('value:', 1, '  time:', 0.006000041961669922, '  count:', 67)


last, I end the experiment with this code

exp.port.close()


I expected this inline scripts would sent right trigger, but BrainVision Recorder received only "S11".


Why Recorder read the trigger only "S11", not "S1" nor "S2"? Where is "S11" from?

I read other forums(https://forumcogsci.nl/index.php?p=/discussion/491/solved-sending-different-triggers-via-serial-port etc), but I can't understand why and how I make mistake.

Could you explain what is wrong?


and I have one more question.

I send the trigger with "for" phrase, so I send lots of trigger at one time.

hhowcan I send the trig only one and long


If you could correct my mistake, I would be much appreciated.

Comments

  • Hi Lee,


    I don't know how it works with serial ports, but when sending triggers through parallel ports, you have to unset after you changed a value. So every time you sent a value (say a 1), a little while later (for parallel ports ~10 ms) you send a zero. Like that you make sure that the triggers won't overlap or add up. Whether this is the reason why you only see S11, I don't know. Maybe you can experiment a little with the triggers (e.g. sending only number repeatedly, or sending different numbers than 1 and 2).

    I send the trigger with "for" phrase, so I send lots of trigger at one time. how can I send the trig only one and long

    I don't see where you used a for loop, but one straightforward way to adapt your code would be:

    value = var.triggervalue
    
    t = time.time()
    count = 0 
    trigger_sent= 0
    try:	
    	while (time.time()-t) < 0.005 : #500Hz: >4ms / 250Hz: 
                    if trigger_sent == 0:
    		    exp.port.write(str(value)) # or whatever is appropriate
    		    count += 1
                        trigger_sent = 1
    	print('trigger has been sent')
    	print('value:',value,'    time:',time.time()-t,'    count:',count)
    except:
    	print 'trigger not sent'
    
    self.sleep(200)
    

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games