Waiting forever for data transmission with Cedrus RB

Hi there!

I am trying to setup a new experiment in which I will use a Cedrus response box. My code is stuck, I don’t get any response. I have waited for 1,5 hour at most but PTB doesn’t do anything.

After adjusting all my parameters, I have a long script to start PTB. There, I use CedrusResponseBox() function as CedrusResponseBox('Open', '/dev/ttyUSB0');
Then, it gets stuck at line 1892, IOPort('Write', ptb_cedrus_devices{handle}.link, char(data), 1);
Apparently, it tries to work on that but cannot complete. I cannot stop MATLAB running as well. I have to kill the process.

I tried running my code with low baud rate but it didn’t help. I tried also blocking = 2 and blocking = 3 by modifying IOPort('Write') command and it also didn’t help. I cannot think of anything to debug. Do you have any suggestion?

PTB version: 3.0.19 - Flavor: Debian package - psychtoolbox-3 (3.0.19.9.dfsg1-1~nd22.04+1)
MATLAB R2022 on Ubuntu 22.04.4 LTS
Cedrus Model RB-530

-cemre

I have picked your specific problem for “free support on resolving a non-trivial issue”, sponsored by Mathworks Neuroscience - MATLAB and Simulink Solutions - MATLAB & Simulink. You get advice and help on this topic for free. Mathworks provided us with 5 such “Jokers” for free support in the time period October 2023 to June 2024, and you get to use the 5th and final one out of five.

Please download a hopefully bug fixed CedrusResponseBox.m driver from this link:
https://raw.githubusercontent.com/kleinerm/Psychtoolbox-3/master/Psychtoolbox/PsychHardware/CedrusResponseBox.m

Make sure it is used instead of the original one from your installation, by putting it ahead of it in your Matlab path, and report back, if the problem is resolved.

[Work time spent so far: 30 minutes.]

Thanks for your help Mario! It solved the problem about the waiting time. It works a bit slow but that’s fine for initialization.

I still have a further issue. I cannot see my response box in the output of PsychHID('Devices') even if I select the device class 5. That’s why I couldn’t save responses from it. Do you have any idea about that?

It is serial port device, so it is expected that it won’t show as HID device.

1 Like

| Cemre
April 4 |

  • | - |

Thanks for your help Mario! It solved the problem about the waiting time. It works a bit slow but that’s fine for initialization.

Good. So the bug was introduced by a bug fix to our IOPort driver a few releases ago. Before that, the Cedrus box worked by accident - two bugs cancelling each other out! With IOPort fixed, now the Cedrusresponsebox driver also needed a fix of disabling hardware flow control, which was supposed to make communication more reliable, according to cedrus docs, but instead totally broke it. After fixing the IOPort bug, I thought that my low opinion about Cedrus firmware was maybe misguided, but after this, I’m back at my original opinion that they have really shoddy firmware and communication protocols. This fix will be in the next PTB release.

I still have a further issue. I cannot see my response box in the output of PsychHID('Devices') even if I select the device class 5. That’s why I couldn’t save responses from it. Do you have any idea about that?

It’s a serial port device, not a HID device. The Cedrus… Function provides all the needed functionality as good as possible - which is not that great iirc, but that is Cedrus fault, not ours.

@xiangrui sells a much more reliable response box, the RTbox, btw. At least as far as the first revision of that hardware, which I tested many years ago. Can’t vouch for later revisions, as I could not test those myself, but assume they are fine.

Thanks for the help and the info! I am glad that I conducted to fix a bug. It is the first time I use a response box. I got some help from my colleagues and I figured it out. Everything works smoothly now.
I’ve read some comments about Cedrus in PTB discourse group and in other forums as well. When I have a chance to buy an RTbox, I will definitely consider other options!