EasyManua.ls Logo

Omron NJ501-1500

Omron NJ501-1500
990 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
2 Instruction Descriptions
2-104
NJ-series Instructions Reference Manual (W502)
The following example is for when In is INT#120 and Size is UINT#3.
Use the same data type for In and Table[]. Otherwise, a compiling error will occur.
Use a two-dimensional array for Ta bl e [] . A compiling error will occur if you use any other size of array.
If an array with more than two dimensions is used for Ta bl e [] , the elements in the third and higher
dimensions are ignored.
If the AryOut[] array is larger than the value of Size, the comparison results will be stored in AryOut[0]
to AryOut[Size
1]. Other elements of the array will not change.
Signed integers (SINT, INT, DINT, and LINT) cannot be compared to unsigned integers (USINT, UINT,
UDINT, and ULINT).
If real numbers are compared, 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 FALSE and AryOut[] will not change.
If this instruction is used in a ladder diagram, the value of Out changes to FALSE if an error occurs in
the previous instruction on the rung.
An error occurs in the following cases. Out will be FALSE.
If the value of Size exceeds the size of the AryOut[] array.
If the value of Size exceeds the size of the first dimension of the Ta ble[] array.
The size of the second dimension of Tabl e [ ] is 1.
Precautions for Correct Use
ghi:=TableCmp(INT#120, abc[1,2], UINT#3, def[3]);
LD ST
ghi
INT#120
abc[1,2]
def[3]
def[3]
UINT#3
TableCmp
EN
In
Tabl e
Size
AryOut
Table[0,0]=abc[1,2]
Table[1,0]=abc[2,2]
Table[2,0]=abc[3,2]
Table[0,1]=abc[1,3]
AryOut[0]=def[3]
AryOut[1]=def[4]
AryOut[2]=def[5]
099
TRUE
FALSE
FALSE
Table[1,1]=abc[2,3]
100 199
Table[2,1]=abc[3,3]
200 299
Out=ghi
FALSE
Size=UINT#3
In=INT#120

Table of Contents

Related product manuals