Deallocating Array Space; Input Of Data (Numeric And String); Input Of Data - Galil Motion Control DMC-1600 Series User Manual

Table of Contents

Advertisement

Example - Recording into An Array
During a position move, store the X and Y positions and position error every 2 msec.
#RECORD
DM XPOS[300],YPOS[300]
DM XERR[300],YERR[300]
RA XPOS[],XERR[],YPOS[],YERR[]
RD _TPX,_TEX,_TPY,_TEY
PR 10000,20000
RC1
BG XY
#A;JP #A,_RC=1
MG "DONE"
EN
#PLAY
N=0
JP# DONE,N>300
N=
X POS[N]=
Y POS[N]=
XERR[N]=
YERR[N]=
N=N+1
#DONE
EN

Deallocating Array Space

Array space may be deallocated using the DA command followed by the array name. DA*[0]
deallocates all the arrays.

Input of Data (Numeric and String)

Input of Data

The command, IN, is used to prompt the user to input numeric or string data. Using the IN
command, the user may specify a message prompt by placing a message in quotations. When the
controller executes an IN command, the controller will wait for the input of data. The input data is
assigned to the specified variable or array element.
An Example for Inputting Numeric Data
DMC-1600
#A
IN "Enter Length", LENX
EN
Begin program
Define X,Y position arrays
Define X,Y error arrays
Select arrays for capture
Select data types
Specify move distance
Start recording now, at rate of 2 msec
Begin motion
Loop until done
Print message
End program
Play back
Initial Counter
Exit if done
Print Counter
Print X position
Print Y position
Print X error
Print Y error
Increment Counter
Done
Chapter 7 Application Programming • 143

Advertisement

Table of Contents
loading

Table of Contents