5-11
5 Modbus Connection
NB-series Programmable Terminals Host Connection Manual (V108)
5-6 Modbus Protocol
5
5-6-2 When NB adopts Modbus TCP protocol (Master/Slave mode)
The read/write function codes corresponding to each mode are as follows:
* This function code is not supported when the PT operates as the slave.
Data area
The data area includes the required data from PT or replied data from the devices such as variables,
referred addresses, and setting values. For instance, when the PT is informed of memory read by
the function code, which memory and which area of the memory should be read are necessary to be
specified in the data field. The specified addresses and data type are varied according to the slave
specifications.
Error checking code
Modbus protocol checks if the message frame could be received correctly. Besides the parity check
of serial protocol, it is checked using LRC in ASCII mode or 16 bits CRC in RTU mode. In TCP
mode, only parity check is performed.
When the PLC and the PT are connected via the Modbus protocol, 2 situations exist depending on the
master and slave statuses of the devices.
(1) PT is the master and PLC is the slave
The PT as the master and the PLC as the slave communicate through the Modbus TCP protocol. The
PLC is operated in slave mode of Modbus TCP protocol, and also performs mapping on the 0X, 1X, 3X
and 4X registers (hereof, the 0X and 1X are bit registers, and the 3X, while 3X and 4X are word
registers.)
(2) PLC is the master, and PT is the slave
The PLC as the master and the PT as the slave communicate through the Modbus TCP protocol. The
PLC is operated as the master in the Modbus TCP protocol. The PT performs mapping LB on the 0X
and LW on the 4X registers. These addresses can be written and read by the PLC.
The corresponding relations of the registers are as below:
Mode
Function
Modbus RTU, Modbus RTU Extend,
Modbus RTU Slave, Modbus ASCII
Modbus TCP
Bit Word Bit Word
Read 01, 02 03, 04 01, 02* 03, 04*
Write 05, 15 06, 16 05, 15 06, 16
5-6-2 When NB adopts Modbus TCP protocol (Master/Slave mode)
Method Mater/Slave Protocol used Descriptions
1 PT as the master Modbus TCP The PT accesses the 0X, 1X, 3X and 4X registers
mapped out by the PLC.
PLC as the slave Modbus TCP Slave
2 PT as the slave Modbus TCP Slave The PT local address LW is mapped as the 4X
register, and the LB as the 0X register.
PLC as the master Modbus TCP
Modbus register address range The corresponding PT local address range
0X(1---9000) LB(0---8999)
4X(1---9000) LW(0---8999)