NE
Function Name |
NE (Not Equals) |
---|---|
Description |
Outputs a True value when Input 1 is different to Input 2. |
Arguments |
Input 1 {ANY} Input 2 {ANY} For more information on the data types for the inputs and outputs, see Data Type Hierarchy. |
Returns |
Output {BOOL} The output is True only if Input 1 is different to Input 2. If Input 2 has the same value as Input 1, the NE function outputs a False value. |
Example:
Function Block Diagram - NE:
An NE function has 2 inputs (in this case, 2 constant values). Input 1 is has a value of 4 and Input 2 has a value of 2. The NE function outputs a True value as Input 1 is different to Input 2.
If Input 2 was changed to have a value of 4, the NE function would output a False value as Input 1 would be equal to Input 2. It is only when Input 1 is different to Input 2 that the NE function outputs a True value.
ST Program - NE:
The syntax for a NE function in an ST Program is:
- Output := NE (Input 1, Input 2)
Where Output, Input 1 and Input 2 are defined as variables earlier in the ST program. Each input is separated by a comma and is a Boolean. The Output value is also a Boolean.