4.
Configure the slave section. The configuration of the CP 040 as Modbus master
happens via the hardware configuration. In addition you need a PLC user applica-
tion for the communication with the following structure:
OB 100: One-time call of the handling blocks FB 60 - SEND and FB 61 - RECEIVE
(or FB 65 SEND_RECV) with all parameters and set R for initialization.
OB 1: Call of FB 60 - SEND (or FB 65 SEND_RECV) with error. For this an area
starting at 0 is stored in the CP 040 where the master may gain access via Modbus.
The FB 61 - RECEIVE with error evaluation allows you to transfer a data area into
the CPU. At a data change by the master, only those data are transferred to the
CPU where changes occurred.
5.6.2 Modbus - Access to multiple slaves
At deployment of multiple slaves with RS485, there cannot occur bus conflict errors
because the master may only communicate with one slave at a time. The master sends a
command telegram to the slave specified via the address and waits for a certain time
where within the slave may send its respond telegram. During the latency the communi-
cation with another slave is not possible. For the communication with multiple slaves
every slave needs a SEND data block for the command telegram and a RECEIVE data
block for the respond telegram. An application with several slaves would consist of an
according amount of data blocks with commands.
These are executed in sequence:
1. slave:
1.
Send command telegram to slave address 1. slave
2.
Receive respond telegram from slave address 1. slave
3.
Evaluate respond telegram
2. slave:
1.
Send command telegram to slave address 2. slave
2.
Receive respond telegram from slave address 2. slave
VIPA System SLIO
Serial communication protocols
Deployment - Modbus > Modbus - Access to multiple slaves
HB300 | CP | 040-1CA00 | en | 18-28
81