Error checking methods, Parity checking, Parity checking 274 – Watlow PPC-2000 User Manual

Page 302

Advertising
background image

Appendix A: Modbus Protocol

PPC-2000 User’s Guide

274

Watlow Anafaze

Doc.# 30002-00 Rev 2.3

Error Checking Methods

Modbus RTU use two kinds of error checking:

Parity checking

Frame checking (CRC)

Parity checking can be optionally applied to each character,
while the frame checking is applied to the entire message. Both
the character check and message frame check are generated in
the master device and applied to the message contents before
transmission. The slave device checks each character and the
entire message frame during receipt.

The master is configured by the user to wait for a
predetermined time-out interval before aborting the
transaction. This interval is set to be long enough for any slave
to respond normally. If the slave detects a transmission error,
the message will not be acted upon. The slave will not construct
a response to the master. Thus the time-out will expire and
allow the master’s program to handle the error. Note that a
message addressed to a nonexistent slave device will also cause
a time-out.

Parity Checking

Users can configure controllers for Even or Odd Parity
checking, or for No Parity checking. This will determine how
the parity will be set in each character.

If either Even or Odd Parity is specified, the quantity of 1 bits
will be counted in the data portion of each character (8 bits).
The parity bit will then be set to a 0 or 1 to result in an Even or
Odd total of 1 bits.

For example, these eight data bits are contained in an RTU
character frame:

1100 0101

The total quantity of 1 bits in the frame is four. If Even Parity
is used, the frame’s parity bit will be a 0, making the total
quantity of 1 bits still an even number (four). If Odd Parity is
used, the parity bit will be a 1, making an odd quantity (five).

When the message is transmitted, the parity bit is calculated
and applied to the frame of each character. The receiving
device counts the quantity of 1 bits and sets an error if they are
not the same as configured for that device (all devices on the
Modbus network must be configured to use the same parity
check method).

Note that parity checking can only detect an error if an odd
number of bits are picked up or dropped in a character frame
during transmission. For example, if Odd Parity checking is
used, and two 1 bits are dropped from a character containing
three 1 bits, the result is still an odd count of 1 bits.

Advertising