String data format (string) – Basler Electric DGC-2020HD Modbus Protocol User Manual

Page 15

Advertising
background image

9469300991 Rev A

9

DGC-2020HD Modbus

™ Protocol

General Information

Long Integer Data Format (Uint32, Int32, and IP Address)

The Modbus long integer data format uses two consecutive holding registers to represent a 32-bit data
value. The first register contains the low-order 16 bits and the second register contains the high-order 16
bits.

Example: The value 95,800 represented in long integer format is hexadecimal 0x00017638. This number
will read from two consecutive holding registers as follows:

Holding Register

Value

K (Hi Byte)

hex 76

K (Lo Byte)

hex 38

K+1 (Hi Byte)

hex 00

K+1 (Lo Byte)

hex 01

The same byte alignments are required to write.

Integer Data Format (Uint16) or Bit-Mapped Variables in Uint16 Format

The Modbus integer data format uses a single holding register to represent a 16-bit data value.

Example: The value 4660 represented in integer format is hexadecimal 0x1234. This number will read from
a holding register as follows:

Holding Register

Value

K (Hi Byte)

hex 12

K (Lo Byte)

hex 34

The same byte alignments are required to write.

The Uint16 Data Format is listed in Binary Points below.

Example: Register 1100 occupies 16 rows in the Register Table where each row gives the name of
specific bit-mapped data such as 1100-0 indicates bit 0 of register 1100 is mapped to RF-TRIG.

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’

Advertising