OS (e.g. Win10): Win10 64-bit
PsychoPy version (e.g. 1.84.x): v3.0.6
Standard Standalone? (y/n) If not then what?: Yes
What are you trying to achieve?:
Use labjack U12 to send event markers/triggers (via DB25 port)
What did you try to make it work?:
I modified code for labjack U3 in order to make it work for U12 as follows:
# Initialize components for Routine "stimuli" import u12 p_port = u12.U12() p_port.status = None
# *p_port* updates if t >= jitter and p_port.status == NOT_STARTED: # keep track of start time/frame for later p_port.tStart = t p_port.frameNStart = frameN # exact frame index p_port.status = STARTED win.callOnFlip(p_port.eDigitalOut, channel=0, state=1, writeD=1) frameRemains = jitter + 6- win.monitorFramePeriod * 0.75 # most of one frame period left if p_port.status == STARTED and t >= frameRemains: p_port.status = FINISHED win.callOnFlip(p_port.eDigitalOut, channel=0, state=0, writeD=1)
Today I managed to borrow a Biopac device to test the script and it seems working fine.
What specifically went wrong when you tried that?:
However, my concern remains: according to U12 datasheet (link) eDigitalOut function requires 14~20ms to excute, so there may be a variable delay in sending event markers. I wonder whether using U3 would encounter a similar issue (and how to minimize the consequence of this delay)?