Inv (Create Ones Complement) Instruction; Deco (Decode) And Enco (Encode) Instructions - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

Basic instructions
7.9 Word logic operations
7.9.2

INV (Create ones complement) instruction

Table 7- 130 INV instruction
LAD / FBD
SCL
Not available
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
1
Table 7- 131 Data types for the parameters
Parameter
Data type
IN
SInt, Int, DInt, USInt, UInt, UDInt, Byte, Word, DWord
OUT
SInt, Int, DInt, USInt, UInt, UDInt, Byte, Word, DWord
7.9.3

DECO (Decode) and ENCO (Encode) instructions

Table 7- 132 ENCO and DECO instruction
LAD / FBD
SCL
out := ENCO(_in_);
out := DECO(_in_);
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
1
276
Description
Calculates the binary one's complement of the parameter IN. The one's
complement is formed by inverting each bit value of the IN parameter
(changing each 0 to 1 and each 1 to 0). ENO is always TRUE following
the execution of this instruction.
Description
Encodes a bit pattern to a binary number
The ENCO instruction converts parameter IN to the binary number
corresponding to the bit position of the least-significant set bit of
parameter IN and returns the result to parameter OUT. If
parameter IN is either 0000 0001 or 0000 0000, then a value of 0
is returned to parameter OUT. If the parameter IN value is 0000
0000, then ENO is set to FALSE.
Decodes a binary number to a bit pattern
The DECO instruction decodes a binary number from parameter
IN, by setting the corresponding bit position in parameter OUT to
a 1 (all other bits are set to 0). ENO is always TRUE following
execution of the DECO instruction.
Note: The default data type for the DECO instruction is DWORD.
In SCL, change the instruction name to DECO_BYTE or
DECO_WORD to decode a byte or word value, and assign to a
byte or word tag or address.
Description
Data element to invert
Inverted output
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG

Advertisement

Table of Contents
loading

Table of Contents