Siemens SIMATIC S5 CP 523 Manual page 182

Serial i/o module
Hide thumbs Also See for SIMATIC S5 CP 523:
Table of Contents

Advertisement

CP 523
Example:
Receiving a message frame with a length of 12 bytes
Start address 128 is set on the module. The message frame is to be stored in data block 21
beginning DW0. Flag 101.0 is to be set if a message frame is in DB 21. The STL does not explain
how flag 101.0 is reset. You could reset the flag when you have evaluated the message frame and
it can be overwritten in DB 21.
STL FB 125
NAME :RECEIVE2
:A
F
101.0
:BEC
:L
KH
A080
:T
PW
128*
:L
KH
0080
:L
PW
128
:AW
:><F
:BEC
:S
F
101.0
:C
DB
21
:L
KH
:T
PW
128*
:L
PW
134
:T
DW
3
:L
PW
132
:T
DW
2
:L
PW
130
:T
DW
1
:L
PW
128
:T
DW
0
:L
KH
0000
:T
PW
128*
:L
PW
130
:T
DW
5
:L
PW
128
:T
DW
4
:BE
*
5.2
EWA 4NEB 811 6044-02a
Flag 101.0 is set if a message frame is in DB 21
Then conditional Block End
Load "Receive message frame" request in ACCUM 1,
transfer to word 0 of the transfer memory
and check if the Receive mailbox is empty
Read and evaluate coordination information
If Receive mailbox is empty,
then conditional Block End
If not empty, then set flag 101.0
and open DB 21
0000
Read word 6 of the transfer memory
and store in DW3
Read word 4 of the transfer memory
and store in DW2
Read word 2 of the transfer memory
and store in DW1
Read word 0 of the transfer memory
and store in DW0
Write word 0 of the transfer memory
Read word 2 of the transfer memory
and store in DW5
Read word 0 of the transfer memory
and store in DW4
Block End
Communications Mode
Explanation
7-77

Advertisement

Table of Contents
loading

Table of Contents