synchronize event markers with refresh rate

David McFarlane mcfarla9 at msu.edu
Fri Apr 15 19:26:07 UTC 2011


At 4/15/2011 03:02 PM Friday, Paul Groot wrote:
>Hi Hank,
>
>The OnsetSignal-properties can only address one IO-port at the time
>(all 8 bits at the same time because there is no masking mechanism).

Hmm, couldn't one apply a mask using And or Or in inline code before 
the stimulus object?  E.g., if you wanted to apply only bits 0-2 of 
some other input port, how about something like

'/------------------------------------------------------
' Using Consts in order to avoid "magic numbers" in code:
Const  InPort as Integer = &h1234  ' whatever
Const  OutPort as Integer = &h0378
Const  OutMask as Integer = &h07  ' bits 0-2

StimText.OnsetSignalEnabled = True
StimText.OnsetSignalPort = OutPort
StimText.OnsetSignalData = ReadPort(InPort) And OutMask
'\------------------------------------------------------


Or, if one merely wanted to apply bits 0-2 without affecting any 
other bits, how about

'/------------------------------------------------------
' Using Consts in order to avoid "magic numbers" in code:
Const  OutPort as Integer = &h0378
Const  OutMask as Integer = &h07  ' bits 0-2
Const  OutData as Integer = &h05  ' for example

StimText.OnsetSignalEnabled = True
StimText.OnsetSignalPort = OutPort
StimText.OnsetSignalData = (ReadPort(OutPort) And OutMask) _
     Or OutData
'\------------------------------------------------------

-- David McFarlane, Professional Faultfinder

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
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.



More information about the Eprime mailing list