Greetings. We are trying to send event markers to Biopac through Labjack. And here is our main code component (the timer and labjack components has already been defined and imported before this). This code component was placed in the “Each Frame” section.
if timer.getTime > EventOnset:
if timer.getTime > EventOffset:
Here, “EventOnset”, “EventOffset” and “Channel” are variables read from excel files. What we are trying to do is when a given event occurs, we turn on channel number “Channel” after “EventOnset”, and turn it off after “EventOffset”.
We encounter two problems here:
- The labjack function setFIOState does not seem to take variable “Channel” here. Error message:
Got incorrect command bytes…Expected: [0xf8] Got: [0x0]
When we hard code the channel (we put “1” instead of “Channel” there), it worked. But we want to use a variable here.
- It does turn on the channel after “EventOnset”, but does not turn off the channel after “EventOffset”. There’s no error message. I could not tell from the code what’s wrong.
Thanks for your help!