Siemens Simatic S7-200 System Manual page 299

Programmable controller
Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

Decode, Encode Examples
I3.1
EN
AC2
IN
AC2 contains the error code 3. The DECO instruction
sets the bit in VW40 that corresponds to this error code.
Figure 10-53
I3.1
EN
AC2
IN
AC2 contains the error bit. The ENCO instruction converts the
least significant bit set to an error code that is stored in VB40.
Figure 10-54
Segment Example
I3.3
EN
VB48
IN
Figure 10-55
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02
LAD
DECO
Set the bit that corresponds
to the error code in AC2.
OUT
VW40
Application
Example of Setting an Error Bit Using Decode
LAD
ENCO
Convert the error bit in AC2
to the error code in VB40.
OUT
VB40
Application
Example of Converting the Error Bit into an Error Code Using Encode
LAD
SEG
OUT
AC1
Application
05
VB48
SEG
AC1
6D
Example of Segment Instruction
Instruction Set
STL
LD
I3.1
DECO
AC2, VW40
AC2
3
DECO
15
VW40
0000 0000 0000 1000
STL
LD
I3.1
ENCO
AC2, VB40
15
9
AC2
1000 0010 0000 0000
ENCO
VB40
9
STL
LD
I3.3
SEG
VB48, AC1
(display character)
3 0
0
10-111

Advertisement

Table of Contents
loading

Table of Contents