Control Variables - Galil Motion Control CDS-3310 User Manual

Table of Contents

Advertisement

After the above program is entered, download to the controller. To start the motion, command:

Control Variables

Objective: To show how control variables may be utilized.
To start the program, command
XQ #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 CDS-3310 instruction with an underscore, _.
CDS-3310
#LOOP
PA v1
BG
AM
WT 500
TP
v1=v1+1000
JP #LOOP,v1<10001
EN
XQ #A
Instruction
Interpretation
#A;DP0
Label; Define current position as zero
PR 4000
Initial position
SP 2000
Set speed
BG
Move A
AM
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
Execute Program #A
Label for loop
Move A motor v1 counts
Start A motion
After A motion is complete
Wait 500 ms
Tell position A
Increase the value of v1
Repeat if v1<10001
End
Execute Program #A
Chapter 2 Getting Started
i
17

Advertisement

Table of Contents
loading

Table of Contents