9492600990 25-9
DECS-150 Modbus
®
Communication
Short Integer Data Format/Byte Character Data Format (Uint8)
The Modbus short integer data format uses a single holding register to represent an 8-bit data value. The
holding register high byte will always be zero.
Example: The value 132 represented in short integer format is hexadecimal 0x84. This number will read
from a holding register as follows:
Holding Register Value
K (Hi Byte) hex 00
K (Lo Byte) hex 84
The same byte alignments are required to write.
String Data Format (String)
The Modbus string data format uses one or more holding registers to represent a sequence, or string, of
character values. If the string contains a single character, the holding register high byte will contain the
ASCII character code and the low byte will be zero.
Example: The string “PASSWORD” represented in string format will read as follows:
Holding Register Value
K (Hi Byte) ‘P’
K (Lo Byte) ‘A’
K+1 (Hi Byte) ‘S’
K+1 (Lo Byte) ‘S’
K+2 (Hi Byte) ‘W’
K+2 (Lo Byte) ‘O’
K+3 (Hi Byte) ‘R’
K+3 (Lo Byte) ‘D’
Example: If the above string is changed to “P”, the new string will read as follows:
Holding Register Value
K (Hi Byte) ‘P’
K (Lo Byte) hex 00
K+1 (Hi Byte) hex 00
K+1 (Lo Byte) hex 00
K+2 (Hi Byte) hex 00
K+2 (Lo Byte) hex 00
K+3 (Hi Byte) hex 00
K+3 (Lo Byte) hex 00
The same byte alignments are required to write.
CRC Error Check
This field contains a two-byte CRC value for transmission error detection. The master first calculates the
CRC and appends it to the query message. The DECS-150 system 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. If no transmission error has occurred, the slave
calculates a new CRC value for the response message and appends it to the message for transmission.
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 eight-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 eight times. The CRC-register MSB is zero-filled with each
shift. After each shift, the CRC-register LSB is examined. If the LSB is a 1, the CRC-register is
exclusive-ORed with the fixed polynomial value A001 (hex) prior to the next shift. Once all bytes of the