PR 10000,20000

Specify move distance

RC1

Start recording now, at rate of 2 msec

BG AB

Begin motion

#A;JP #A,_RC=1

Loop until done

MG "DONE"

Print message

EN

End program

#PLAY

Play back

n=0

Initial Counter

JP# DONE,N>300

Exit if done

n=

Print Counter

apos [n]=

Print X position

bpos [n]=

Print Y position

aerr[n]=

Print X error

berr[n]=

Print Y error

n=n+1

Increment Counter

#DONE

Done

EN

End Program

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.

Example- Inputting Numeric Data

#A

IN "Enter Length",lenA

EN

In this example, the message “Enter Length” is displayed on the computer screen. The controller waits for the operator to enter a value. The operator enters the numeric value which is assigned to the variable, lenA. (NOTE: Do not include a space between the comma at the end of the input message and the variable name.)

Example- Cut-to-Length

In this example, a length of material is to be advanced a specified distance. When the motion is complete, a cutting head is activated to cut the material. The length is variable, and the operator is prompted to input it in inches. Motion starts with a start button which is connected to input 1.

DMC-2X00

Chapter 7 Application Programming y 105

Page 160
Image 160
Galil DMC-2X00 user manual Input of Data Numeric and String, Deallocating Array Space, Example- Inputting Numeric Data