19
The MODBUS protocol is a master/slave packet based protocol with the 1250-LTC operating
as a RTU slave. The MODBUS function commands recognized by the 1250-LTC are “3”
(read multiple registers) and “16” (write multiple registers). By supporting these two
commands the 1250-LTC is in level 0 compliance. Using these two commands it is possible
to configure the 1250-LTC as well as monitor it for current position. MODBUS RTU
command and response packets are formatted as follows:
2.3.1 MODBUS Packet Format - Read
Reading from Holding Registers:
GAP = A gap in transmission of 3.5 character frames indicates to the slaves that a new packet
is to follow. No transmission gaps within a packet may exceed 1.5 character frames.
Byte 1 = Device Address: Address 0 is a broadcast address that all units respond to regardless
of programmed address. All other addresses can be programmed and used in this mode.
Byte 2 = Function Code: When reading holding registers, this byte is “03h”
Data Block = Begins with the number of the first register (two bytes) in a command packet,
or data from the first register (two bytes) in a response packet. Followed by the number of
registers to be read (two bytes) in a command packet, or by data from subsequent registers.
Last 2 Bytes = Error Checking CRC – Lo Byte & Hi Byte
Table 2.3 Read Registers Command Format
GAP
3.5
Char
Device
Address
Function
Code
# of First
Register
Hi
# of First
Register
Lo
# of
Registers to
Read Hi
# of
Registers to
Read Lo
CRC
Lo
CRC
Hi
Min. 80h 03h 01h 03h 00h 04h xx xx
Table 2.4 Read Registers Response Format
GAP
3.5
Char
Device
Address
Function
Code
Byte
Count
Data from
First Register
Hi
Data from
First Register
Lo
Data from
Second
Register
Hi
Data from
Second
Register
Lo
Min. 80h 03h 08h 01h 03h 00h 03h
…… …… Data from Last
Register Hi
Data from Last
Register Lo
CRC
Lo
CRC
Hi
…… …… 00h 02h xx xx