13. Program Support Functions
13.5 User macro specifications
13.5.1 User macro commands ; G65, G66, G66.1, G67
Function and purpose
By combining the user macros with variable commands, it is possible to use macro program call,
arithmetic operation, data input/output with PLC, control, decision, branch and many other
instructions for measurement and other such applications.
O Main program
Macro programs use variables, arithmetic instructions and control instructions to create
subprograms which function to provide special-purpose control.
These special-purpose control functions (macro programs) are called by the macro call
instructions exactly when required from the main program.
The following G codes are available for the macro call commands.
G code
G65
G66
G66.1
G67
Detailed description
(1) When the G66 (or 66.1) command is entered, the specified user macro subprogram will be
called after each block has been executed (or after the movement command in the block) with
the movement commands has been executed until the G67 (cancel) command is entered.
(2) The G66 (or G66.1) and G67 commands must be paired in the same program.
....... ;
Macro call instruction
M30 ;
User macro Simple call
User macro Modal call A (called after the movement command)
User macro Modal call B (called after the every block)
User macro Modal call cancel
13.5 User macro specifications
Function
180
O Macro program
....... ;
M99 ;