Millisecond Forums

Sending several trigger in Inquisit 4

https://forums.millisecond.com/Topic18796.aspx

By AnjaK - 4/6/2016

I have an experiment in which I want to send triggers to an external device in case the participant gives a correct response. Those triggers should be send randomly in 10% of the correct trials. I programmed it in a way that every time a correct response i given, a responsetrial is executed. In this response trial, I first present an empty screen (feedback_leer) and then after 1500 ms this empty screen is either repeated (thus nothing happens) or in 10% of the trials the TRIGGER is send.

<port Trigger>
/ port = lpt3
/ subport = data
/ items = (255)
</port>

<trial potential_trigger>
/ posttrialpause = replace(3500, 4000, 4500, 5000, 5500, 6000, 6500)
/ stimulustimes = [0=feedback_leer, Marker_Response_Control_L; 1500=replace(feedback_leer, feedback_leer, feedback_leer, feedback_leer, feedback_leer, feedback_leer, feedback_leer, feedback_leer, feedback_leer, TRIGGER)]
/ timeout = 1000
</trial>

This works fine. The only problem is that I just realized that what I need in those 10% is not one trigger but three triggers send in intervals of 50 milliseconds. Is there an easy way to do this? Or does it involve branching to another trial everytime the trigger is chosen? And if so, how would such a /branch look like: how can I say that I need the branch trail every time the TRIGGER is chosen as stimulus?
By AnjaK - 4/6/2016

I just realized that when defining the trigger I wrote "Trigger" and in the stimulus sequence I wrote "TRIGGER". My mistake when posting this, I have it correctly in my script and the script also works fine
By Dave - 4/6/2016

> [...] what I need in those 10% is not one trigger but three triggers send in intervals of 50 milliseconds. Is there an easy way to do this?

Yes, but you need to abandon the selectionmode in your /stimulustimes attribute. If I were you, I'd set up *two* response trials -- one displaying the triggers at the desired intervals via /stimulustimes and another one displaying no triggers.

Put these in a <list>:

<list responsetrials>
/ items = (trial.notriggertrial, trial.triggertrial)
/ poolsize = 10
/ itemprobabilities = (.9, .1)
</list>

Then, from your "main" trial(s), /branch to a trial sampled from the list in case of a correct response

<trial maintrial>
....
/ branch = [if (trial.maintrial.correct) list.responsetrials.nextvalue; ]
</trial>
By AnjaK - 4/6/2016

Thank you very much! Unfortunately, now I have the following problem:

I defined the list:

<list responsetrials>
/ items = (trial.notriggertrial, trial.triggertrial)
/ poolsize = 10
/ itemprobabilities = (.9, .1)
</list>

and the two trial types:

<trial notriggertrial>
/ posttrialpause = replace(3500, 4000, 4500, 5000, 5500, 6000, 6500)
/ stimulustimes = [0=feedback_leer, Marker_Response_Control_L]
/ timeout = 2500
</trial>

<trial triggertrial>
/ posttrialpause = replace(3500, 4000, 4500, 5000, 5500, 6000, 6500)
/ stimulustimes = [0=feedback_leer, Marker_Response_Control_L; 1500=Pain; 1550=Pain; 1600=Pain)]
/ timeout = 1000
</trial>

(Pain is the name of the trigger, see below) only now I get the message:
Could not locate element ''. (in Element: trial.triggertrial; Attribute: stimulustimes).

I checked whether I have defined all stimulus items, which I did:

<text feedback_leer>
/ items = feedback_leer
/ position = (50, 50)
/ txcolor = (0,0,0)
/ txbgcolor = (0,0,0)
</text>

<item feedback_leer>
/ 1 = ""
</item>

<port Marker_Response_Control_L>
/ port = lpt2
/ subport = data
/ items = (211)
</port>

<port Pain>
/ port = lpt3
/ subport = data
/ items = (255)
</port>

Do you have an idea what could be the problem?
By Dave - 4/6/2016

Note the trailing ) in

/ stimulustimes = [0=feedback_leer, Marker_Response_Control_L; 1500=Pain; 1550=Pain; 1600=Pain)]


which needs to be removed.
By AnjaK - 4/7/2016

indeed! thank you very much for your help, now it works perfectly!