NE block
Short summary
Name |
NE |
→POU type |
|
Category |
|
Conform to →IEC-standard |
currently restricted
|
Graphical interface |
|
Available since |
|
Functionality
The block is a comparator regarding inequality ("Not Equals to").
Enter the values at the 2 inputs, those values are to be compared. The block returns value TRUE (or an equivalent), if both values do not match – hence, if: IN1<>IN2
Inputs, return value
|
Identifier |
Description |
|
Inputs: |
IN1 |
REAL, LREAL, USINT, UINT, UDINT, ULINT, SINT, INT, DINT, LINT, TIME, BOOL, BYTE, WORD, DWORD, LWORD, STRING, CHAR, DATE_AND_TIME, DATE or TIME_OF_DAY |
1st value |
IN2 |
REAL, LREAL, USINT, UINT, UDINT, ULINT, SINT, INT, DINT, LINT, TIME, BOOL, BYTE, WORD, DWORD, LWORD, STRING, CHAR, DATE_AND_TIME, DATE or TIME_OF_DAY |
2nd value |
|
Return value: |
– |
BOOL |
|
Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.
Example for usage within ST-editor
PROGRAM Test
VAR
result, result2 : BOOL;
END_VAR
result1 := NE(IN1 :=
1.0
, IN2 :=
2.0
); (* The variable
'result1'
evaluates to
'TRUE'
. *)
result2 := NE(IN1 :=
1.0
, IN2 :=
1.0
); (* The variable
'result2'
evaluates to
'FALSE'
. *)
END_PROGRAM
When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.