Sizeofary - Omron NJ501-1500 Reference Manual

Machine automation controller nj-series
Hide thumbs Also See for NJ501-1500:
Table of Contents

Advertisement

SizeOfAry

The SizeOfAry instruction gets the number of elements in an array.
Instruction
SizeOfAry
Get Number of
Array Elements
Variables
Name
Meaning
In[] (array)
Array
Out
Number of
elements
* If you omit the input parameter, the default value is not applied. A building error will occur.
Bit strings
OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK OK
In[] (array)
Out
Function
The SizeOfAry instruction gets the number of elements in array In[]. For the input parameter, use an
array name, such as array, and not an array element name, such as array[0].
The following figure shows a programming example.
LD
EN
abc
In
In[0]=abc[0]
In[1]=abc[1]
In[2]=abc[2]
In[3]=abc[3]
NJ-series Instructions Reference Manual (W502)
Name
FB/FUN
FUN
I/O
Description
Input
Array
Output
Number of elements
Arrays of enumerations or structures can also be specified.
OK
Variable
Data type
abc
ARRAY[0..3] OF INT
SizeOfAry
ENO
def
Number of array elements
Graphic expression
(@)SizeOfAry
EN
ENO
In
Out
Valid range
Depends on data type.
Depends on data type.
Integers
ST
def:=SizeOfAry(abc);
Out=def
UINT#4
2 Instruction Descriptions
ST expression
Out:=SizeOfAry(In);
Unit
Default
*
---
---
---
Times, durations,
dates, and text strings
2
2-463

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1400

Table of Contents