Double precision data format (dp), Triple precision data format (tp), Error check – Winco DGC-2020 User Manual

Page 165: Interdependence of preset multiple register data

Advertising
background image

9400200990 Rev B

DGC-2020 Modbus

Communication

B-7

Double Precision Data Format (DP)

The Modbus Double Precision data format (DP) uses 2 consecutive registers to represent a data value.
The first register contains the high-order 16 bits of double precision data, and is the actual data value /
10,000.

The second register contains the low-order 16 bits of double precision data, and is the actual data value
modulus 10,000.

Triple Precision Data Format (TP)

The Modbus Triple Precision data format (TP) uses 3 consecutive registers to represent a data value. The
first register contains the high-order 16 bits of triple precision data, and is the actual data value /
100,000,000. The modulus from this operation is divided by 10,000 to arrive at the value of the second
register, and the modulus of this last operation is the value of the third register (the low-order 16 bits of
triple precision).

Error Check

This field contains a 2-byte CRC value for transmission error detection. The master first calculates the
CRC and appends it to the query message. The DGC-2020 recalculates the CRC value for the received
query and performs a comparison to the query CRC value to determine if a transmission error has
occurred. If so, no response message is generated. Otherwise, the slave calculates a new CRC value for
the response message and appends it to the message for transmission.

Reference the "Modicon Modbus Protocol Reference Guide", PI-MBUS-300 Rev. E, pages 112 - 115 for
an excellent explanation and implementation of the CRC-16 algorithm.

The CRC calculation is performed using all bytes of the Device Address, Function Code, and Data Block
fields. A 16-bit CRC-register is initialized to all 1's. Then each 8-bit byte of the message is used in the
following algorithm:

First, exclusive-OR the message byte with the low-order byte of the CRC-register. The result, stored in
the CRC-register, will then be right-shifted 8 times. The CRC-register MSB is zero-filled with each shift.
After each shift the CRC-register LSB is examined: if 1, the CRC-register is then exclusive-ORed with the
fixed polynomial value A001 (hex) prior to the next shift. Once all bytes of the message have undergone
the above algorithm, the CRC-register will contain the message CRC value to be placed in the Error
Check field.

Interdependence of Preset Multiple Register Data

Preset Multiple Register data is collectively written only after the query has been determined to be legal,
which includes a range-check of the entire data block. Therefore, data which must be written prior to other
data must use a separate query. For example, a Preset Multiple Register Query of the entire Contiguous
Write Block (40023-40055) to set the Battery Overvoltage Pre-alarm Threshold atop the 24V range and
change the Battery Volts from 12V to 24V will fail. The change to 24V would occur simultaneously to
setting the Pre-alarm Threshold, and the threshold value range-check will use the current 12V range.

Advertising