Operands - Galil Motion Control DMC-1000 User Manual

Table of Contents

Advertisement

The example below reads the voltage of an X-Y joystick and assigns it to variables VX and VY to
drive the motors at proportional velocities, where
10 Volts = 3000 rpm = 200000 c/sec
Speed/Analog input = 200000/10 = 20000
Instruction
#JOYSTIK
JG 0,0
BGXY
#LOOP
VX=@AN[1]*20000
VY=@AN[2]*20000
JG VX,VY
JP#LOOP
EN

Operands

Operands allow motion or status parameters of the DMC-1000 to be incorporated into programmable
variables and expressions. An operand contains data and must be used in a valid expression or
function. Most DMC-1000 commands have an equivalent operand - which are designated by adding
an underscore (_) prior to the DMC-1000 command. Commands which have an associated operand
are listed in the Command Reference as "Used as an Operand" .. Yes.
Status commands such as Tell Position return actual values, whereas action commands such as GN or
SP return the values in the DMC-1000 registers. The axis designation is required following the
command.
POSX=_TPX
GAIN=_GNZ*2
JP #LOOP,_TEX>5
JP #ERROR,_TC=1
Operands can be used in an expression and assigned to a programmable variable, but they cannot be
assigned a value. For example: _GNX=2 is invalid.
The value of an operand can be output to the computer with the message command, MG. IE. MG
_TEX sends the current position error value on axis X to the computer.
104 • Chapter 7 Application Programming
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Example - Using Variables for Joystick
Interpretation
Label
Set in Jog mode
Begin Motion
Loop
Read joystick X
Read joystick Y
Jog at variable VX,VY
Repeat
End
Examples of operand usage
Assigns value from Tell Position X to the variable POSX.
Assigns value from GNZ multiplied by two to variable, GAIN.
Jump to #LOOP if the position error of X is greater than 5
Jump to #ERROR if the error code equals 1.
DMC-1000

Advertisement

Table of Contents
loading

Table of Contents