|
|
|
Junior Member
      
Group: Forum Members
Last Login: 12/10/2008 10:52:34 AM
Posts: 19,
Visits: 69
|
|
| Hello, I am having trouble coding my response triggers. I would like to set it up so that when the subject responds by pressing button 1 or 2 on the SRBox, E-Prime sends this information as a trigger to my acquisition computer which is running Brain Vision. At the moment I have managed to write some script so that a trigger is sent for each trial showing what the correct answer is, but I would like E-Prime to wait until the subject has pressed a button and then send this info as a trigger (so I know which button they have pressed) Is this possible? can someone please lend me a hand with the script I need to use? Thanks!
|
|
|
|
|
Forum MVP
      
Group: Administrators
Last Login: Today @ 8:53:29 AM
Posts: 577,
Visits: 1,255
|
|
| If this only involves one response, then you could place an InLine immediately after your Stimulus object. If Stimulus.Acc = 1 Then WritePort &H378, 1 Else WritePort &H378, 0 End If If you are performing multiple responses in the same trial then view the Sample: Process Responses Template -Brandon
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 12/10/2008 10:52:34 AM
Posts: 19,
Visits: 69
|
|
| Thanks for the reply Brandon. I seem to be getting myself in a bit of a muddle here. The script above is similar to what I was using before, and it is sending a trigger to my acquisition computer showing what the correct answer should be for each trial. But what I need is for E-Prime to wait until a button is pressed on the SRBOX and then send this information as a trigger so I can see exactly which button was pressed. I have had a look at the example, but I am having trouble understanding the script used. Basically I want it to be something like: If SRBOXDevice = 1 then Writeport &H378, 1 Else Writeport &H378, 2 End if Sorry if this is a silly question, but I am a complete novice at writing script! Thanks.
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 12/10/2008 10:52:34 AM
Posts: 19,
Visits: 69
|
|
| I think I have sorted this now. I ended up using this bit of script: If Stimulus.RESP = c.GetAttrib ("CorrectAnswer") Then WritePort &H378, 1 Else WritePort &H378, 2 End if
Does this look right to you Brandon? It seems to be working fine!
|
|
|
|
|
Forum MVP
      
Group: Administrators
Last Login: Today @ 8:53:29 AM
Posts: 577,
Visits: 1,255
|
|
| That code looks fine. I checked for the .ACC property above which assumes the [CorrectAnswer] in the Correct field in duration input. The only thing to note is that if you do the comparison with alpha data that to add UCase around each entry to ensure case insensitive comparison. -Brandon
|
|
|
|