Appendix
EngyVolt RV15
50
Query transmission
time
Slave
processing time
Response transmission
time
Query
Response
Start of
query
Query received
by slave
Start of
response
Response received
by master
A0016524-EN
å
18
Modbus data transmission
11.4.5 Error checking methods
Standard Modbus protocol serial networks use two error checking processes, the error check bytes
mentioned above check message integrity whilst Parity checking (even or odd) can be applied to
each byte in the message.
Parity checking
If parity checking is enabled – by selecting either Even or Odd Parity - the quantity of “1’s” will be
counted in the data portion of each transmit character. The parity bit will then be set to a 0 or 1 to
result in an Even or Odd total of “1’s”.
Note that parity checking can only detect an error if an odd number of bits are picked up or dropped
in a transmit character during transmission, if for example two 1’s are corrupted to 0’s the parity
check will not find the error. If No Parity checking is specified, no parity bit is transmitted and no
parity check can be made. Also, if No Parity checking is specified and one stop bit is selected the
transmit character is effectively shortened by one bit.
CRC checking
The error check bytes of the Modbus Protocol messages contain a Cyclical Redundancy Check (CRC)
value that is used to check the content of the entire message. The error check bytes must always be
present to comply with the Modbus Protocol, there is no option to disable it. The error check bytes
represent a 16-bit binary value, calculated by the transmitting device. The receiving device must
recalculate the CRC during receipt of the message and compare the calculated value to the value
received in the error check bytes. If the two values are not equal, the message should be discarded.
The error check calculation is started by first pre-loading a 16-bit register to all 1’s (i.e. Hex (FFFF))
each successive 8-bit byte of the message is applied to the current contents of the register.
Only the eight bits of data in each transmit character are used for generating the CRC, start
bits, stop bits and the parity bit, if one is used, are not included in the error check bytes. During
generation of the error check bytes, each 8-bit message byte is exclusive OR'ed with the lower
half of the 16 bit register.
The register is then shifted eight times in the direction of the least significant bit (LSB), with a zero
filled into the most significant bit (MSB) position. After each shift the LSB prior to the shift is extracted
and examined. If the LSB was a 1, the register is then exclusive OR'ed with a pre-set, fixed value.
If the LSB was a 0, no exclusive OR takes place. This process is repeated until all eight shifts have
been performed. After the last shift, the next 8-bit message byte is exclusive OR'ed with the lower
half of the 16 bit register, and the process repeated. The final contents of the register, after all the
bytes of the message have been applied, is the error check value. In the following pseudo code
“ErrorWord” is a 16-bit value representing the error check values.
BEGIN
ErrorWord = Hex (FFFF)
FOR Each byte in message
ErrorWord = ErrorWord XOR byte in message
FOR Each bit in byte
Содержание EngyVolt RV15
Страница 2: ......
Страница 6: ...Safety instructions EngyVolt RV15 6 Reference to a page in this manual Reference to a graphic ...
Страница 62: ......
Страница 63: ......
Страница 64: ...www endress com worldwide BA01040K 09 EN 01 11 71155512 EH COSIMA ...