2 modal paramacro call (g66) – Rockwell Automation 8520 9/Series CNC Lathe User Manual

Page 718

Advertising
background image

Paramacros

Chapter 28

28-44

Use this format for calling a paramacro using the G66 command:

G66 P_ L_ A_ B_;

Where :

Is :

P

Indicates the program number of the called macro. P ranges from 1 - 99999.

L

Programs the number of times the macro will be executed after each motion block

that follows the G66. L ranges from 1 - 9999, and may be expressed as any valid

parametric expression. If not specified, the control uses a default value of 1.

A-Z

Optional argument statements. May be programmed using any letter from A to Z

excluding G, L, N, O, or P. Used to assign numeric values to parameters in the

paramacro (see NO TAG). Arguments may be specified as any valid parametric

expression.

The G66 command is modal and remains in effect until canceled with a

G67 block. The macro programmed by the P--word in the G66 block is not

executed when the G66 block is read. The control delays macro execution

to any block following the G66 command that contains a motion

command.

When the control encounters a motion block (even if this block is

contained in a different macro) following the G66 block, it executes the

motions called for by that block first. After that block has been executed,

the control then calls the macro specified by the G66 block.

The control executes this macro until the control reaches an M99 macro

return code. The macro then returns to the next unexecuted sequential

block in the calling program unless the macro has not been repeated the

number of times as determined by the L--word. If this is the case, the

macro re-executes.

Each time that a specific macro is called by a motion command, it is

executed the number of times programmed with the L--word. All local

variables remain at their current value throughout the program unless

replaced, the control is reset, E-Stop is reset, or the control encounters an

M02 or an M30 code in a program.

An L--word programmed with a G66 macro call cannot be replaced without

reprogramming the entire G66 block with the new L--word. An L--word is

active each time the macro is called by the main program and causes the

macro to be executed the number of times programmed with L.

You can define the L--word or any optional argument statements in a G66

block by using any valid parametric expression. For example:

G66 P1002 L[#1+1] A[12*6] B[SIN[#101]];

28.5.2

Modal Paramacro Call (G66)

Advertising