Trigger (stimulus) codes sent on response to EEG recording

JDB j.dainerbest at gmail.com
Tue Apr 3 20:43:56 UTC 2012


I'm glad to hear from someone else that the code appears to work. I do wish 
it were more efficient, but I don't have the budget to do the online 
course, for the moment. 

I've followed David's suggestion and upgraded to E-Prime 2.0.10 
Professional (it was time), which does indeed have Task Events that seem to 
fit my needs. The problem is that the TaskImage.RESP is not a number, which 
is (I believe) what my external device needs—it's a letter. I don't think I 
can use an IF,Then statement in the parameters under Task Events. Am I 
missing something? 

One option I can think of is to send the accuracy (a 1 or 0) when the 
participant responds as a Task Event, and to send the numeric code for 
response at the Offset via InLine code (as before). 

Better, though, would be to now code using the code it generates from the 
Task Events. Is this possible? When I Generate the experiment, the relevant 
lines are:  

> If ParallelPort.GetState() = ebStateOpen Then

TaskImage.Tasks.Add ParallelPort.CreateTask("TaskImage.Keyboard(1).Press", 
> 0, WriteByteACC, , Long, CLogical(Yes))

End If 


(I've written out "WriteByteACC"—E-Studio writes it as "ebUCase_W, 
ebLCase_r", etc. I'm copying from another computer, but I'm also not sure 
whether the eb?Case letter-names are necessary.)

In any case, could I insert this as InLine code instead (before the 
TaskImage), and include the code I suggested above (*updated below)? Or 
should I instead look into the other links recommended (e.g., using the 
IsPending() function)? Any thoughts?

Barring suggestions, I will of course contact PST staff [and post their 
response here].

Thanks!

* Code to insert:

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' InLine - Code START
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
If TaskImage.RESP = "l" Then 
        resp = 55 
    ElseIf TaskImage.RESP = "s" Then 
        resp = 56 
    ElseIf TaskImage.RESP = "o" Then 
        resp = 57 
    ElseIf TaskImage.RESP = "w" Then 
        resp = 58 
    ElseIf TaskImage.RESP = "" Then 
        resp = 59 
    Else resp = 60 
End If 

If ParallelPort.GetState() = ebStateOpen Then

TaskImage.Tasks.Add ParallelPort.CreateTask("TaskImage.Keyboard(1).Press", 
0, WriteByte(custom), resp, Integer, CLogical(Yes))

End If 
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
' InLine - Code END
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 




On Thursday, March 22, 2012 4:32:25 PM UTC-4, McFarlane, David wrote:
>
> If you use EP2.0.10.182 *Professional* or later then you are in luck 
> -- see the new Task Events feature documented at 
> http://www.pstnet.com/support/kb.asp?TopicID=4803 .  (Remember, I 
> have uniformly advised everyone to spend the extra money for 
> Professional, no matter what PST advises.)
>
> If you do not have EP2.0.10.182 Pro, then you might look at 
>
> http://groups.google.com/group/e-prime/browse_thread/thread/cfc3d0307d5c7fbd 
> and 
>
> http://groups.google.com/group/e-prime/browse_thread/thread/ef0e5a8d8b87aa0c 
> for hints.  Or, of course, take this up with PST Web Support at 
> http://support.pstnet.com/e%2Dprime/support/login.asp , where they 
> strive to respond to all requests in 24-48 hours.  And if you do get 
> an answer from PST staff, please extend the courtesy of posting their 
> reply back here for the sake of others.
>
> BTW, although your particular inline code for the stimulus signal 
> works well enough (which is a virtue), it suffers in efficiency.  I 
> have an entire lesson about handling these sorts of things in my 
> online course (although that lesson does not address your precise 
> response signal question).
>
> -----
> David McFarlane
> E-Prime training 
> online:  http://psychology.msu.edu/Workshops_Courses/eprime.aspx
> Twitter:  @EPrimeMaster (twitter.com/EPrimeMaster)
>
>
> At 3/22/2012 03:52 PM Thursday, you wrote:
> >I'm working on a project that involves interfacing an E-Prime
> >experiment with the ActiView/Biosemi interface for EEG recording.
> >
> >I have this in the UserScript:
> >Const Sport as Integer = &H378
> >
> >Every time an image appears, this code is sent immediately before:
> >
> >InLine:
> >Intermediary.OnsetSignalEnabled = True
> >Intermediary.OnsetSignalPort = Sport
> >Intermediary.OnsetSignalData = c.GetAttrib("IntermediaryCode")
> >
> >Intermediary.OffsetSignalData = 0
> >Intermediary.OffsetSignalPort = Sport
> >Intermediary.OffsetSignalEnabled = True
> >
> >This works fine. The task then presents the participant with images,
> >to one of which they respond; the image is on-screen for 500ms,
> >followed by a fixation cross for another 500ms. They can respond at
> >any point, but the image & cross are on-screen for a set amount of
> >time. What I'd like is for the stimcode to be sent as soon as possible
> >after the response. I've been successful in sending a response code
> >after fixation cross goes away, using the following code:
> >
> >InLine:
> >If TaskImage.RESP = "l" Then
> >         resp = 55
> >     ElseIf TaskImage.RESP = "s" Then
> >         resp = 56
> >     ElseIf TaskImage.RESP = "o" Then
> >         resp = 57
> >     ElseIf TaskImage.RESP = "w" Then
> >         resp = 58
> >     ElseIf TaskImage.RESP = "" Then
> >         resp = 59
> >     Else resp = 60
> >End If
> >
> >FixationCross2.OnsetSignalEnabled = True
> >FixationCross2.OnsetSignalPort = Sport
> >FixationCross2.OnsetSignalData = resp
> >
> >FixationCross2.OffsetSignalEnabled = True
> >FixationCross2.OffsetSignalPort = Sport
> >FixationCross2.OffsetSignalData = 0
> >
> >However, this only works by sending itself at the beginning of a new
> >fixation cross. Ideally, subject responses would be sent WHEN they
> >respond. But I can't figure out how to do that. Is there some function
> >equivalent to "OnResponse"? It seems like it should be possible, but
> >I'm not sure how to do it.
> >
> >Thanks for your help!
>
>

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To view this discussion on the web visit https://groups.google.com/d/msg/e-prime/-/oDYv2q_ANScJ.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20120403/f9c4661c/attachment.htm>


More information about the Eprime mailing list