RS-232 Serial Help Needed
Phil Brogan
Posts: 6
This question involves serial message construction, where I'm having difficulty with the Serial Trigger/Table over RS-232. There are three formats available in Properties/Serial Table: ASCII, Decimal and Hex. None of these formats will successfully produce the message I need, yet I can do so using the Serial Toolbar or the Direct Injector Tool.
The needed format is something like: 0x23 0x20 0x30, and generates \"# 0\" in a machine that expects only ASCII characters. I can send this message successfully, as written, from either the Serial or Direct Tools and it comes out on the other end correctly.
Yet when I put the same message in the Serial Trigger/Table, that device performs some kind of conversion based on which of the three formats is selected in the format selector. But none of the three sends the message correctly - each converts the characters literally. For instance, when set to Hex, the message on the other end comes out \"30 78 32 33...\". It converts the \"0x23\" to the hex equivalents. I've tried using the \"h\" prefix to signify hex - I've tried a lot of things, but nothing works - EXCEPT the Serial Toolbar and the DIT. But you can't call either from logic that I'm aware of.
Can anybody help?
Thanks in advance.
PS. I am using the Serial Trigger/Table in multiple other instances to other machines that can understand hex, so I know it works and I know the serial link is good.
The needed format is something like: 0x23 0x20 0x30, and generates \"# 0\" in a machine that expects only ASCII characters. I can send this message successfully, as written, from either the Serial or Direct Tools and it comes out on the other end correctly.
Yet when I put the same message in the Serial Trigger/Table, that device performs some kind of conversion based on which of the three formats is selected in the format selector. But none of the three sends the message correctly - each converts the characters literally. For instance, when set to Hex, the message on the other end comes out \"30 78 32 33...\". It converts the \"0x23\" to the hex equivalents. I've tried using the \"h\" prefix to signify hex - I've tried a lot of things, but nothing works - EXCEPT the Serial Toolbar and the DIT. But you can't call either from logic that I'm aware of.
Can anybody help?
Thanks in advance.
PS. I am using the Serial Trigger/Table in multiple other instances to other machines that can understand hex, so I know it works and I know the serial link is good.
0
Comments
If you need specific example strings, let me know and I'll post what I did if it will help.
Thanks,
Phil
-Jess
This was hard to get through my head. On one job a Dalite screen needed plain text command string, but a <CR> termination (h0d).
In any other system the needed string would look like this: \"# 0 se re dn h0d\". But you can't put it into the serial send that way because when the serial send is set to ASCII, it thinks everything it sees is ASCII. When it's set to HEX - ditto.
What you have to do is first set the serial send mode to ASCII, and enter the \"# 0 se re dn\" part of the example command.
Then you change the mode to HEX. That immediately converts the display to \"23,20,30,20,73,65,20,72,65,20,64,6E,20\".
Now you type in on the end of the string \"0D\" for your carriage return. If you then change the mode back to ASCII, all you'll see is the \"# 0 se re dn\" because ASCII mode only displays PRINTABLE characters, of which <CR> is not.
It's a BSS thing I guess.
Good luck,
Phil
-Jess