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

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

Advertisement

Function
These instructions compare comparison value In2 with the specified elements in an array (In1[0] to
In1[Size − 1]). The comparison results are stored in comparison results array AryOut[] in the elements
with the corresponding element numbers (AryOut[0] to AryOut[Size −1]).
The value of AryOut[i] is as follows for each instruction:
Instruction
AryCmpLTV
AryCmpLEV
AryCmpGTV
AryCmpGEV
The following example shows the AryCmpLEV instruction when In2 is INT#20 and Size is UINT#3.
LD
abc[1]
INT#20
UINT#3
def[2]
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[] contains real numbers and In2 is a real number, 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 case. ENO will be FALSE, and AryOut[] will not change.
• If the In1[] or AryOut[] array is smaller than the value of Size.

NY-series Instructions Reference Manual (W560)

If In1[i] < In2, the result is TRUE. Otherwise, it is FALSE.
If In1[i] <= In2, the result is TRUE. Otherwise, it is FALSE.
If In1[i] > In2, the result is TRUE. Otherwise, it is FALSE.
If In1[i] >= In2, the result is TRUE. Otherwise, it is FALSE.
AryCmpLEV
EN
ENO
In1
In2
Size
AryOut
def[2]
In2=INT#20
10
20
In2=INT#20
30
In2=INT#20
Value of AryOut[i]
ST
AryCmpLEV(abc[1], INT#20, UINT#3, def[2]);
AryOut[0]=def[2]
AryOut[1]=def[3]
AryOut[2]=def[4]
2 Instruction Descriptions
TRUE
TRUE
FALSE
2
2-123

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents