Bitwise Boolean instructions
91
Part II IEC Instructions
NOT
Bit inversion
To add an enable input and enable output to the instruction, select [With EN/ENO] from the
"Instructions" pane (LD, FBD or IL editor). To reuse an instruction select "Recently used" from the
context menu or press <Ctrl>+<Shift>+<v> in the programming window.
PLC types
Availability of NOT (see page 1328)
All operands must be of the same data type.
Data type I/O Function
BOOL, WORD,
DWORD
input input for NOT operation
BOOL, WORD,
DWORD
output as input result
This example uses variables. You can also use a constant for the input variable.
Description
NOT performs a bit inversion of input variables. The result will be written into the output variable.
Data types
Example
In this example, the same POU header is used for all programming languages. For an example
using IL (instruction list), please refer to the online help.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
Body
The bits of input_value are inversed (0 is inversed to 1 and vice versa). The inversed result is
written into negation.
LD
ST
When programming with structured text, enter the following:
negation:= NOT(input_value);