Bitwise Not (NOT)

The NOT instruction performs a bitwise inversion of the Source and places the result in Dest.
Available Languages
Ladder Diagram
Function Block Diagram
Function Block Diagram supports these elements:
Function Block
NOT_FBD_avail_v31
FBD Function
NOT_avail_FBDFunction
Structured Text
This instruction is not available in structured text.
TIP: Use NOT as an operator in an expression to compute the same result. Refer to Structured Text Syntax for more information on the syntax of expressions and assignments within structured text.
Operands
IMPORTANT: Unexpected operation may occur if:
  • Output tag operands are overwritten.
  • Members of a structure operand are overwritten.
  • Except when specified, structure operands are shared by multiple instructions.
There are data conversion rules for mixing numeric data types within an instruction. See Data Conversions.
Ladder Diagram
Operand
Data Type
Format
Description
Source
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
immediate
tag
Value to NOT
Dest
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
tag
Tag to store result of the instruction.
TIP: If the destination type is FLOAT, the resultant value will be converted to floating point.
TIP: When integer promotion is required for the inputs, the smaller type is converted to the larger type using zero extension.
Function Block
Operand
Data Type
Format
Description
NOT
FBD_CONVERT
tag
NOT structure
FBD_CONVERT Structure
Input Members
Data Type
Description
EnableIn
BOOL
Enable input. If false, the instruction does not execute and outputs are not updated.
Default is true.
Source
DINT
Value to NOT.
Output Members
Data Type
Description
EnableOut
BOOL
Indicates if the instruction executed without fault when it was enabled.
Dest
DINT
Result of the instruction.
FBD Function
Input Operands (Left Pins)
Data Type
Description
Source (top)
SINT
USINT
INT
UINT
DINT
UDINT
LINT
ULINT
REAL
LREAL
Value to NOT.
Output Operand (Right Pin)
Data Type
Description
Dest
DINT
UDINT
LINT
ULINT
Result of the function.
Description
When enabled, the instruction evaluates the bitwise NOT operation:
Dest = NOT Source
If the bit in the Source is:
The bit in the Dest is:
0
1
1
0
Affects Math Status Flags
Conditional
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-indexing faults.
Execution
Ladder Diagram
Condition/State
Action Taken
Prescan
N/A
Rung-condition-in is false
Set Rung-condition-out to Rung-condition-in.
Rung-condition-in is true
Set Rung-condition-out to Rung-condition-in.
Dest is set as described in the Description section.
Postscan
N/A
Function Block
Condition/State
Action Taken
Prescan
N/A
EnableIn is false
Set EnableOut to EnableIn.
EnableIn is true
Set EnableOut to EnableIn.
Dest is set as described in the Description section.
Instruction first run
N/A
Instruction first scan
N/A
Postscan
N/A
FBD Function
Condition/State
Action Taken
Prescan
N/A
Normal Scan
Dest = NOT Source
Instruction first run
N/A
Instruction first scan
N/A
Postscan
N/A
Examples
Ladder Diagram
NOT_LD_ex_v31
Function Block
NOT_FBD_ex_v31
FBD Function
Structured Text
value_result_NOT := NOT value_1;
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal