Cp440 Master" Program Example; Cp440 Slave" Program Example - Siemens SIMATIC CP 440 Manual

Installation and parameter assignment
Table of Contents

Advertisement

Programming Example – Standard Blocks
9.6.4

"CP440 MASTER" Program Example

This example describes the communication between a master and several slaves.
You can find the program sections for the individual slaves in the "CP440 SLAVE"
program example.
In OB1 the pattern is set for communication with a partner. The branch table in the
"Select Slave" program section is used for this. Depending on the value in MW 8,
either communication to slave 1 (FC 1 call) or 2 (FC 2 call) is selected. The
program can be adapted to include additional slaves.
In FC 1 a send job ("execute new Send-Job" program section with FC 11 call) and
the associated receive job ("execute Recv-Job" program section with FC 21 call)
are called by the slave for the response. The counter "START_TIMER" for
monitoring the response is started with the send job. If the slave does not respond
within the set monitoring time, the timed period expires and there is a switch to the
next slave.
9.6.5

"CP440 SLAVE" Program Example

In FB 40, RECV is called to query whether a job has been received from the
master. For this purpose, in the receive message frame the slave address is
compared with its own address. As soon as there is a job, the reply is sent to the
master with the SEND call.
The parameters can be adapted for other slaves in OB 1.
9-12
Point-to-point connection CP 440 Installation and Parameter Assignment
A5E00057742-02

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents