Input Of Data (Numeric And String) - Galil Motion Control DMC-21 5 Series User Manual

Table of Contents

Advertisement

Operand Summary - Automatic Data Capture
Example - Recording into An Array
During a position move, store the A and Y positions and position error every 2 msec.
#record;
DM
posA[300],posB[300];
DM
erA[300],erB[300];
RA
posA[],erA[],posB[],erB[];
RD
_TPA,_TEA,_TPB,_TEB;
PR
10000,20000;
SH
AB;
RC
1;
BG
AB;
#loop;
WT
10;
JP
#loop,(_RC=1);
AM
AB;
MO
MG
"Recording
i=0;
#message;
MG
"Motor position: "
,posA[i],posB[i];
MG
"Position Error: "
,erA[i],erB[i];
i=i+1;
JP
#message,(i<300);
EN;
De-allocating Array Space
Array space may be de-allocated using the

Input of Data (Numeric and String)

Sending Data from a Host
The DMC-21x5 can accept ASCII strings from a host. This is the most common way to send data to the controller
such as setting variables to numbers or strings. Any variable can be stored in a string format up to 6 characters by
simply specifying defining that variable to the string value with quotes. To assign a variable a numerical value, the
direct number is used.
All variables on the DMC-21x5 controller are stored with 4 bytes of integer and 2 bytes of fractional data.
Using Communication Interrupt
The DMC-21x5 provides a special interrupt for communication allowing the application program to be interrupted
by input from the user. The interrupt is enabled using the
Chapter 7 Application Programming ▫ 103
OPERAND
_RC
Contains recording status
_RD
Contains the address of the next element for recording
'label for program
'define A,B position arrays
'define A,B error arrays
'select arrays for capture
'select data types
'specify a relative position move
'enable A and B axes
'start recording at rate of 2 msec
'begin motion
'loop label
'Jump to #loop while recording is in progress
AB;
'wait for motion to finish, disable A and B axes
finished";
'print message
'intialize counter
'label to loop for messaging
'send message of recorded motor positions
'send message of recorded position errors
'increment counter
'loop while counting through elements in arrays
'end program
command followed by the array name.
DA
DESCRIPTION
CI
command.
DMC-21x5 User Manual 1.0a1

Advertisement

Table of Contents
loading

Table of Contents