NOT
Function Name |
NOT |
---|---|
Description |
Outputs the opposite value to the input. |
Arguments |
Input 1 {BOOL} For more information on the data types for the inputs and outputs, see Data Type Hierarchy. |
Returns |
Output {BOOL} If Input 1 is True, the Output is False If Input 1 is False, the Output is True. |
Example:
Function Block Diagram - NOT:
An input named 'FlowPresent' provides a Boolean value. When True, it means that a sensor has detected a flow; when False, the sensor has not detected a flow.
The NOT function returns the opposite value to the input, so if the 'FlowPresent' input is True, the NOT function returns a False value. If the 'FlowPresent' input is False, the NOT function returns a True value.
ST Program - NOT:
The NOT function is used to provide a Boolean value that is True if the input is False, and False if the input is True. The syntax for a NOT function in an ST Program is:
- Output := NOT (Input 1);
Where Output and Input 1 are defined as variables earlier in the ST program. Input 1 is a Boolean input and Output is also a Boolean value.