12.5.3.4
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.
Network 1 Initialize the RS-485 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.
Network 2 Read 100 words from the slave holding register.
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
105BCommunication processor
12.5 Modbus communication
615