6
Diagnostics and Interrrupts of the CP 343-2
109
CP 343−2 / CP 343−2 P AS−Interface Master
Release 08/2008
C79000−G8976−C149−04
6.7
Programming Example
The following example illustrates how you can react to a diagnostic interrupt of the
CP 343-2 in OB82 by reading the data record (DS1).
Table 8-1
STL
Explanation
OB82 local data:
20.0
temp
t_header
Struct
+0.0
temp
len
WORD
+2.0
temp
nr
WORD
=4.0
temp
END_STRUCT
OB82 Code:
L 256
L #OB82_MDL_ADDR
<>I
BEC
CALL “RDSYSST”
REQ
:=TRUE
SZL_ID
:=W#16#B3
INDEX
:=W#16#100
RET_VAL :=MW18
BUSY
:=M9.4
SZL_HEADER :=#t_header
DR
:=P#M 100.0 Byte 16
//Example of an error reaction
0
M107.1
0
M107.7
0
M111.3
=
M9.5
//No relevance for the CP 343-2
//Address of the CP 343-2
//Interrupt from the CP 343-2
//DS1 via logical base address
//CP address (256 dec.)
//Structure of the local data
//Destination for DS1
//Error: slave 1
//Error: slave 7
//Error: slave 3B
//Error bit