Hi there,
New to Eprime and any help would be super appreciated. I am trying to send task events in eprime using a Cedrus stimtracker.
Despite setting the task event up as should be (task name: serial, action:write string, source: custom, custome: [code], data type: strong), I don't seem to get the task events to send data corresponding to the attribute [code]. Instead I appear to be getting random numbers. I saw it suggested that you should put mh[code]0 in the custom box, but to be honest I have no idea why, and although this sends triggers with set numbers (e.g., 50), all triggers have the same number, which doesn't correspond to my [code] attribute.
' This function should be placed in the 'User' script area.
' View >> Script >> [choose 'User' tab]
Sub PulseStimTracker( lineSettings As Integer, millisecondsDuration As Integer )
Dim bytesThatMakePulseConfigCommand(5) As Integer
Dim bytesToRaiseStimTrackerLines(3) As Integer
millisecondsDuration = 10
'Here is where we construct the byte sequence
'that forms a StimTracker Event Marker command.
bytesThatMakePulseConfigCommand(0) = 109 ' ascii m
bytesThatMakePulseConfigCommand(1) = 112 ' ascii p
bytesThatMakePulseConfigCommand(2) = millisecondsDuration
bytesThatMakePulseConfigCommand(3) = 0
bytesThatMakePulseConfigCommand(4) = 0
bytesThatMakePulseConfigCommand(5) = 0
'(E-Studio generates the following script when the serial device is
'added to the experiment: Dim Serial As SerialDevice).
'Send the command to StimTracker!
Serial.WriteBytes bytesThatMakePulseConfigCommand
'Make the command to zero out (clear) all lines
bytesToRaiseStimTrackerLines(0) = 109 ' ascii m
bytesToRaiseStimTrackerLines(1) = 104 ' ascii h
bytesToRaiseStimTrackerLines(2) = lineSettings
bytesToRaiseStimTrackerLines(3) = 0 ' this final byte is currently ignored by StimTracker
Serial.WriteBytes bytesToRaiseStimTrackerLines
End Sub
_____
The issue is, I have no idea what bytesThatMakePulseConfigCommand 0-5 and bytesToRaiseStimTrackerLines 0-3 are doing. I have searched for this in the Cedrus website but their help pages seem very concise and technical. I understand vaguely that the value after bytesThatMakePulseConfigCommand 0 & 1 is related to the serial address, but apart from that I'm pretty lost.
Any thoughts/insight/reading suggestions would be super appreciated!