![Galil Motion Control RIO-47 series
RIO-47100 Скачать руководство пользователя страница 73](http://html1.mh-extra.com/html/galil-motion-control/rio-47-series-rio-47100/rio-47-series-rio-47100_user-manual_558776073.webp)
Using a Variable to Address Array Elements
An array element number can also be a variable. This allows array entries to be assigned sequentially
using a counter.
For example:
Instruction
Interpretation
#A
Begin Program
COUNT=0;DM POS[10]
Initialize counter and define array
#LOOP
Begin loop
WT 10
Wait 10 msec
INPUT[COUNT]=_TI0
Record bank 0’s input bit value into array element
INPUT[COUNT]=
Report input bit value
COUNT=COUNT+1
Increment counter
JP #LOOP,COUNT<10
Loop until 10 elements have been stored
EN
End Program
The above example records 10 input bit values for bank 0 at a rate of one value per 10 msec. The
values are stored in an array named INPUT. The variable, COUNT, is used to increment the array
element counter. The above example can also be executed with the automatic data capture feature
described below.
Uploading and Downloading Arrays to On Board Memory
Arrays may be uploaded and downloaded using the QU and QD commands.
QU array[],start,end,delim
QD array[],start,end
where array is an array name such as A[].
Start is the first element of array (default=0)
End is the last element of array (default=last element)
Delim specifies whether the array data is separated by a comma (delim=1) or a carriage return
(delim=0).
The file is terminated using <control>Z, <control>Q, <control>D or \.
Automatic Data Capture into Arrays
The RIO provides a special feature for automatic capture of data such as inputs or outputs. Up to four
types of data can be captured and stored in four arrays. The capture rate or time interval may be
specified. Recording can be done as a one-time event or as a circular continuous recording.
Chapter 5 Programming ▫ 73 RIO-47xxx Rev 1.0r