Hiya Josh,
We've got a setup running Bpod r1 and occassionaly it throws an error in RunStateMatrix:
201 nTimeStamps = BpodSerialRead(1, 'uint16');
202 TimeStamps = BpodSerialRead(nTimeStamps, 'uint32');
203 if TimeStamps(end) < TrialStartMicroseconds
The error is an indexing error in Line 203.
We've caught it once with the debugger and what's happening is that nTimeStamps is incorrect. The session was on trial 142 but it was just over 1300. I don't really understand serial reading but I'd guess that there weren't >1300 uint32 worth of bytes to read, so the next line returned TimeStamps as empty, and so line 203 errored.
I have a janky temporary fix, which I found when I used IOPort() to read a single int16 value while in the debugger and it returned the correct number of trials. I've got a janky fix where nTimeStamps is read again if TimeStamps is returned empty, but I don't know what's going on.
Any thoughts?