Task Event - WriteString?

David McFarlane mcfarla9 at msu.edu
Thu Aug 15 18:19:11 UTC 2013


Great, and thanks for posting back!  So the issue was not exactly 
with E-Prime Task Events, but with including control characters in 
the output string.

Hmm, then you should still be able to get it to work with Task Events 
by defining your string plus carriage return/newline into an 
attribute, and then using the attribute reference in Task 
Events.  E.g., with inline code (could do this once at the Sesson level),

         c.SetAttrib RunString, "RUN" & ebCrLf

and then for "Custom" in Task Events use

         [RunString]

Even better, just try either of the following strings for Custom in 
Task Events:
         RUN\n
         RUN\r\n

The generated code shows that it properly includes the escaped 
control characters (\n, or \r\n), so this should work, but I need 
someone else to run this and confirm.

So the lesson here seems to be that we have to know how to embed 
standard escaped control characters in our Custom strings for Task Events.

-----
David McFarlane
E-Prime training 
online:  http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter:  @EPrimeMaster (https://twitter.com/EPrimeMaster)


At 8/15/2013 01:14 PM Thursday, John wrote:
>Update:  We were able to get it running using inline script -- it 
>needed a carriage return.
>
>Prior to each event, put in an inline script with:
>Serial.WriteString "RUN" & ebCrLf
>
>If using multiple pumps in a network, precede run with the address 
>of the pump:  "00 RUN" for the first pump, "01 RUN" for the second, etc.
>
>
>On Monday, August 12, 2013 11:28:34 AM UTC-4, John wrote:
>I'm running eprime pro and trying to use task events to trigger an 
>external device.
>
>When the stimulus comes on the screen, I need eprime to send the 
>string "RUN" to the serial port.
>
>In task events, I do the following:
>-Add an event
>-Select the serial device (COM3)
>-Action:  WriteString
>
>...but then how to I define what the string is?  (i.e. "RUN")
>
>
>(In a terminal window, i can type "echo RUN > COM3" and that 
>triggers the device...I'm just trying to figure out how eprime to do that.)
>
>Thanks!

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/520d1bdf.6707320a.6500.0288SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/groups/opt_out.



More information about the Eprime mailing list