Ny-Series Instructions Reference Manual (W560 - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

2 Instruction Descriptions
Function
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:
Instruction
AryCmpLT
AryCmpLE
AryCmpGT
AryCmpGE
The following example shows the AryCmpLT instruction when Size is UINT#3.
LD
EN
abc[1]
In1
def[2]
In2
Size
UINT#3
AryOut
ghi[3]
In1[0]=abc[1]
In1[1]=abc[2]
Size=UINT#3
In1[2]=abc[3]
Precautions for Correct Use
• Use the same data type for In1[] and In2[]. If they are different, a building error will occur.
• 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 the In1[], In2[], or AryOut[] array is smaller than the value of Size.
2-118
If In1[i] < In2[i], the result is TRUE. Otherwise, it is FALSE.
If In1[i] <= In2[i], the result is TRUE. Otherwise, it is FALSE.
If In1[i] > In2[i], the result is TRUE. Otherwise, it is FALSE.
If In1[i] >= In2[i], the result is TRUE. Otherwise, it is FALSE.
ST
AryCmpLT(abc[1], def[2], UINT#3, ghi[3]);
AryCmpLT
ENO
ghi[3]
110
In2[0]=def[2]
120
In2[1]=def[3]
140
In2[2]=def[4]
Value of AryOut[i]
100
AryOut[0]=ghi[3]
AryOut[1]=ghi[4]
130
160
AryOut[2]=ghi[5]

NY-series Instructions Reference Manual (W560)

FALSE
TRUE
TRUE

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents