Communication processor and Modbus TCP
13.5 Modbus communication
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
1175
MB_DATA_PTR parameter assigns a communication buffer
● MB_CLIENT communication functions:
– Read and write 1-bit data from Modbus server addresses (00001 to 09999)
– Read 1-bit data from Modbus server addresses (10001 to 19999)
– Read 16-bit word data from Modbus server addresses (30001 to 39999) and (40001 to
49999)
– Write 16-bit word data to Modbus server addresses (40001 to 49999)
● Word or bit sized data is transferred to/from the DB or M memory buffer assigned by
MB_DATA_PTR.
● If a DB is assigned as the buffer by MB_DATA_PTR, then you must assign data types to
all DB data elements.
– The 1-bit Bool data type represents one Modbus bit address
– 16-bit single word data types like WORD, UInt, and Int represent one Modbus word
address
– 32-bit double word data types like DWORD, DInt, and Real represent two Modbus
word addresses
● Complex DB elements can be assigned by MB_DATA_PTR, such as
– Arrays
– Named structures where each element is unique.
– Named complex structures where each element has a unique name and a 16 or 32 bit
data type.
● No requirement that the MB_DATA_PTR data areas be in the same global data block (or
M memory area). You can assign one data block for Modbus reads, another data block
for Modbus writes, or one data block for each MB_CLIENT.