![Galil DMC-4040 User Manual Download Page 161](http://html1.mh-extra.com/html/galil/dmc-4040/dmc-4040_user-manual_3282915161.webp)
Example:
posx=5000
Assigns the value of 5000 to the variable posx
PR posx
Assigns variable posx to PR command
JG rpmY*70
Assigns variable rpmY multiplied by 70 to JG command.
Programmable Variables
The DMC-40x0 allows the user to create up to 510 variables. 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-40x0 instructions. For
example, PR is not a good choice for a variable name.
Note: It is generally a good idea to use lower-case variable names so there is no confusion between Galil
commands and variable names.
Examples of valid and invalid variable names are:
Valid Variable Names
posx
pos1
speedZ
Invalid Variable Names
RealLongName
;
‘
Cannot have more than 8 characters
123
;
‘
Cannot begin variable name with a number
speed Z
;
‘
Cannot have spaces in the name
Assigning Values to Variables:
Assigned values can be numbers, internal variables and keywords, functions, controller parameters and strings. The
range for numeric variable values is 4 bytes of integer (231) followed by two bytes of fraction (+/-
2,147,483,647.9999).
Numeric values can be assigned to programmable variables using the equal sign.
Any valid DMC-40x0 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.
Examples:
posX=_TPX
Assigns returned value from TPX command to variable posx.
speed=5.75
Assigns value 5.75 to variable speed
input=@IN[2]
Assigns logical value of input 2 to variable input
v2=v1+v3*v4
Assigns the value of v1 plus v3 times v4 to the variable v2.
var=”CAT”
Assign the string, CAT, to var
MG var{S3}
Displays the variable var – (CAT)
Assigning Variable Values to Controller Parameters
Variable values may be assigned to controller parameters such as GN or PR.
PR v1
Assign v1 to PR command
SP vS*2000
Assign vS*2000 to SP command
DMC-40x0 User Manual
Chapter 7 Application Programming
•
152
Summary of Contents for DMC-4040
Page 54: ...Chapter 3 Connecting Hardware 45 DMC 40x0 User Manual...
Page 55: ...DMC 40x0 User Manual Chapter 3 Connecting Hardware 46...
Page 56: ...Chapter 3 Connecting Hardware 47 DMC 40x0 User Manual...
Page 73: ...Figure 4 1 GalilTools DMC 40x0 User Manual Chapter 4 Software Tools and Communication 64...
Page 185: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 7 Application Programming 176...
Page 205: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 10 Theory of Operation 196...
Page 222: ...Step 2 Remove ICM s Appendices 213 DMC 40x0 User Manual...
Page 232: ...DMC 4080 Steps 4 and 5 Step 4 Replace ICM s Appendices 223 DMC 40x0 User Manual...