27
special parts processing program and reduce complex numerical calculation of the manual programming to
simplify the user program.
12.1 Macro Variable
12.1.1 Variable Represent
Variables with the symbol "#" and number to specify;
Format
:#
I(I=1
,
2
,
3
,
…) or
#【<
formula
>】
;
Example
:#
5
,#
109
,#
501
,#【#
1
+#
2
-
12
】
.
The formula can be used to specify a variable number. Therefore, the formula must be in brackets.
12.1.2 Type of Variable
Table7-1 Type of Macro Variables
Number of
variable
Type of variable
function
#0
null variables
This variable is always empty and no value can be
assigned to the variable.
#1-#33
local variables
Local variables can only be used in a macro program to
store data, for example, operation result. When the power
outage, Local variables are initialized to null. When Call
the macro program, the independent variable is
assignment to a local variable
#100-#199
#500-#999
common variables
Public variables have the same meaning in different
macro program. When power outages, variable # 100 - #
199 is initialized to null, the number of variable # 500 - #
999 is saved and it is not lost even if the power outages.
#1000
system variables
System variables are often used to reading and writing
data of CNC, such as the current position of tool and
compensation value.
12.1.3 Use of Variable
1. Specify variable Number or formula behind the address words
Instruction format:
< address words>#I
< address words>-#I
< address words>
【<
formula
>】
Example:
F#103,if #103=15 ,then F15
Z-#110,if #110=250,then Z-250
X[#24+#18*COS[#1]]
2. Variable number can be available instead with variables
Example: #[#30],if#30=3, then #3.
3. #0 is null Variable and variables that do not define a variable's value is also empty.
4. Defining value for variable
Program definition can be omitted the decimal point, example: # 123 = 149