Siemens SIMATIC CP 541 Manual page 118

Communications processor
Table of Contents

Advertisement

Program Examples
STL
OB 1
Segment 1
:JU FB
12
Name
:S 11=>12
ANST
:I 32.0
:
:JU FB
11
:R 11<=12
:
:BE
FB11
Segment 1
Name
:R 11<=12
:Q
F
11.7
:BEC
:
:Q
DB
11
:L
DW
1
:T
QB
32
:
:AN
F
11.7
:S
F
11.7
:BE
FB12
Segment 1
Name
:S 11=>12
Des
:ANST I/Q/D/B/T/C: I BI/BY/W/D: BI
:Q
F
12.7
:BEC
:
:Q
=ANST
:AN
F
0.0
:=
F
0.1
:Q
=ANST
:=
F
0.0
:
:AN
F
0.1
:BEC
:
:Q
DB
12
:L
KY 2,12
:T
DW
0
:L
IB
33
:T
DW
1
:
:AN
F
12.7
:S
F
12.7
:
:BE
H-4
Explanation
Cyclic program block
FB to send to station 12
Initiate sending with I 32.0
FB to receive from station 12
Receive block
Test whether L1 message present
If not, block end
Open receive mailbox
Output DR 1 to QB 32
Indication for operating system,
ready to receive again
Send block
If send mail box blocked by operating
system, then block end
Initiation bit
Auxiliary flag for signal edge
Signal edge flag
Auxiliary flag for next cycle
If positive-going edge
Open send mailbox
Send 2 bytes to station 12
Store IB 33 in DR 1
Release send mailbox for operating
system
Communications Processor CP 541
EWA 4NEB 812 6188-02

Advertisement

Table of Contents
loading

Table of Contents