- 24 -
6.1 Modbus Communication Protocol Overview
Modbus communication uses a single-master-multiple-slave configuration.
In Modbus communication, a transaction is always initiated by a master, in which the master sends
a request message then a slave returns a response message.
6.1.1
Message Configuration
A Modbus message frame consists of the following four items: unit ID (IP address), function code,
data and error check code. They are transmitted in the following sequence.
Item
Message data
Data size
(1) Address
Unit ID (IP address)
1 byte
(2) Function
Function code
1 byte
(3) Data
Data
Variable length of up to125 words (250 bytes)
(4) CRC
Error check code
2 bytes
Error check code is not included in Modbus TCP (Ethernet) message frame.
(1) Unit ID (IP address)
Only when the slave’s unit ID (IP address) and the one specified by the master match, the slave
will process the relevant request message. If they do not match, the slave will not respond to the
master.
In the Modbus RTU (RS-485) communication, the address set using the address setting
switches represents the Unit ID. In the Modbus TCP (Ethernet) communication, the address set
using the address setting switches represents the 4th value of the IP address.
For how to set the address setting switches, refer to (3) “Set the address” of 5.3.1
“DIP Switches”.
Do not use the address “255 (1111 1111)”, because the communication will be disabled.
The address can be set to any value within the settable range, but if the same address is
used by more than one unit (detector), the relevant units cannot communicate.
(2) Function code
The function code tells the slave what kind of action to perform. The slave (this detector) will
take action specified by the function code it supports. After the slave performs the specified
action normally, it will return a response message including the same function code.
Refer to 6.2 “Function Codes” for the function codes supported by this product.
A register address to read from/write to will be assigned per function code.
There are four types of registers: coil, input status, input register, and holding
register. The address range to read from/write to differs depending on the
register type.
All Modbus registers where this detector’s data items are saved per function
code supported by this detector, are holding registers.
Holding register address range is from 40001 to 49999 on the Modbus protocol.
This detector’s data (e.g. gas concentrations, device setup details) will be
allocated in this range.
NOTE
NOTE
NOTE