beautypg.com

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

Page 439

background image

9400200990 Rev X

DGC-2020 Modbus

™ Communication

B-7

The value of the floating-point number is obtained by multiplying the binary mantissa times two raised to
the power of the unbiased exponent. The assumed bit of the binary mantissa has the value of 1.0, with
the remaining 23 bits providing a fractional value. Table B-2 shows the floating-point format.

Table B-2. Floating Point Format

Sign

Exponent + 127

Mantissa

1 bit

8 bits

23 bits

The floating-point format allows for values ranging from approximately 8.43X10

-37

to 3.38X10

38

. A floating-

point value of all zeroes is the value zero. A floating-point value of all ones (not a number) signifies a
value currently not applicable or disabled.

Example: The value 95,800 represented in floating point format is hexadecimal 47BB1C00. This number
will read from two consecutive holding registers as follows:


Holding Register

Value

K (Hi Byte)

hex 1C

K (Lo Byte)

hex 00

K+1 (Hi Byte)

hex 47

K+1 (Lo Byte)

hex BB

The same byte alignments are required to write.

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.

This manual is related to the following products: