Communication processor and Modbus TCP
13.5 Modbus communication
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
1173
MB_MODE and MB_DATA_ADDR parameters select the Modbus communication function
The MB_CLIENT instruction uses an MB_MODE input rather than a function code.
MB_DATA_ADDR assigns the starting Modbus address of the remote data.
The combination of MB_MODE and MB_DATA_ADDR determines the function code that is
used in the actual Modbus message. The following table shows the correspondence
between parameter MB_MODE, MB_DATA_ADDR, and Modbus function:
Table 13- 58 Modbus functions
0 01 1 to 2000 Read output bits:
1 to 2000 bits per request
1 to 9999
101 01 1 to 2000 Read output bits:
1 to 2000 bits per request
00000 to 65535
0 02 1 to 2000 Read input bits:
1 to 2000 bits per request
10001 to 19999
102 02 1 to 2000 Read input bits:
1 to 2000 bits per request
00000 to 65535
0 03 1 to 125 Read Holding registers:
1 to 125 words per request
40001 to 49999 or
103 03 1 to 125 Read Holding registers:
1 to 125 words per request
00000 to 65535
0 04 1 to 125 Read input words:
1 to 125 words per request
30001 to 39999
104 04 1 to 125 Read input words:
1 to 125 words per request
00000 to 65535
1 05 1 Write one output bit:
1 to 9999
105 05 1 Write one output bit:
00000 to 65535
1 06 1 Write one holding register:
1 word per request
40001 to 49999 or
400001 to 465535
106 06 1 Write one holding register:
00000 to 65535
1 15 2 to 1968
Write multiple output bits:
2 to 1968 bits per request
1 to 9999
1 16 2 to 123 Write multiple holding registers:
2 to 123 words per request
40001 to 49999 or
2 15 1 to 1968 Write one or more output bits:
1 to 1968 bits per request
1 to 9999
2 15 1 to 1968 Write one or more output bits:
1 to 1968 bits per request
1 to 9999
2 15 1 to 1968 Write one or more output bits:
1 to 1968 bits per request
1 to 9999
115 15 1 to 1968 Write one or more output bits:
1 to 1968 bits per request
00000 to 65535