Siemens SIMATIC S5 CP 523 Manual page 156

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

Advertisement

CP 523
Example:
Reading coordination information after "Receive message frame"
Start address 128 is set on the CP 523. If the CP has received message frames from the peripheral
device, these are to be transferred to the CPU. The message frames transferred from the
peripheral device have a fixed length of four bytes. The message frame is to be stored on the CPU
in DB 21 beginning DW 0.
STL FB 120
NAME :RECEIVE1
:L
KH
A080
:T
PW
128*
:L
KH
0080
:L
PW
128
:AW
:><F
:BEC
:C
DB
21
:L
KH
0000
:T
PW
128*
:L
PW
130
:T
DW
1
:L
PW
128
:T
DW
0
:BE
*
5.2
Example:
Parity check
Start address 128 is set on the module. FB 120 is to be invoked when a parity error is detected. The
error is processed in FB 120, for instance by requesting the peripheral device to retransmit the
frame.
STL FB 121
:L
KH
A080
:T
PW
128*
:L
PW
128
:L
KH
0F00
:AW
:L
KH
0A00
:!=F
:JC FB 120
NAME :PARCHECK
:BE
*
5.2
EWA 4NEB 811 6044-02a
Load "Receive message frame" into ACCUM 1 and transfer
to word 0 of the transfer memory.
Check that the Receive mailbox is empty
Read the coordination data
If the Receive mailbox is empty,
Block End
If it is not empty, open DB 21 and read out message frame data
Read word 2 of the transfer memory
and store in DW 1
Read word 0 of the transfer memory
and store in DW 0
Block End
Fetch data frame
from CP 523
Read module status
Blank error
Has a parity error been detected?
If yes, jump to FB 120;
If no, block end
Communications Mode
Explanation
Explanation
7-51

Advertisement

Table of Contents
loading

Table of Contents