Modbus packet format – Emerson OpenComms-485 User Manual
Page 5
REV. 5
7/6/2007
Liebert Monitoring Group –Development
2
Modbus Packet Format
Each Modbus packet consists of the following fields:
• Device
Address
• Function
Code
• Data
Field(s)
• Error Check Field
Device Address:
The address field immediately follows the beginning of the frame and consists of
8-bits (RTU). This bit indicates the user assigned address of the slave device
that is to receive the message sent by the attached master device.
Each slave must be assigned a unique address and only the addressed slave will
respond to a query that contains its address.
Function Code:
The function code field tells the addressed slaves what function to perform.
Function codes are specifically designed invoke a specific action by the slave
device. The function code range is from 1 to 127.
OC-485 Modbus server supports the following Modbus function codes.
Code Function
Description
01
Read Coils
Read from 1 to 2000 contiguous status of coils managed
by the server. Coils in the response message are packed
as one per bit of a byte, 1=ON and 0=OFF. If the
requested quantity of coils is not a multiple of 8, zeros
are padded in the final byte.
02 Read
Discrete
Inputs
Read from 1 to 2000 contiguous status of input status
managed by the server. Discrete inputs in the response
message are packed as one per bit of a byte, 1=ON and
0=OFF. If the requested quantity of inputs is not a
multiple of 8, zeros are padded in the final byte.
03 Read
Holding
Registers
Read the contents of contiguous block of 1 to 127
holding registers. Data are packed as two bytes per
register; the first byte contains the high order bits.
04 Read
InputRegisters
Read the contents of contiguous block of 1 to 127 input
registers. Data are packed as two bytes per register; the
first byte contains the high order bits.
05
Write Single Coil
Write a single output to either ON(1) or OFF(0) mapped
in coil section.
06 Write
Single
Register
Write a value into a single holding register;
15 Write
Multiple
Coils
Force each coil in a sequence of coils to either ON or
OFF.