# Interfacing Matlab PTB CMUBox with PST fiber optic button response box

**URL:** <https://psychtoolbox.discourse.group/t/interfacing-matlab-ptb-cmubox-with-pst-fiber-optic-button-response-box/466>\
**Category:** Uncategorized\
**Created:** [December 9, 2011, 7:45pm UTC](https://psychtoolbox.discourse.group/t/interfacing-matlab-ptb-cmubox-with-pst-fiber-optic-button-response-box/466 "2011-12-09T19:45:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [December 9, 2011, 7:45pm UTC](https://psychtoolbox.discourse.group/t/interfacing-matlab-ptb-cmubox-with-pst-fiber-optic-button-response-box/466/1 "2011-12-09T19:45:02Z")

</div>

Hello,  
  
I'm trying to get an interface working using the CMUBox function. We are using a new fiber optic button response box from PST (model number on the response box is PST-100759 [http://www.pstnet.com/hardware.cfm?ID=91)](http://www.pstnet.com/hardware.cfm?ID=91)). The 'GetEvent' does not wait for a button press, but returns immediately which is not what I was expecting. I've changed the port settings under device manager to disable FIFO buffers. I've also tried with FIFO buffers enabled and also without the 'norelease=1' option. We are not using this device ([http://www.pstnet.com/hardware.cfm?ID=102)](http://www.pstnet.com/hardware.cfm?ID=102)) which may be what the code is programmed to use. It is connected over the serial port, and the OS is Windows XP.  
  
I've tried forpserial-0 (with and without norelease set, which will wait, but does not return when I hit a button on the response box (which is the same as hitting a button on the glove).  
  
I would really appreciate if anyone (Mario?) can offer any hints on how to get this working (please respond to [nickjon@...](mailto:nickjon@...) if possible). Thank you for your time and expertise in helping me.  
  
Here is my test code:  
h = CMUBox('Open', 'pst', 'COM1', 'norelease=1');  
  
status = CMUBox('Status', h);  
disp(status);  
  
evt = CMUBox('GetEvent', h, 1);  
disp(evt);  
  
CMUBox('Close', h);  
  
  
  
Here is the output:  
CMUBox: Using PST serial response button box!  
IOPort-Info: Configuration for device COM1:  
IOPort-Info: Current baud rate is 19200  
IOPort-Info: Baud rate changed to 19200  
IOPort-Info: Configuration for device COM1:  
IOPort-Info: Current baud rate is 19200  
IOPort-Info: Baud rate changed to 19200  
IOPort-Info: Configuration for device COM1:  
IOPort-Info: Current baud rate is 19200  
IOPort-Info: Baud rate changed to 19200  
IOPort-Info: Configuration for device COM1:  
IOPort-Info: Current baud rate is 19200  
IOPort-Info: Baud rate changed to 19200  
 useBitwhacker: 0  
 Streaming: 0  
 type: 3  
 ftdiusbserialtype: 0  
 norelease: 1  
 portName: 'COM1'  
 port: 0  
 dt: 0.0012  
 oldState: 128  
 baseTime: 2.6674e+006  
 olderr: ''  
 oldTime: 2.6674e+006  
 tTrouble: 0  
  
CMUBox: GetEvent: Timestamp trouble!! Delta 1.344484 msecs, ScanInterval 0.013000 msecs.  
CMUBox: GetEvent: Timestamp trouble!! Delta 0.012741 msecs, ScanInterval 0.012000 msecs.  
CMUBox: GetEvent: Timestamp trouble!! Delta 0.012666 msecs, ScanInterval 0.012000 msecs.  
 time: 2.6674e+006  
 streamTime: 0  
 state: 128  
 trouble: 1  
 deltaScan: 1.2000e-005  
  
IOPort-Info: Configuration for device COM1:  
IOPort-Info: Current baud rate is 19200  
IOPort-Info: Baud rate changed to 19200

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [December 13, 2011, 3:48pm UTC](https://psychtoolbox.discourse.group/t/interfacing-matlab-ptb-cmubox-with-pst-fiber-optic-button-response-box/466/2 "2011-12-13T15:48:50Z")

</div>

What one would need to solve this is the protocol specification of the box, what are the serial port settings, what is the data format of whatever the box sends back etc. Unfortunately www.pstnet.com doesn't have this stuff online, so unless you apparently buy such a device and register for some user-account you only get to see useless marketing bs.   
  
Perfectly understandable, given that what they do is obviously top-secret rocket science.  
-mario  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "trashcanforjunk" \<trashcanforjunk@...\> wrote:  
> \>  
> \> Hello,  
> \>   
> \> I'm trying to get an interface working using the CMUBox function. We are using a new fiber optic button response box from PST (model number on the response box is PST-100759 [http://www.pstnet.com/hardware.cfm?ID=91)](http://www.pstnet.com/hardware.cfm?ID=91)). The 'GetEvent' does not wait for a button press, but returns immediately which is not what I was expecting. I've changed the port settings under device manager to disable FIFO buffers. I've also tried with FIFO buffers enabled and also without the 'norelease=1' option. We are not using this device ([http://www.pstnet.com/hardware.cfm?ID=102)](http://www.pstnet.com/hardware.cfm?ID=102)) which may be what the code is programmed to use. It is connected over the serial port, and the OS is Windows XP.  
> \>   
> \> I've tried forpserial-0 (with and without norelease set, which will wait, but does not return when I hit a button on the response box (which is the same as hitting a button on the glove).  
> \>   
> \> I would really appreciate if anyone (Mario?) can offer any hints on how to get this working (please respond to nickjon@... if possible). Thank you for your time and expertise in helping me.  
> \>   
> \> Here is my test code:  
> \> h = CMUBox('Open', 'pst', 'COM1', 'norelease=1');  
> \>   
> \> status = CMUBox('Status', h);  
> \> disp(status);  
> \>   
> \> evt = CMUBox('GetEvent', h, 1);  
> \> disp(evt);  
> \>   
> \> CMUBox('Close', h);  
> \>   
> \>   
> \>   
> \> Here is the output:  
> \> CMUBox: Using PST serial response button box!  
> \> IOPort-Info: Configuration for device COM1:  
> \> IOPort-Info: Current baud rate is 19200  
> \> IOPort-Info: Baud rate changed to 19200  
> \> IOPort-Info: Configuration for device COM1:  
> \> IOPort-Info: Current baud rate is 19200  
> \> IOPort-Info: Baud rate changed to 19200  
> \> IOPort-Info: Configuration for device COM1:  
> \> IOPort-Info: Current baud rate is 19200  
> \> IOPort-Info: Baud rate changed to 19200  
> \> IOPort-Info: Configuration for device COM1:  
> \> IOPort-Info: Current baud rate is 19200  
> \> IOPort-Info: Baud rate changed to 19200  
> \> useBitwhacker: 0  
> \> Streaming: 0  
> \> type: 3  
> \> ftdiusbserialtype: 0  
> \> norelease: 1  
> \> portName: 'COM1'  
> \> port: 0  
> \> dt: 0.0012  
> \> oldState: 128  
> \> baseTime: 2.6674e+006  
> \> olderr: ''  
> \> oldTime: 2.6674e+006  
> \> tTrouble: 0  
> \>   
> \> CMUBox: GetEvent: Timestamp trouble!! Delta 1.344484 msecs, ScanInterval 0.013000 msecs.  
> \> CMUBox: GetEvent: Timestamp trouble!! Delta 0.012741 msecs, ScanInterval 0.012000 msecs.  
> \> CMUBox: GetEvent: Timestamp trouble!! Delta 0.012666 msecs, ScanInterval 0.012000 msecs.  
> \> time: 2.6674e+006  
> \> streamTime: 0  
> \> state: 128  
> \> trouble: 1  
> \> deltaScan: 1.2000e-005  
> \>   
> \> IOPort-Info: Configuration for device COM1:  
> \> IOPort-Info: Current baud rate is 19200  
> \> IOPort-Info: Baud rate changed to 19200  
> \>

---

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [January 26, 2012, 2:49pm UTC](https://psychtoolbox.discourse.group/t/interfacing-matlab-ptb-cmubox-with-pst-fiber-optic-button-response-box/466/3 "2012-01-26T14:49:44Z")

</div>

Hi Mario,  
  
I've received some technical specifications from PST about the glove we are using. The device is an older version of the Celeritas called FOBRS. The model operates under the same characteristics as the Serial Response Box. Here are the specifications from the SRBox manual:  
  
 9600 or 19,200 baud standard RS-232C communications  
 8 data bits, 1 stop bit, no parity  
 800 or 1600 characters per second transmission rate  
 1600 cps is NOT supported at 9600 baud as this configuration will cause faulty data transmission  
  
Does this help with understanding the problem I'm encountering? Do you know of people who have gotten it working?  
  
Fortunately, I've gotten the Cedrus Lumina response pad working as another potential solution. I will try to post the settings I used for that device once I'm back down in the MR center.  
  
Thanks for your help.  
  
Nick  
  
nickjon at gmail dot com  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario" \<mario.kleiner@...\> wrote:  
> \>  
> \>   
> \>   
> \> What one would need to solve this is the protocol specification of the box, what are the serial port settings, what is the data format of whatever the box sends back etc. Unfortunately www.pstnet.com doesn't have this stuff online, so unless you apparently buy such a device and register for some user-account you only get to see useless marketing bs.   
> \>   
> \> Perfectly understandable, given that what they do is obviously top-secret rocket science.  
> \> -mario  
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "trashcanforjunk" \<trashcanforjunk@\> wrote:  
> \> \>  
> \> \> Hello,  
> \> \>   
> \> \> I'm trying to get an interface working using the CMUBox function. We are using a new fiber optic button response box from PST (model number on the response box is PST-100759 [http://www.pstnet.com/hardware.cfm?ID=91)](http://www.pstnet.com/hardware.cfm?ID=91)). The 'GetEvent' does not wait for a button press, but returns immediately which is not what I was expecting. I've changed the port settings under device manager to disable FIFO buffers. I've also tried with FIFO buffers enabled and also without the 'norelease=1' option. We are not using this device ([http://www.pstnet.com/hardware.cfm?ID=102)](http://www.pstnet.com/hardware.cfm?ID=102)) which may be what the code is programmed to use. It is connected over the serial port, and the OS is Windows XP.  
> \> \>   
> \> \> I've tried forpserial-0 (with and without norelease set, which will wait, but does not return when I hit a button on the response box (which is the same as hitting a button on the glove).  
> \> \>   
> \> \> I would really appreciate if anyone (Mario?) can offer any hints on how to get this working (please respond to nickjon@ if possible). Thank you for your time and expertise in helping me.  
> \> \>   
> \> \> Here is my test code:  
> \> \> h = CMUBox('Open', 'pst', 'COM1', 'norelease=1');  
> \> \>   
> \> \> status = CMUBox('Status', h);  
> \> \> disp(status);  
> \> \>   
> \> \> evt = CMUBox('GetEvent', h, 1);  
> \> \> disp(evt);  
> \> \>   
> \> \> CMUBox('Close', h);  
> \> \>   
> \> \>   
> \> \>   
> \> \> Here is the output:  
> \> \> CMUBox: Using PST serial response button box!  
> \> \> IOPort-Info: Configuration for device COM1:  
> \> \> IOPort-Info: Current baud rate is 19200  
> \> \> IOPort-Info: Baud rate changed to 19200  
> \> \> IOPort-Info: Configuration for device COM1:  
> \> \> IOPort-Info: Current baud rate is 19200  
> \> \> IOPort-Info: Baud rate changed to 19200  
> \> \> IOPort-Info: Configuration for device COM1:  
> \> \> IOPort-Info: Current baud rate is 19200  
> \> \> IOPort-Info: Baud rate changed to 19200  
> \> \> IOPort-Info: Configuration for device COM1:  
> \> \> IOPort-Info: Current baud rate is 19200  
> \> \> IOPort-Info: Baud rate changed to 19200  
> \> \> useBitwhacker: 0  
> \> \> Streaming: 0  
> \> \> type: 3  
> \> \> ftdiusbserialtype: 0  
> \> \> norelease: 1  
> \> \> portName: 'COM1'  
> \> \> port: 0  
> \> \> dt: 0.0012  
> \> \> oldState: 128  
> \> \> baseTime: 2.6674e+006  
> \> \> olderr: ''  
> \> \> oldTime: 2.6674e+006  
> \> \> tTrouble: 0  
> \> \>   
> \> \> CMUBox: GetEvent: Timestamp trouble!! Delta 1.344484 msecs, ScanInterval 0.013000 msecs.  
> \> \> CMUBox: GetEvent: Timestamp trouble!! Delta 0.012741 msecs, ScanInterval 0.012000 msecs.  
> \> \> CMUBox: GetEvent: Timestamp trouble!! Delta 0.012666 msecs, ScanInterval 0.012000 msecs.  
> \> \> time: 2.6674e+006  
> \> \> streamTime: 0  
> \> \> state: 128  
> \> \> trouble: 1  
> \> \> deltaScan: 1.2000e-005  
> \> \>   
> \> \> IOPort-Info: Configuration for device COM1:  
> \> \> IOPort-Info: Current baud rate is 19200  
> \> \> IOPort-Info: Baud rate changed to 19200  
> \> \>  
> \>

---

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [April 8, 2013, 9:32pm UTC](https://psychtoolbox.discourse.group/t/interfacing-matlab-ptb-cmubox-with-pst-fiber-optic-button-response-box/466/4 "2013-04-08T21:32:44Z")

</div>

Hello,  
  
I'm encountering the same problem that's referenced in this thread from last year regarding a fiber optic PST response box and the 'GetEvent' function for CMUBox. The response box is connected via a Prolific serial-to-USB converter to a quad-core Mac OS-X machine, and I am able to assign a handle to the box. However, 'GetEvent' returns immediately without waiting for a button press, even with:  
  
evt = CMUBox('GetEvent', handle, 1)  
  
Although there are several helpful suggestions in this thread, there is no indication that the author was ever able to get the PST box working. I would greatly appreciate any further help with this device!  
  
Best,  
Joe  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "trashcanforjunk" \<trashcanforjunk@...\> wrote:  
> \>  
> \> Hello,  
> \>   
> \> I'm trying to get an interface working using the CMUBox function. We are using a new fiber optic button response box from PST (model number on the response box is PST-100759 [http://www.pstnet.com/hardware.cfm?ID=91)](http://www.pstnet.com/hardware.cfm?ID=91)). The 'GetEvent' does not wait for a button press, but returns immediately which is not what I was expecting. I've changed the port settings under device manager to disable FIFO buffers. I've also tried with FIFO buffers enabled and also without the 'norelease=1' option. We are not using this device ([http://www.pstnet.com/hardware.cfm?ID=102)](http://www.pstnet.com/hardware.cfm?ID=102)) which may be what the code is programmed to use. It is connected over the serial port, and the OS is Windows XP.  
> \>   
> \> I've tried forpserial-0 (with and without norelease set, which will wait, but does not return when I hit a button on the response box (which is the same as hitting a button on the glove).  
> \>   
> \> I would really appreciate if anyone (Mario?) can offer any hints on how to get this working (please respond to nickjon@... if possible). Thank you for your time and expertise in helping me.  
> \>   
> \> Here is my test code:  
> \> h = CMUBox('Open', 'pst', 'COM1', 'norelease=1');  
> \>   
> \> status = CMUBox('Status', h);  
> \> disp(status);  
> \>   
> \> evt = CMUBox('GetEvent', h, 1);  
> \> disp(evt);  
> \>   
> \> CMUBox('Close', h);  
> \>   
> \>   
> \>   
> \> Here is the output:  
> \> CMUBox: Using PST serial response button box!  
> \> IOPort-Info: Configuration for device COM1:  
> \> IOPort-Info: Current baud rate is 19200  
> \> IOPort-Info: Baud rate changed to 19200  
> \> IOPort-Info: Configuration for device COM1:  
> \> IOPort-Info: Current baud rate is 19200  
> \> IOPort-Info: Baud rate changed to 19200  
> \> IOPort-Info: Configuration for device COM1:  
> \> IOPort-Info: Current baud rate is 19200  
> \> IOPort-Info: Baud rate changed to 19200  
> \> IOPort-Info: Configuration for device COM1:  
> \> IOPort-Info: Current baud rate is 19200  
> \> IOPort-Info: Baud rate changed to 19200  
> \> useBitwhacker: 0  
> \> Streaming: 0  
> \> type: 3  
> \> ftdiusbserialtype: 0  
> \> norelease: 1  
> \> portName: 'COM1'  
> \> port: 0  
> \> dt: 0.0012  
> \> oldState: 128  
> \> baseTime: 2.6674e+006  
> \> olderr: ''  
> \> oldTime: 2.6674e+006  
> \> tTrouble: 0  
> \>   
> \> CMUBox: GetEvent: Timestamp trouble!! Delta 1.344484 msecs, ScanInterval 0.013000 msecs.  
> \> CMUBox: GetEvent: Timestamp trouble!! Delta 0.012741 msecs, ScanInterval 0.012000 msecs.  
> \> CMUBox: GetEvent: Timestamp trouble!! Delta 0.012666 msecs, ScanInterval 0.012000 msecs.  
> \> time: 2.6674e+006  
> \> streamTime: 0  
> \> state: 128  
> \> trouble: 1  
> \> deltaScan: 1.2000e-005  
> \>   
> \> IOPort-Info: Configuration for device COM1:  
> \> IOPort-Info: Current baud rate is 19200  
> \> IOPort-Info: Baud rate changed to 19200  
> \>
