Thread Tools  
gshenaut
Senior Member
 
Join Date: Nov 2006
gshenaut is on a distinguished road Posts: 144
XID protocol question, Posted September 17th, 2007 #1
I have a few questions about the XID protocol that I couldn't answer from the documentation.

First, it appears that the parameter argument is sometimes ASCII and sometimes binary, but it isn't completely clear when. For example, in the c1X command, X can be 0, 1, 2, or 3, but is that binary (00000000, 00000001, ...) or ASCII ('0', '1',...)? There are many commands where the parameter ranges from 0 to a small integer, 1-5; are all of these ASCII? All binary? (A few commands are clearly binary, like all the b commands.) I believe that the responses to the _d2-_d5 commands are always ASCII.

Second, there are several multi-byte commands, such as e2/_e2 and the response to e3. In this case, what is the order of the bytes? 0123, 3210, or something else?

Third, there is an ASCII full product name string. How is this string terminated? Is it a constant length, NUL-terminated, terminated with a newline?

Finally, how is an XID box supposed to respond to a protocol error, such as an unknown command sequence (like "E1", "zx", "a7", or "d4"), an unsupported or meaningless inquiry (like "_f1" or "_ar"), a parameter out of range (like "c19"), or an incomplete command (like "a1" followed by a long delay)? There doesn't appear to be an error response, or in fact, any kind of specific error detection. I suppose it could throw away everything in the erroneous packet and hope to get back in sync again somehow.

Thanks,

Greg Shenaut
Reply With Quote
peircej
Junior Member
 
Join Date: Sep 2007
peircej is on a distinguished road Posts: 2
Posted September 18th, 2007 #2
I'm a user that has recently been working this stuff out for myself so thought I'd send the answers as they appear to me (using an RB-730 on winXP with Python).

Quote:
First, it appears that the parameter argument is sometimes ASCII and sometimes binary, but it isn't completely clear when....
It's nearly all ASCII and nothing is terminated. For the c1X command you need to do something like;
>serialport.write('c10')
I haven't used them all yet, so some might be different, but I'm betting not.

Quote:
Second, there are several multi-byte commands, such as e2/_e2 and the response to e3. In this case, what is the order of the bytes?
Most significant byte first.

Quote:
Third, there is an ASCII full product name string. How is this string terminated? Is it a constant length, NUL-terminated, terminated with a newline?
The final character is a newline (but there is another in the middle). There's no termination as such:
RB-x30 Response Pad\r(c) Copyright Cedrus Corporation, 2003\r
Quote:
Finally, how is an XID box supposed to respond to a protocol error, such as an unknown command sequence (like "E1", "zx", "a7", or "d4"), an unsupported or meaningless inquiry (like "_f1" or "_ar"), a parameter out of range (like "c19"), or an incomplete command (like "a1" followed by a long delay)?
As far as I can make out, erroneous commands are simply ignored. Incomplete commands get timed out (after ~100ms on my machine).

hope this helps! (and hope someone from Cedrus corrects me if I'm wrong! )
Jon
Reply With Quote
gshenaut
Senior Member
 
Join Date: Nov 2006
gshenaut is on a distinguished road Posts: 144
Thank you!, Posted September 18th, 2007 #3
I was about to use kermit or something to test it myself but thought I'd ask first. I'm glad I did--the 100 ms timeout on commands would make that approach impractical.

One thing: in the multi-byte commands, those are binary, right? And also the various millisecond quantities and bit masks?

I'm seeing the pattern that when the parameter is "small", like in the range 0-5, it's ascii, but when it's bigger than that, it's binary--is that correct?

One of the things I'm working towards is a kind of XID "browser" or "monitor" utility--it sounds like that might be compatible with what you're doing.

My longer-term goal is an XID/RB emulator based on PIC or Arduino or whatever, that can be used with SuperLab. But first I want to understand the protocol thoroughly.

Greg
Reply With Quote
peircej
Junior Member
 
Join Date: Sep 2007
peircej is on a distinguished road Posts: 2
no worries, Posted September 18th, 2007 #4
Glad that helped.

Yes, for multi-byte values the box certainly returns binary bytes (as in '\xf0' for 240). I haven't tried anything that requires multi-byte input (I'm not using the voice series) but you're surely right.

My goal sounds different - I write a freeware stimulus presentation package in python and I'm currently writing in support for cedrus button boxes (so that other users don't have to learn about things like byte orders and binary characters!!)

all the best
Jon
Reply With Quote
Thread Tools
Posting Rules
Forum Jump:
Copyright Cedrus Corporation, 1991-2014.
All times are GMT -7. The time now is 08:06 AM.