Knowledge Base / Protocols / ASCII

How do I get the letters of my ASCII text messages to be in the correct order?

Search KB

Kategorien

Swapping each two-letter group of out-going and/or in-coming ascII text messages appear to be reversed. example: "test message" looks like "ettsm seaseg" we provide "port 1 receive swap code", "port 1 transmit swap code", "port 2 receive swap code" and "port 2 transmit swap code" parameters in the configuration data. Setting any or all of these to a value of "0" perserves the byte order. Setting any or all of these to a value of "1" will swap the byte order. If messages are scrambled when these parameters are set to a value of "0", changing the parameter to "1" should re-order the bytes to correctly reproduce the message. Conversely, if messages are scrambled when these parameters are set to a value of "1", changing the parameter to "0" should re-order the bytes to correctly reproduce the message. Generally, they will all be set to either "0" or "1"; but, they are individually selectable for maximum flexibility. ASCII characters only require 7 or 8 bits, or one byte,of storage space per character. Each of our module memory registers can hold one 16-bit "word" of data, or two 8-bit "bytes", called "high order" or "most significant" byte and "low order" or "least significant" byte. To keep from wasting memory space, we store two ASCII characters per module register, one character in the low order byte and one in the high order byte. Some ASCII devices send and receive ASCII characters in a different byte order than the PLC platform with whom they are communicating. This results in scramblied messages, as in the example below.

Related Keywords:

MVI46-GSC MVI56-GSC MVI71-GSC MVI94-GSC