beautypg.com

Control variables, Linear interpolation – Galil DMC-2X00 User Manual

Page 46

background image

AP ,50000

Wait until position B=50000

SP ,10000

Change speed of B

EN End

program

To start the program, command:

XQ #B

Execute Program #B

Control Variables

Objective: To show how control variables may be utilized.

Instruction Interpretation

#A;DP0

Label; Define current position as zero

PR 4000

Initial position

SP 2000

Set speed

BGA Move

A

AMA

Wait until move is complete

WT 500

Wait 500 ms

#B
V1 = _TPA

Determine distance to zero

PR -V1/2

Command A move 1/2 the distance

BGA

Start A motion

AMA

After A moved

WT 500

Wait 500 ms

V1=

Report the value of V1

JP #C, V1=0

Exit if position=0

JP #B

Repeat otherwise

#C Label

#C

EN

End of Program

To start the program, command

XQ #A

Execute Program #A

This program moves A to an initial position of 1000 and returns it to zero on increments of half the
distance. Note, _TPA is an internal variable which returns the value of the A position. Internal
variables may be created by preceding a DMC-2x00 instruction with an underscore, _.

Linear Interpolation

Objective: Move A,B,C motors distance of 7000,3000,6000, respectively, along linear trajectory.
Namely, motors start and stop together.

36

Chapter 2 Getting Started

DMC-2X00