
iNS-308 User Manual
Copyright
©
2022 ICP DAS CO., Ltd. All Rights Reserved.
- 35 -
Net ID (Station Number)
The first byte in the frame structure of a Modbus RTU query is the address of the receiver. A valid
address is in the range from 0 to 247. Address 0 is used for general broadcast purposes, while
addresses 1 to 247 are assigned to individual Modbus devices.
Function Code
The second byte in the message structure of a Modbus RTU query is the function code, which
describes what the slave device is required to do. Valid function codes range between 1 and 255. To
answer the query, the slave device uses the same function code as contained in the request. The
highest bit of the function code will only be set to ‘1’ if an error occurs in the system. In this way, the
master device will know whether or not the message has been correctly transmitted.
Code
Function
01 (0x01)
Read Coils status (Readback DO values)
02 (0x02)
Read Input Status (Read DI values)
03 (0x03)
Read Holding Registers (Readback AO values)
04 (0x04)
Read Input Registers (Read AI values)
05 (0x05)
Force Single Coil (Write DO values)
06 (0x06)
Set Single Register (Write AO values)
15 (0x0F)
Force Multiple Coils (Write Dos values)
16 (0x10)
Set Multiple Registers (Write AO values)
Data Field
Data is transmitted in 8-, 16- and 32-bit format. The data for 16-bit registers is transmitted in high-
byte first format. For example: 0x0A0B will be transmittd as 0x0A, 0x0B. The data for 32-bit registers
is transmitted as two 16-bit registers, and is low-word first. For example: 0x0A0B0C0D will be
transmitted as 0x0C, 0x0D, 0x0A, 0x0B.
The data field for messages sent between a master device and a slave device contains additional
information about the action to be taken by the master, or any information requested by the slave. If
the master does not require this information, the data field can be empty.