Operands; Common Operands - Galil Motion Control CDS-3310 User Manual

Table of Contents

Advertisement

The range for numeric variable values is 4 bytes of integer (2
(+/-2,147,483,647.9999).
Numeric values can be assigned to programmable variables using the equal sign.
Any valid CDS-3310 function can be used to assign a value to a variable. For example,
V1=@ABS[v2] or v2=@IN[1]. Arithmetic operations are also permitted.
To assign a string value, the string must be in quotations. String variables can contain up to six
characters which must be in quotation.
Assigning Variable Values to Controller Parameters
Variable values may be assigned to controller parameters such as KD or PR.
Displaying the value of variables at the terminal
Variables may be sent to the screen using the format, 'variable'=. For example, v1= , returns the
value of the variable v1.

Operands

Operands allow motion or status parameters of the CDS-3310 to be incorporated into programmable
variables and expressions. Most CDS-3310 commands have an equivalent operand which is
designated by adding an underscore (_) prior to the CDS-3310 command. The command reference
indicates which commands have an associated operand.
Status commands such as Tell Position return actual values, whereas action commands such as KP or
SP return the values stored in the CDS-3310 registers. The axis designation is required following the
command.
Operands can be used in an expression and assigned to a programmable variable, but they cannot be
assigned a value. For example: _TPA=2 is invalid.

Common Operands

Operand
_BGn
_BN
38 • Chapter 7 Application Programming
Instruction
posA=_TPA
SPEED=5.75
input=@IN[2]
v2=v1+v3*v4
Var="CAT"
PR v1
SP vS*2000
Instruction
posA=_TPA
JP #LOOP,_TEA>5
JP #ERROR,_TC=1
Function
*Returns a 1 if motion on axis 'n' is complete, otherwise returns 0.
*Returns serial # of the board.
31
Interpretation
Assigns returned value from TPA command to variable posA
Assigns value 5.75 to variable SPEED
Assigns logical value of input 2 to variable input
Assigns the value of v1 plus v3 times v4 to the variable v2.
Assign the string, CAT, to Var
Assign v1 to PR command
Assign vS*2000 to SP command
Interpretation
Assigns value from Tell Position A to the variable posA.
Jump to #LOOP if the position error of A is greater than 5
Jump to #ERROR if the error code equals 1.
)followed by two bytes of fraction
CDS-3310

Advertisement

Table of Contents
loading

Table of Contents