Siemens CP 243-2 User Manual

Page of 150
Signaling Errors and Diagnostics in the User Program
4-3
SIMATIC NET CP 243-2 AS-i Master
C79000-G8976-C142/02
4.2
Example: Reading the Delta List
STL Example
The following example in STL applies to a CPU 222 with a CP 243-2 plugged in
directly beside it:
If an AS-i configuration error occurs in the protected mode, the CP 243-2  sets bits
SM 9.0 and SM 11.0 (both bits provide the user with the same information: AS-i
configuration errors).
To obtain more detailed information (which slave has failed), you can read in the
delta list via bank 1 of the analog input area (see Section 2.5.1).
Table 4-1
 
OB1 (STL)
NETWORK 1
LD     SM0.1
//If: bit “First Scan”:
SI     Q1.7, 1
//PLC_RUN = 1
RI     Q1.0, 6
//Select bank 0
LD     I1.1
//If: CP_READY
CALL   2
//Then: AS-i diagnostics
SBR 2 (STL)
NETWORK 1
//Read delta list
LD     SM0.0
//Always 1
=I     Q1.0
//Select bank 1
BMW    AIW0, VW316, 4
//Read delta list
NOT
=I     Q1.0
//Select bank 0
//Below, there are several accesses to the delta list:
LD     V316.1
//If slave 1 has failed
O      V319.7
//Or if slave 31 has failed
=      Q0.0
//Then CPU output bit = 1