Galil Motion Control DMC-21 5 Series User Manual page 107

Table of Contents

Advertisement

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.
#main;
count=0;
DM
pos[10];
#loop;
WT
10;
pos[count]=_TPA;
pos[count]=?;
count=count+1;
JP
#loop,(count<10);
EN;
The above example records 10 position values at a rate of one value per 10 msec. The values are stored in an array
named 'pos'. 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
The GDK software is recommended for downloading and uploading array data from the controller. The gclib
programming library also provides function calls for downloading and uploading array data from the controller
to/from a buffer or a file. Arrays may uploaded and downloaded when using non Galil software or programming
library by using the QU and QD commands.
Automatic Data Capture into Arrays
The DMC-21x5 provides a special feature for automatic capture of data such as position, position error, inputs or
torque. This is useful for teaching motion trajectories or observing system performance. Up to eight types of data
can be captured and stored in eight arrays. The capture rate or time interval may be specified. Recording can done
as a one time event or as a circular continuous recording.
Command Summary - Automatic Data Capture
Data Types for Recording:
Chapter 7 Application Programming ▫ 102
'program labe
'initialize counter variable
'dimension array
'loop label
'wait 10 msec
'record current A axis motor position
'report position
'increment counter
'jump to #loop while count is less than 10
'end program
COMMAND
RA
Selects predefined arrays for data capture
RD
Selects the type of data to be recorded
RC
Determines the recording rate and indicates to begin recording
DATA TYPE
Controller sample time
TIME
_AFm
Analog Input digital value corresponding to 'm' axis
_DEm
Auxiliary encoder position of the'm' axis
_OP
Digital output states as bitmask
Latched position of the 'm' axis
_RLm
_RPm
Commanded position of the 'm' axis
_SCm
Stop code of the 'm' axis
_TDm
Auxiliary encoder position of the 'm' axis
_TEm
Position error of the 'm' axis
_TI
Digital input states as bitmask
_TPm
Motor encoder position of 'm' axis
_TSm
Status of switches of the 'm' axis
_TTm
Commanded torque of the 'm' axis
DESCRIPTION
DESCRIPTION
DMC-21x5 User Manual 1.0a1

Advertisement

Table of Contents
loading

Table of Contents