100
•
Chapter 7 Application Programming
DMC-1500
To illustrate further, if the user types in the string “TESTME” at the input prompt, the controller will
respond with the following:
T
Response from command MG LEN6 {S1}
E
Response from command MG LEN5 {S1}
S
Response from command MG LEN4 {S1}
T
Response from command MG LEN3 {S1}
M
Response from command MG LEN2 {S1}
E
Response from command MG LEN1 {S1}
Functions
FUNCTION DESCRIPTION
@SIN[n]
Sine of n (n in degrees with range of -32768 to 32767 and 16-bit fractional resolution)
@COS[n]
Cosine of n (n in degrees with range of -32768 to 32767 and 16-bit fractional resolution)
@COM[n]
1’s Complement of n
@ABS[n]
Absolute value of n
@FRAC[n]
Fraction portion of n
@INT[n]
Integer portion of n
@RND[n]
Round of n (Rounds up if the fractional part of n is .5 or greater)
@SQR[n]
Square root of n (Accuracy is +/-.004)
@IN[n]
Return status of digital input n
@OUT[n]
Return status of digital output n
@AN[n]
Return voltage measured at analog input 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.
Examples - Using Functions
V1=@ABS[V7]
The variable, V1, is equal to the absolute value of variable V7.
V2=5*@SIN[POS]
The variable, V2, is equal to five times the sine of the variable, POS.
V3=@IN[1]
The variable, V3, is equal to the digital value of input 1.
V4=2*(5+@AN[5])
The variable, V4, equals the value of analog input 5 plus 5, then multiplied by 2.
Variables
The maximum number of variables available with a DMC-1500 is 254. 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-1500 instructions. For example, PR is not
a good choice for a variable name.
Содержание 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...