HEX Send_string problem
John_Glove
Posts: 95
hi
i will send some hex string to rs232 on a ni900, but not the completed string will be going out!
example:
SEND_STRING dvAM_____1,"$0F,$33,$90,$1E,$1A"
will be send:
$0F3$90$1E$1A (see $33 ,there is only send 3)
if i send:
SEND_STRING dvAM_____1,"$0F,$01,$DB,$01,$01"
will be send:
$0F$01$DB$01$01 (the full command!)
and here:
SEND_STRING dvAM_____1,"$0F,$2E,$F4,$02,$03"
will be send:
$0F.$F4$02$03 ( see the . )
what's going on here?!
has anyone any help
thanks
john
i will send some hex string to rs232 on a ni900, but not the completed string will be going out!
example:
SEND_STRING dvAM_____1,"$0F,$33,$90,$1E,$1A"
will be send:
$0F3$90$1E$1A (see $33 ,there is only send 3)
if i send:
SEND_STRING dvAM_____1,"$0F,$01,$DB,$01,$01"
will be send:
$0F$01$DB$01$01 (the full command!)
and here:
SEND_STRING dvAM_____1,"$0F,$2E,$F4,$02,$03"
will be send:
$0F.$F4$02$03 ( see the . )
what's going on here?!
has anyone any help
thanks
john
0
Comments
What you are seeing is the ASCII equivalent to the hexadecimal number you are sending. $33 equals '3' and $2E equals '.'. AMX will display the ASCII equivalent if applicable and then hex if none exists. So the displayed messages are correct in your example. At the end your sending bytes, and the diagnostic tools has no idea what format you used. Hope this makes sense.
// These messages are identical
SEND_STRING dvAM_____1,"$0F,$33,$90,$1E,$1A"
SEND_STRING dvAM_____1,"$0F,'3',$90,$1E,$1A"
SEND_STRING dvAM_____1,"$0F,51,$90,$1E,$1A"
ASCII Chart
http://www.asciitable.com
Jeff
i think this must be the (problem) solution :-)
thanks a lot
john
As mentioned, what you are seeing in diagnostics is the ASCII representation of the data, if there is a printable ASCII, and hex for everything else. The display format in the diagnostics window is selectable. Go to settings/preferences/diagnostics and look at the section titled "Notification View". It's self explanatory.
If you're doing a lot of work where you want to see the hex representation exclusively, you can select "Hex Values." In the last 13 years or so I think I've needed to do that about twice.