Functions; Variables - Galil Motion Control DMC-1000 User Manual

Table of Contents

Advertisement

To illustrate further, if the user types in the string "TESTME" at the input prompt, the controller will
respond with the following:
T
E
S
T
M
E
FUNCTION
@SIN[n]
@COS[n]
@COM[n]
@ABS[n]
@FRAC[n]
@INT[n]
@RND[n]
@SQR[n]
@IN[n]
@OUT[n]
@AN[n]
Functions may be combined with mathematical expressions. The order of execution of mathematical
expressions is from left to right and can be over-ridden by using parentheses.
V1=@ABS[V7]
V2=5*@SIN[POS]
V3=@IN[1]
V4=2*(5+@AN[5])

Variables

The maximum number of variables available with a DMC-1000 controller depends on the controller
configuration: 126 variables are available for 1-4 axes controllers, 510 variables with 1-4 axes and the
-MX option, and 254 variables with controllers of 5 or mor axes. These variables can be numbers or
strings. Variables are useful in applications where specific parameters, such as position or speed, must
be able to change. Variables can be assigned by an operator or determined by program calculations.
For example, a cut-to-length application may require that a cut length be variable.
Each variable is defined by a name which can be up to eight characters. The name must start with an
alphabetic character, however, numbers are permitted in the rest of the name. Spaces are not
permitted. Variable names should not be the same as DMC-1000 instructions. For example, PR is not
a good choice for a variable name.
102 • Chapter 7 Application Programming
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Response from command MG LEN6 {S1}
Response from command MG LEN5 {S1}
Response from command MG LEN4 {S1}
Response from command MG LEN3 {S1}
Response from command MG LEN2 {S1}
Response from command MG LEN1 {S1}

Functions

DESCRIPTION
Sine of n (n in degrees with range of -32768 to 32767 and 16-bit fractional resolution)
Cosine of n (n in degrees with range of -32768 to 32767 and 16-bit fractional resolution)
1's Compliment of n
Absolute value of n
Fraction portion of n
Integer portion of n
Round of n (Rounds up if the fractional part of n is .5 or greater)
Square root of n (Accuracy is +/-.004)
Return status of digital input n
Return status of digital output n
Return voltage measured at analog input n
Examples - Using Functions
The variable, V1, is equal to the absolute value of variable V7.
The variable, V2, is equal to five times the sine of the variable, POS.
The variable, V3, is equal to the digital value of input 1.
The variable, V4, is equal to the value of analog input 5 plus 5, then multiplied by 2.
DMC-1000

Advertisement

Table of Contents
loading

Table of Contents