Resonse Triggers
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Resonse Triggers Expand / Collapse
Author
Message
Posted 10/8/2007 11:41:20 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior 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!

Post #673
Posted 10/9/2007 11:34:41 AM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum 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

Post #676
Posted 10/10/2007 8:09:22 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior 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.

Post #678
Posted 10/10/2007 12:30:26 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior 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!

Post #680
Posted 10/11/2007 9:28:37 PM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum 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

Post #687
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 8:21pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.062. 13 queries. Compression Disabled.