Assigning Values To Variables - Galil Motion Control DMC-1000 User Manual

Table of Contents

Advertisement

POSX
POS1
SPEEDZ
Variable
REALLONGNAME
124
SPEED Z
Assigned values can be numbers, internal variables and keywords, functions, controller parameters and
strings;
Variables hold 6 bytes of data, 4 bytes of integer (2
range of values of +/-2,147,483,647.9999.
Numeric values can be assigned to programmable variables using the equal sign.
Any valid DMC-1000 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 quotations.
Variable values may be assigned to controller parameters such as PR or SP.
Instruction
POSX=_TPX
SPEED=5.75
INPUT=@IN[2]
V2=V1+V3*V4
VAR="CAT"
PR V1
SP VS*2000
Variables may be sent to the screen using the format, variable=. For example, V1= , returns the value
of the variable V1.
DMC-1000
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Examples - Valid Variable Names
Examples - Invalid Variable Names
Problem
Cannot have more than 8 characters
Cannot begin variable name with a number
Cannot have spaces in the name

Assigning Values to Variables:

Examples - Assigning values to variables
Interpretation
Assigns returned value from TPX command to variable POSX.
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 value of variable V1 to PR command for X axis
Assign VS*2000 to SP command
Displaying the value of variables at the terminal
31
)followed by two bytes of fraction providing a
Chapter 7 Application Programming • 103

Advertisement

Table of Contents
loading

Table of Contents