DMC-1500
Chapter 7 Application Programming
•
101
Examples - Valid Variable Names
POSX
POS1
SPEEDZ
Examples - Invalid Variable Names
Variable Problem
REALLONGNAME
Cannot have more than 8 characters
124
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;
Variables hold 6 bytes of data, 4 bytes of integer (2
31
)followed by two bytes of fraction providing a
range of values of +/-2,147,483,647.9999.
Numeric values can be assigned to programmable variables using the equal sign.
Any valid DMC-1500 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.
Examples - Assigning values to variables
Instruction Interpretation
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
PR V1
Assign value of variable V1 to PR command for X axis
SP VS*2000
Assign VS*2000 to SP command
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.
Содержание DMC-1510
Страница 6: ......
Страница 18: ...6 Chapter 1 Overview DMC 1500 THIS PAGE LEFT BLANK INTENTIONALLY...
Страница 88: ...76 Chapter 6 Programming Motion DMC 1500 Figure 6 7 Motion intervals in the Home sequence...
Страница 90: ...78 Chapter 6 Programming Motion DMC 1500 THIS PAGE LEFT BLANK INTENTIONALLY...
Страница 137: ...DMC 1500 Chapter 7 Application Programming 125 THIS PAGE LEFT BLANK INTENTIONALLY...
Страница 157: ...DMC 1500 Chapter 10 Theory of Operation 145 THIS PAGE LEFT BLANK INTENTIONALLY...
Страница 160: ...148 Appendices DMC 1500 Card Level Layout...
Страница 178: ...166 Appendices DMC 1500 ICM 1100 Drawing 1 3 4 0 0 4 4 0 2 4 0 7 0 0 4 5 3 7 0 5 7 0 2 8 5 1 0 0 1 0 1 0 7 0 1 0 0...
Страница 180: ...168 Appendices DMC 1500...
Страница 198: ...186 Appendices DMC 1500 THIS PAGE LEFT BLANK INTENTIONALLY...