DATA_ADDR and MODE parameters select the Modbus function type
DATA_ADDR (starting Modbus address in the slave): Specifies the starting address of the
data to be accessed in the Modbus slave.
The Modbus_Master instruction uses a MODE input rather than a Function Code input. The
combination of MODE and Modbus address determine the Function Code that is used in the
actual Modbus message. The following table shows the correspondence between parameter
MODE, Modbus function code, and Modbus address range.
Table 13- 76 Modbus functions
MODE
Modbus
Data length
function
0
01
1 to 2000
1 to 1992
0
02
1 to 2000
1 to 1992
0
03
1 to 125
1 to 124
0
04
1 to 125
1 to 124
104
04
1 to 125
1 to 124 1
1
05
1
1
06
1
1
15
2 to 1968
2 to 1960
1
16
2 to 123
2 to 122
2
15
1 to 1968
2 to 1960
2
16
1 to 123
1 to 122
11
11
0
80
08
1
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
Operation and data
Read output bits:
1 to (1992 or 2000) bits per request
1
Read input bits:
1 to (1992 or 2000) bits per request
1
Read Holding registers:
1 to (124 or 125) words per request
1
Read input words:
1 to (124 or 125) words per request
1
Read input words:
1 to (124 or 125) words per request
Write one output bit:
One bit per request
Write one holding register:
1 word per request
Write multiple output bits:
2 to (1960 or 1968) bits per request
1
Write multiple holding registers:
2 to (122 or 123) words per request
1
Write one or more output bits:
1 to (1960 or 1968) bits per request
1
Write one or more holding registers:
1 to (122 or 123) words per request
1
Read the slave communication status word and event
counter. The status word indicates busy (0 – not busy,
0xFFFF - busy). The event counter is incremented for
each successful completion of a message.
Both the DATA_ADDR and DATA_LEN operands of the
Modbus_Master instruction are ignored for this function.
Check slave status using data diagnostic code 0x0000
(Loopback test – slave echoes the request)
1 word per request
Communication processor and Modbus TCP
13.5 Modbus communication
Modbus
address
1 to 9999
10001 to 19999
40001 to 49999 or
400001 to 465535
30001 to 39999
00000 to 65535
1 to 9999
40001 to 49999 or
400001 to 465535
1 to 9999
40001 to 49999 or
400001 to 465535
1 to 9999
40001 to 49999 or
400001 to 465535
1201