Chapter 8 Logic Instructions
8-41
FC
NE is used for a not-equal comparison of two variables or constants.
Parameters
Meaning
Description Valid range
In1
Input A value to compare
Depends on the data type of the variable
that the input parameter is connected to.
In2
Input A value to compare
Depends on the data type of the variable
that the input parameter is connected to.
Out
Comparison
result
Output Comparison result
Depends on the data type of the variable
that the output parameter is connected
to.
Boolean
Bit string Integer
Real
number
Time, date
String
BOOL
BYTE
WORD
LWORD
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
STRING
and
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Out
●
Note:
The symbol ● indicates that the parameter is allowed to connect to the variable or constant of the data
type.
Function Explanation
NE is used for a not-equal comparison of two variables and constants. Out is TRUE if In1ǂIn2.
Otherwise, Out is FALSE.
The input parameters In1 and In2 are allowed to be the variables of different data types in this
instruction when the data types of input variables are not BOOL, TIME, DATE, TOD and STRING.
When the data type of one input variable is one of BOOL, TIME, DATE, TOD and STRING, input
parameters In1 and In2 are both required to be of the data type. For example, if the data type of In1
is TIME, the data type of In2 must be TIME. Otherwise, an error will occur in the compiling of the
software.
Precautions for Correct Use
The input variables are not allowed to omit. An error will occur during the compiling of the software
if any input variable is omitted. But the output variable is allowed to omit.
The data type of output variables must be BOOL. Otherwise, an error will occur during the
compiling of the software.