EasyManua.ls Logo

Siemens SIMATIC S7-1200

Siemens SIMATIC S7-1200
1614 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...
Basic instructions
8.9 Word logic operations
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
327
8.9.2
INV (Create ones complement)
Table 8- 169 INV instruction
LAD / FBD
SCL
Description
Not available
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.
1
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
Table 8- 170 Data types for the parameters
Parameter
Data type
Description
IN
SInt, Int, DInt, USInt, UInt, UDInt, Byte, Word, DWord
Data element to invert
OUT
SInt, Int, DInt, USInt, UInt, UDInt, Byte, Word, DWord
Inverted output
8.9.3
DECO (Decode) and ENCO (Encode) instructions
Table 8- 171 ENCO and DECO instruction
LAD / FBD
SCL
Description
out := ENCO(_in_);
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 parame-
ter IN is either 0000 0001 or 0000 0000, then a value of 0 is re-
turned to parameter OUT. If the parameter IN value is 0000 0000,
then ENO is set to FALSE.
out := DECO(_in_);
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.
1
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals