EasyManua.ls Logo

Siemens Simatic S7 Series

Siemens Simatic S7 Series
726 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Program instructions
7.5 Convert
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
215
7.5.5
Encode and decode
LAD / FBD
STL
Description
ENCO IN, OUT
Encode writes the bit number of the least significant bit set in the input word IN, to
the least significant "nibble" (4 bits) of the output byte OUT.
DECO IN, OUT
Decode sets the bit in the output word OUT that corresponds to the bit number
represented by the least significant "nibble" (4 bits) of the input byte IN. All other
bits of the output word are set to 0.
Non-fatal error conditions with ENO =
0
SM bits affected
0006H Indirect address
None
Input / output
Data type
Operand
IN
WORD (ENCO)
IW, QW, VW, MW, SMW, SW, T, C, LW, AC, AIW, *VD, *LD, *AC, Constant
BYTE (DECO)
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *LD, *AC, Constant
OUT
BYTE (ENCO)
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *LD, *AC
WORD (DECO)
IW, QW, VW, MW, SMW, SW, T, C, LW, AC, AQW, *VD, *LD, *AC
Example: Encode and decode
LAD
STL
If AC2 contains error bits:
1. The DECO instruction
sets the bit in VW40 that
corresponds to this error
code
2. The ENCO instruction
converts the least signif-
icant bit set to an error
code that is stored in
VB50.
Network 1
LD I3.1
DECO AC2, VW40
ENCO AC3, VB50

Table of Contents

Other manuals for Siemens Simatic S7 Series

Related product manuals