2-103
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Comparison Instructions
2
Table Cm p
The TableCmp instruction compares comparison data In with the number of defined ranges specified by
the value of Size in comparison table Tabl e[ ] .
Ta bl e[ ] is a two-dimensional array. The first dimension contains the numbers of the defined ranges. In
the second dimension, element 0 is set value A of the defined range and element 1 is set value B of the
defined range.
Set value A and set value B define range as shown below. Set value A and set value B are always
included in the range.
The results of comparing In and Ta bl e[ ] are stored in individual comparison results array AryOut[]. If In
is within the defined range for element i, ArayOut[i] will be TRUE. If it is not within the range, ArayOut[i]
will be FALSE. If all Size elements of AryOut[] are TRUE, comparison result Out will be TRUE. Other-
wise, it will be FALSE.
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In OK OK OK OK OK OK OK OK OK OK
Tabl e[ ]
(two-
dimen-
sional
array)
Must be a two-dimensional array with elements that have the same data type as In.
Size OK
AryOut[]
(array)
OK
Out OK
Function
Set value B
Range 0
Range Size − 1
Range 1
Set value A
Table[Size-1,0] Table[Size-1,1]
Table[1,0] Table[1,1]
Table[0,0] Table[0,1]
Set value A ≥ Set value B
Defined
range
Defined range
Defined
range
Set value A ≤ Set value B
Set value B
Set value A
Set value B
Set value A