Hi Josh,
I am currently experiencing an error during my behavior, where the rotary encoder module stops communicating with the computer. It only happens every once in awhile, but enough that I'm concerned it will happen during my experiments. Here is the error message that I'm getting:
"Error using ArCOMObject_Bpod/read (line 473)
Error: The USB serial port did not return the requested number of bytes.
Error in RotaryEncoderModule/getUSBStream (line 959)
msg = obj.Port.read(msgSize, 'uint8');
Error in RotaryEncoderModule/readUSBStream (line 503)
newData = obj.getUSBStream;
Error in LeverPress (line 574)
BpodSystem.Data.EncoderData{currentTrial} =
R.readUSBStream('UseTimer', 0.100); % capture rotary encoder data
for entire trial
Error in run (line 91)
evalin('caller', strcat(script, ';'));
Error in LaunchManager>launch_protocol (line 843)
run(protocolPath);
Error while evaluating DestroyedObject Callback."
What I notice when this happens is that when I look at the USB configuration showing the com port for the rotary encoder, it shows nothing. If I disconnect the encoder then re-connect it, the correct USB port shows up and I can pair it again.
I've replaced the cable so I don't think the physical connection is the problem, but I'm wondering if maybe the USBstream is collecting too much data before it is read and the system is overloaded. Where should I be putting the 'UseTimer' feature?
Thanks!
Amber