Hi,For over 10 years our lab has been using writeport address, val (values from 0 to 15). However, recently I was testing our equipment and found in the PST knowledge base about the On and OffSetSignalEnabled code which looks better than the writeport because you aren't waiting for the screen refresh.
I am doing a simple visual (and would like to test auditory later) paradigm for testing. 2 pictures (from a previous eprime example), with same ISI but different pre-releases. I have 4 conditions in this block - red car (StimTrig1 = 1); blue car (StimTrig1 = 2); ISITrig150: for red car = 6; for blue car = 10; (I found that having the same value for ISITrig150 6 for example meant that the Stimulus Trigger for the next stimulus wouldn't come up)
Port is defined at the beginning of the experiment CONST Port = &H378
I defined StimTrig1 and ISITrig150 in the TrialList attributes, the trial procedure is inline code below and then ISI2 (text display) and Stimulus2 (ImageDisplay, vertical blank on)
DIM trigOnCodeISI as Integer
DIM trigOnCodeStim as Integer
DIM trigOffCode as Integer
trigOnCodeISI = CInt (c.GetAttrib ("ISITrig150"))
trigOnCodeStim = CInt (c.GetAttrib ("StimTrig1"))
trigOffCode = 0
ISI2.OnsetSignalEnabled = True
ISI2.OnsetSignalPort = Port
ISI2.OnsetSignalData = trigOnCodeISI
ISI2.OffsetSignalData = True
ISI2.OffsetSignalPort = Port
ISI2.OffsetSignalData = trigOffCode
Stimulus2.OnsetSignalEnabled = True
Stimulus2.OnsetSignalPort = Port
Stimulus2.OnsetSignalData = trigOnCodeStim
Stimulus2.OffsetSignalData = True
Stimulus2.OffsetSignalPort = Port
Stimulus2.OffsetSignalData = trigOffCode
This code is really unreliable, sometimes I get 1's and 2's and at the beginning of the ISI even though I had commented out the Stimulus Trig code and even deleted it from the inline. I will sometimes get only the first trigger as 10 and then it drops to 8 for the rest (if I use sequential). I have tried putting only the code for the ISI before the ISI and code for the stimulus in between the ISI2 and Stimulus2 objects and this does not help.
I am unsure why my code is unreliable, the stimuli are on for 400 ms, ISI is 500 ms. Any suggestions please? Am I using this code correctly?
Many thanks,
Vanessa