Thread Tools  
aoholcombe
Junior Member
 
Join Date: Jan 2009
aoholcombe is on a distinguished road Posts: 5
switching General purpose vs. Reflective mode, Posted January 28th, 2009 #1
I would like to send a signal into my RB-730 to provide a timestamp to synchronize my external device. I don't know whether my device is in General Purpose or Reflective mode. How can I switch it into General Purpose mode?

I have the Accessory Connector connected, with the naked 8 wires at the ready but touching any two of them together seems to have no effect on the buttonbox data (except for touching the power pin to the ground pin, which crashes the device). This is why I think I may be in Reflective mode, am I thinking along the right lines here?

Alex H
University of Sydney
Reply With Quote
aoholcombe
Junior Member
 
Join Date: Jan 2009
aoholcombe is on a distinguished road Posts: 5
clarification, without Superlab, Posted January 28th, 2009 #2
I should have said: I do not have Superlab, I am treating the box as a fake serial port over USB and using the XID protocol to communicate with it.
Reply With Quote
Hisham
Developer
 
Join Date: Aug 2006
Location: San Pedro, CA
Hisham is on a distinguished road Posts: 841
Posted January 29th, 2009 #3
By default, the response pads are set to Reflective mode. If you are communicating via XID mode (I assume you're doing some programming), you can switch modes using an XID command. We also provide a utility program called Xidon (pronounced Zydon) that lets you switch modes.
Reply With Quote
aoholcombe
Junior Member
 
Join Date: Jan 2009
aoholcombe is on a distinguished road Posts: 5
specific XID command, Posted January 29th, 2009 #4
oh, that's great news. I'm working on OSX, programming in Python, so I can't run the .exe utility unfortunately. Probably you don't have a version for OSX, so can you tell me the XID command I should send? I am new to XID communication though. So you see what I'm doing, to reset the clock I send the buttonbox the string 'e5'. I've posted the full details at:
http://openwetware.org/wiki/Holcombe:ButtonBox

thanks in advance for any further pointers
Alex
Reply With Quote
Hisham
Developer
 
Join Date: Aug 2006
Location: San Pedro, CA
Hisham is on a distinguished road Posts: 841
Posted January 29th, 2009 #5
You need the a1 command, "Set Accessory Connector Mode".

BTW, you may need to add a few milliseconds delay in between commands sent to the response pad. I'm working on a web page that describes any needed latencies.
Reply With Quote
aoholcombe
Junior Member
 
Join Date: Jan 2009
aoholcombe is on a distinguished road Posts: 5
unreliable communication and triggering, Posted March 4th, 2009 #6
thanks, I now have managed to communicate successfully with the response pad across the USB port using XID and using all the commands I need (switching to general purpose mode, setting the lines to input mode to allow external trigger, resetting the reaction timer, detecting and reading external trigger and button events).
However almost every one of these functions is very unreliable, even though I always insert code to wait for 100 ms after each command or trigger event. For instance, often when I send the command 'a10' to switch the response pad into General Purpose mode and then ask the box what mode it is in ('_a1') it tells me it has not switched. Usually after a few more tries it works, but sometimes up to 10 tries are needed. For every single message I send to the response pad, I have to build a loop into my code where I check for success and then try again and again when it occasionally fails. However, these problems are only time-consuming annoyances, requiring me to write dozens of lines of code for error checking and testing, but not show-stopping for my experiments.

The show-stopper is that the pad has about a 5% failure rate for detecting the trigger I send into it when that trigger is part of a stream of repeated triggers.
I have done extensive tests sending in an external trigger every 200 ms, or every 700 ms for several seconds. The button box *usually* records each trigger accurately with an accurate timestamp. However 5-10% of the time no event is registered by the pad in response to the input line trigger. I have done no tweaking of the 'bounce' interval but presume this wouldn't be an issue for inter-trigger intervals of many hundreds of milliseconds like I am using. Am I going to have to give up on the response pad as a timer for several precisely-timed triggers in a row? Is it possible I am doing something wrong? It seems unlikely since I am doing exactly the same thing in my code many times, and only occasionally these randomly creates a failure. Because the trigger is from a photocell, I can see with my own eyes that each of the triggers is actually occurring. Will this (and the annoying difficulties referred to earlier) be fixed and if so, how soon? I see that the MATLAB-using psychtoolbox people have also reported unreliability in their tests (http://docs.psychtoolbox.org/CedrusResponseBox)
Reply With Quote
aoholcombe
Junior Member
 
Join Date: Jan 2009
aoholcombe is on a distinguished road Posts: 5
Boosting the voltage I am using for the extrenal triggering event with the Accessory Connector has resulted in it now being reliable All events now seem to be registered.

The other problem I had, with unreliable communication with the box over the USB, remains but the work-around of sending the XID messages as many times as it takes makes the box usable.
Reply With Quote
Hank
Senior Member
 
Join Date: Aug 2006
Location: Asheville, NC
Hank is on a distinguished road Posts: 490
Posted March 24th, 2009 #8
I don't know if this is explicitly documented anywhere, but on some models, it's an important detail:

In addition to the delay between commands, the processor also needs a delay between bytes. Considering the way USB works, it may just be enough to send each byte separately one after another, but SuperLab inserts a 1.5ms delay between bytes on the necessary models to make sure.
Reply With Quote
Thread Tools
Posting Rules
Forum Jump:
Copyright Cedrus Corporation, 1991-2013.
All times are GMT -7. The time now is 01:14 PM.