Omron NJ-series User Manual page 201

Machine automation controller cpu unit software
Hide thumbs Also See for NJ-series:
Table of Contents

Advertisement

6 Programming
Array Specifications for Instances
Array specifications can be made for instances. You can indirectly specify an array element number
with a variable to execute multiple instances with one instance name. Furthermore, you can switch
input sources and output destinations and effectively execute multiple instances with a single
instance name if you use an array specification for the input parameter and output parameter and
specify the element numbers with the same variable.
Example:
Not Using an Array to Specify Instances
timer0
TON
IN[0]
In
PT[0]
PT
timer1
TON
IN[1]
In
PT[1]
PT
timer2
TON
IN[2]
In
PT
PT[2]
timer3
TON
IN[3]
In
PT[3]
PT
timer4
TON
IN[4]
In
PT[4]
PT
6-14
Using an Array to Specify Instances
OUT[0]
Q
UINT#0
ET
UINT#4
UINT#1
OUT[1]
IN[i]
Q
ET
PT[i]
OUT[2]
Q
ET
OUT[3]
Q
ET
OUT[4]
Q
ET
FOR
EN
ENO
Initval
Index
i
Endval
Stepval
timer[i]
TON
OUT[i]
In
Q
PT
ET
NEXT
ENO
EN
Variable Table
Variable name
IN
OUT
PT
timer
i
NJ-series CPU Unit Software User's Manual (W501)
Here, array variables are
used to specify instances of
the function block definition
TON and all input parameters
and output parameters. All of
the element numbers are
incremented to execute five
instances in succession.
Data type
ARRAY [0..4] OF BOOL
ARRAY [0..4] OF BOOL
ARRAY [0..4] OF TIME
ARRAY [0..4] OF TON
UINT

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents