Invert Instruction; Encode And Decode Instructions - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

7.9.2

Invert instruction

Table 7- 127 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- 128 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

Encode and decode instructions

Table 7- 129 ENCO and DECO instruction
LAD / FBD
SCL
out := ENCO(IN :=
<expression>);
out := DECO(IN :=
<expression>);
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
1
Table 7- 130 Data types for the parameters
Parameter
Data type
IN
ENCO: Byte, Word, DWord
DECO: UInt
OUT
ENCO: Int
DECO: Byte, Word, DWord
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
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.
Description
ENCO: Bit pattern to encode
DECO: Value to decode
ENCO: Encoded value
DECO: Decoded bit pattern
100BBasic instructions
7.9 Word logic operations
Description
Data element to invert
Inverted output
227

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-1200

Table of Contents