RS422 on NI700
VladaPUB
Posts: 139
I need to send Hex code to camera witch is connected to Serial port 1 on NI700 over RS 422 !
Question is how to set port to act like RS422 and not as RS232 and how to send Hex code !
Ugrent
Question is how to set port to act like RS422 and not as RS232 and how to send Hex code !
Ugrent
0
Comments
The 9600,N,8,1 is only an example.
We recently used rs422 for a sony evid70 camera and my notes show this connection works:
AMX 1 to CAM 1
AMX 4 to CAM 4
AMX 5 to CAM 5
AMX 6 to CAM 2
AMX 9 to Cam 3
Of course, that may not work for a different camera. I don't believe that there is a standard, or even customary, pinout for RS 422.
If you hook it up and you send it what you know to be good strings and your NI700 shows garbage strings coming back, therre is a good chance that you have the "polarity" of your send and receive inverted. Please, don't ask me how I know this.
With all AMX serial ports that handle RS232, RS422, and RS485, RS422 and RS232 are enabled with the exact same configuration. That is, for either RS232 or RS422, you send the same set_baud command, whatever is appropriate for the device. 485 needs to be "DISABLE".
I believe that RS232 will actually work with either "485 ENABLE" or "485 DISABLE", though I have not tested this -- not deliberately anyways. RS422 and RS485 are mutually exclusive because they use the same pins(1, 4, 6, and 9)
to send hex codes: SEND_STRING dvDEVICE,"$01,$A2,$F5,$AB,$23,$02"
You do have to be cautious tho, because some devices really want an ASCII based string of HEX codes, not actually HEX values.
Jeff
88 30 01 FF - Address setting
8X 01 04 00 02 FF - Camera ON (x is camera address number)
8X 01 04 00 03 FF - Camera OFF (x is camera address number)
And when I send that commant I have comunication (i can see on NI 700 that controler do Tx and Rx ) but camera do nothing.
And it does not working . . . . .
Do the SET BAUD in the DATA_EVENT..ONLINE of the Camera device: By default, the ports working with 38400 baud. In NetLinx, the DEFINE_START section is passed much earlier as the devices are ready to operate, so the command in DEFINE_START in most cases will fail.
Afaik the Sony cameras use hex values:
Regards,
On = SEND_STRING CAMERA,"$81,$01,$04,$00,$02,$FF"
Off = SEND_STRING CAMERA,"$81,$01,$04,$00,$03,$FF"
$81 = Camera 1, $82 = Camera 2 etc ; $88 is broadcast to all cameras
Hope this helps
Cheers
Still have a problem !
I am also trying to control D70 so ih you can send me some code example that would be great !!!
Hey There,
The rs422 is a symetric connection using 2 wires for tansmitt and two for receive.
Make shure that you have the right wire to the right pin. Most of the time the wires are named as A and B or + and - or TX-,TX+,RX- and RX+. How to find the right wire?
Here is the way TX+: logic 0 = 0v Logic 1= -VCC TX- Logic 0= -VCC Logic 1= 0V.
For the RX line the same level are used for + and-
But how to measure? It's quit simple. Make a small program that repeats sending $FF (1111 1111) and measure between the lines and ground. After that you are sure that you have the right connection.
About the Hex and Ascii value's. There's not difference (with some exeptions).
Ascii A is equal to Hex 41 or decimal 65. So it makes no difference what you send.
But there are exeptions for example it you want to send a value from the extended ASCII set (>127) you'll find strange ascii charaters for it so it's better to send a hex or decimal value. Other example: If you must do a calculation in your string (like a checksum) you must use Hex instead of ASCII because calculation cannot be done on ascii string without a ATOI. Be aware that some protocolls uses PSEUDO HEX. This means that the HEX value's are written as a ASCII string. For example $3E is sending as '3E' or in hex notation as "$33,$45". Some equipment uses this notation like for example BIAMP and it's not the most easy way to program.
Hope this info is usefull to you.
Good Luck