98
Serial and TCP Protocols
B.2.1.3 Protocol Conversions
Note that the above applies directly only when both ends of the network connection are set up with exactly
the same packetization settings. If the two peers have different settings, then some useful protocol conver-
sion is possible. For example, suppose both peers are set to “String - cut.” One of the peers has a terminat-
ing string of “\r\n” (carriage return, line feed = CRLF), and the other has a different string, just “\n” (line
feed = LF).
With this hypothetical setup, a simple protocol converter has been achieved in addition to the usual serial
line extension property: CRLF delimiters at one end are converted to LF terminators at the other end.
This sort of asymmetric packetization is not limited to “String - cut.” For example, one end could be
“String - cut” and the other set to “Idle.” This would be a converter from CRLF-based packetization to an
idle timing-based scheme. In particular, Modbus ASCII uses CRLF termination, and Modbus RTU uses
idle timing. It is thus easy to set up a converter for these two variants of the Modbus protocol.
B.2.1.4 9th Bit Packetization
This protocol uses non-standard serial port signalling to indicate the start of a packet. Unlike the string
packetization modes, which detect the end of a packet, 9th bit detects the start of a frame. This is a fairly
subtle distinction. In practice it does not usually cause any problems. The main implication is that the end
of one packet is not detected until a new packet is started. This is only likely to cause a problem if one end
of a network connection uses 9th bit packetization, and the other uses idle timing. The end that uses idle
timing cannot start sending a packet until the EOP indicator is received. Thus, if the 9th bit end does not
get a new packet for a long time, the other end will not be able to send its buffered packet for a correspond-
ingly long time. For this reason, it is not recommended to mix 9th bit with idle timing.
9th bit packetization uses a non-standard technique to specially mark the first character in a packet. Most
data bytes will be sent as a start bit (which is a zero), followed by 7 or 8 data bits, followed by a stop bit
(which is a one). [There may also be a parity bit, but parity cannot be used in the usual sense with 9th bit
packetization, so we ignore parity.] When a character is sent in “9th bit” mode, the usual stop bit is
replaced with two bits: the 9th bit itself, which is a zero, followed by the normal stop bit (a one).
Normally, this would cause a parity or framing error, but this can be an indicator of 'special status' for the
received byte if the serial port is set up for it. The 9th bit packetization mode interprets that 'special status'
as the start of a new packet. Note that the byte with the 9th bit is included as part of the packet, i.e., the
first character. Very often, this character is treated specially, e.g. as some sort of address byte, but the
EM1500 just considers it to be part of the normal packet data.
If using 7 bit data for characters, the so-called 9th bit is actually the 8th bit, but for simplicity we retain the
term “9th bit” in both cases.
The advantage of 9th bit packetization is that it is very economical in terms of use of the available serial
port bandwidth. Only a single extra bit time is required to delimit packet boundaries, rather than sequences
of (redundant) characters or time intervals (usually at least 10 bit times).
Summary of Contents for EM1500
Page 14: ...10 www rabbit com Introduction...
Page 22: ...18 www rabbit com Getting Started...
Page 76: ...72 www rabbit com EM1500 Configuration...
Page 90: ...86 www rabbit com EM1500 Specifications...
Page 104: ...100 www rabbit com Serial and TCP Protocols...
Page 118: ...114 www rabbit com EM1500 FAQ...