Modbus Rtu Master Example Program - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Libraries
9.3 Modbus RTU library
9.3.4

Modbus RTU master example program

This example program shows how to use the Modbus Master instructions to write and read
four holding registers to and from a Modbus slave each time input I0.0 turns on.
The CPU writes four words starting at VW100 to the holding registers of the Modbus slave
starting at address 40001.
The CPU then reads four holding registers from 40010 to 40013 from the Modbus slave and
places the data into the V memory of the CPU starting at VW200.
This example uses a single master and the MBUS_CTRL and MBUS_MSG instructions. The
same concepts apply to examples with a second master and the MB_CTRL2 and MB_MSG2
instructions.
Figure 9-1
494
Example Program Data Transfers
System Manual, V2.3, 07/2017, A5E03822230-AF
S7-200 SMART

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents