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

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msg/e-prime/-/oDYv2q_ANScJ">https://groups.google.com/d/msg/e-prime/-/oDYv2q_ANScJ</a>.<br /> 
To post to this group, send email to e-prime@googlegroups.com.<br />
To unsubscribe from this group, send email to e-prime+unsubscribe@googlegroups.com.<br />

For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.<br />