28
12.2 Call the Macro Program
12.2.1 Simple Call G65
Instruction format:
G65 P_ _L< Independent Variable>_;
The macro program is specified by Address P, the independent variables (data) are passed to the user macro
program.
P - The called macro program
L - The called number (if omit, the default is 1 which can be specified from 1 to 9999 repetitions)
< Variables > - the data that be transmitted to the macro program and its value is assigned to the
corresponding local variables.
12.2.2 Modal Call G66
Instruction format:
G66 P_ _L< Independent Variable>_;
P - The called macro program
L - The called number (if omit, the default is 1 which can be specified from 1 to 9999 repetitions)
< Independent Variable>---The data was transmitted to the macro program, and the value is assigned to the
corresponding local variables.
Nested invocation: G66 calls can have 4 class nested.
12.2.3 Cancel the Modal Call G67
Instruction format:
G67; cancel G66; Modal macro program calls;
Example:
O2005
(
O2005
)
;
G00 X100 Z50;
G66 P020100 A2 B20 C20 I30 J20 K20;
Executing the program segment will call P020100 number 2
times
G01 X80 Z50;
After this period of the implementation, and called again P0100 program 2
times
(
And update the local variable with Independent Variable
)
G67
;
G66 cancel the modal call
G01 X20 Z50
;
After this period of the implementation, it does no longer call P020100 program.
12.2.4 Arithmetic and Logic Operations
Operation can be performed in a variable shown in Fig. 12-2. The operator of the right of expression may
contain constants or functions. Expression variables # i, # j and #k instead.
Table 12-2 arithmetic and logic operations
Function
Format
Remark
Assignment
#i = #j
Addition
#i=#j + #k
Subtraction
#i=#j - #k
Multiplicatio
n
#i=#j * #k