UD70
Issue code: 70nu2
4-18
DPL programming
#INT instruction
The #INT
instruction converts a parameter that requires floating-point
variables to accept integer variables. This greatly increases processing
speed.
Example
#4.08 = 14.5
// set #4.08 at 14.5 on Unidrive
//is the same as
#INT2.00 = 145
// Reading is also possible:
value% = #INT4.08
4.9 Parameter
pointers
A parameter pointer is an integer variable that represents a Drive parameter.
Example
A% = 121 // set A% to point to #1.21
#A% = 10//write 10 to the pr A% points to (#1.21)
Note
If the parameter contains a decimal-point, the decimal
point is ignored. (For example, parameter #4.08 in the
Unidrive is in units of 0.1. A value of 2.3 must be
written as 23.)
4.10
Defining aliases (constants)
Sometimes it is useful to assign a meaningful name to a parameter or a value.
For example:
Parameter #1.21 could be referred to as
SPEED
_
REFERENCE
Instructions can be written in the form:
SPEED
_
REFERENCE = MAX
_
SPEED
Aliases are created using the
$DEFINE
directive. The syntax is:
$DEFINE
$DEFINE name value
name value.
The
$DEFINE
directive can be used to assign the required value to a name
that is used subsequently in the program; the name becomes an alias for the
value. All occurrences of the name are replaced by the value when the
program is compiled.
Note
Comments are not allowed at the end of a
$DEFINE
line.
Summary of Contents for UD70
Page 6: ......
Page 14: ...UD70 Issue code 70nu2 2 6 Installation...
Page 42: ...UD70 Issue code 70nu2 4 20 DPL programming...
Page 98: ...UD70 Issue code 70nu2 7 22 Reference...