Appendix B – Modbus Protocol
B-8
NMBA-01 Installation and Start-up Guide
Parity Checking
Users can configure controllers for Even or Odd Parity checking, or for
No Parity checking. This will determine how the parity bit 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 (eight for RTU). The par-
ity 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 config-
ured for that device. All devices on the Modbus network must be config-
ured 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 employed, and two 1 bits are
dropped from a character containing three 1 bits, the result is still an
odd count of 1 bits.
If No Parity checking is specified, no parity bit is transmitted and no
parity check can be made. An additional stop bit is transmitted to fill out
the character frame.
CRC Checking
In RTU mode, messages include an error-checking field that is based
on a Cyclical Redundancy Check (CRC) method. The CRC field
checks the contents of the entire message. It is applied regardless of
any parity check method used for the individual characters of the mes-
sage.
The CRC field is two bytes, containing a 16-bit binary value. The CRC
value is calculated by the transmitting device, which appends the CRC
to the message. The receiving device recalculates a CRC during
receipt of the message, and compares the calculated value to the
actual value it received in the CRC field. If the two values are not equal,
an error results.
The CRC is started by first pre-loading a 16-bit register to all 1’s. Then
a process begins of applying successive 8-bit bytes of the message to
the current contents of the register. Only the eight bits of data in each
character are used for generating the CRC. Start and stop bits, and the
parity bit if one is used, do not apply to the CRC.
efesotomasyon.com - Control Techniques,emerson,saftronics -ac drive-servo motor