Specifications
SIMATIC Instructions
9-132
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
Decode, Encode Examples
3
VW40
DECO
IN OUTAC2
LAD STL
LD I3.1
DECO AC2, VW40
I3.1
EN
Application
AC2
DECO
0000 0000 0000
VW40
15 3 0
Set the bit that corresponds
to the error code in AC2.
AC2 contains the error code 3. The DECO instruction
sets the bit in VW40 that corresponds to this error code.
FBD
ENO
VW40
DECO
IN OUTAC2
EN ENOI3.1
1000
Figure 9-43 Example of Setting an Error Bit Using Decode
9
VB40
ENCO
IN OUTAC2
LAD STL
LD I3.1
ENCO AC2, VB40
I3.1
EN
Application
VB40
ENCO
1000 0010 0000 0000
AC2
15 9 0
Convert the error bit in AC2
to the error code in VB40.
AC2 contains the error bit. The ENCO instruction converts the
least significant bit set to an error code that is stored in VB40.
FBD
ENO
VB40
ENCO
IN OUTAC2
EN ENOI3.1
Figure 9-44 Example of Converting the Error Bit into an Error Code Using Encode