Communication processor and Modbus TCP
12.5 Modbus communication
S7-1200 Programmable controller
762 System Manual, 03/2014, A5E02486680-AG
Modbus RTU master example program
MB_COMM_LOAD is initialized during start-up by using the first scan flag. Execution of
MB_COMM_LOAD in this manner should only be done when the serial port configuration will
not change at runtime.
Initialize the RS485 module parameters only once during the first scan.
One MB_MASTER instruction is used in the program cycle OB to communicate with a single
slave. Additional MB_MASTER instructions can be used in the program cycle OB to
communicate with other slaves, or one MB_MASTER FB could be re-used to communicate
with additional slaves.
Read 100 words from the slave holding register.