Mod Bus
Mod Bus
How do you establish MODBUS-RTU communication with STEP 7 Basic V10.5 for the SIMATIC
S7-1200?
How do you establish MODBUS-RTU communication with STEP 7 Basic V10.5 for the SIMATIC
S7-1200?
Display part number
Description
The SIMATIC S7-1200 enables point-to-point communication using the communication modules CM
1241 RS485 and CM 1241 RS232.
You can add up to three communication modules to each S7-1200 controller.
Using the MODBUS library integrated in STEP 7 Basic V10.5 you can define each communication
module as a MODBUS master or slave.
If you define the CM 1241 RS232 as MODBUS master, then there is a physical limitation that permits
communication with one slave only.
If you define the CM 1241 RS485 as MODBUS master, then it is possible to communicate with up to
32 slaves one after the other.
We will take a sample project to describe the configuration procedure in STEP 7 Basic V10.5 for
communication with multiple slaves using the CM 1241 RS485.
Instructions
We have taken the example of MODBUS communication between a master and a slave.
There is alternate writing to the holding register of the slave (function code 16) and reading from the
holding register of the slave (function code 03).
Since the RS485 has a two-wire (half-duplex) interface, writing and reading must be conducted
consecutively.
By the same principle, the address of the slave to be addressed can be changed between two
actions (here writing and reading), thus making it possible to exchange data with multiple slaves.
Fig. 01
The CM 1241 RS485 communication modules are linked to each other using a PROFIBUS cable.
You can continue with the PROFIBUS cable to connect up to 31 additional MODBUS slaves to the
master.
The configuration is done in STEP 7 Basic V10.5 SP2. The program code is transferred to the
controllers with the switch CSM 1277.
MB_COMM_LOAD
The configuration block MB_COMM_LOAD is required on both sides (master and slave) for MODBUS
communication.
1 de 2 29/04/2011 15:44
Siemens Industry IA/DT/BT Service&Support - Automation Service, A... http://support.automation.siemens.com/WW/llisapi.dll?func=ll&objid=...
2 de 2 29/04/2011 15:44