2 Instruction Descriptions
2-106
NJ-series Instructions Reference Manual (W502)
These instructions compare the values of the elements with the same element numbers in two arrays
(In1[0] to In1[Size−1] and In2[0] and In2[Size−1]). The comparison results are stored in comparison
results array AryOut[] in the elements with the corresponding element numbers (AryOut[0] to Ary-
Out[Size −1]).
The value of AryOut[i] is as follows for each instruction:
The following example shows the AryCmpEQ instruction when Size is UINT#3.
• Use the same data type for In1[] and In2[].
• Use an AryOut[] array that is at least as large as the value of Size.
• If In1[] and In2[] contain real numbers, error may cause unexpected processing results. This can
occur, for example, when they contain non-terminating decimal numbers.
• If the value of Size is 0, the value of Out will be TRUE and AryOut[] will not change.
• Return value Out is not used when the instruction is used in ST.
• An error occurs in the following cases. ENO will be FALSE, and AryOut[] will not change.
• If In1[] and In2[] contain different data types.
• If the In1[], In2[], or AryOut[] array is smaller than the value of Size.
Function
Instruction Value of AryOut[i]
AryCmpEQ If In1[i] = In2[i], the result is TRUE. Otherwise, it is FALSE.
AryCmpNE If In1[i] ≠In2[i], the result is TRUE. Otherwise, it is FALSE.
Precautions for Correct Use
AryCmpEQ(abc[1], def[2], UINT#3, ghi[3]);
LD ST
abc[1]
def[2]
ghi[3] ghi[3]
UINT#3
AryCmpEQ
EN ENO
In1
In2
Size
AryOut
In1[0]=abc[1]
In1[1]=abc[2]
In1[2]=abc[3]
In2[0]=def[2]
In2[1]=def[3]
In2[2]=def[4]
AryOut[0]=ghi[3]
AryOut[1]=ghi[4]
AryOut[2]=ghi[5]
Size=UINT#3
100
120
140
100
130
160
TRUE
FALSE
FALSE