beautypg.com

Rockwell Automation 8520 9/Series CNC Lathe User Manual

Page 721

background image

Paramacros

Chapter 28

28-47

The L--word or any optional argument statements following a G66.1 can

contain any valid mathematical expression. For example:

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

Example 28.20

G66.1 Macro Operation

N0100G90G17G00;
N0110G66.1P9400;

Macro 9400 is executed.

N0120G91G18G01;

G91 and G18 become effective, 01 is assigned to parameter

#10, macro 9400 is executed.

N0130G03X1.;

03 is assigned to parameter #10, 1. is assigned to parameter

#24, macro 9400 is executed.

N0135;

Macro 9400 is executed.

N0140G67;

Macro 9400 is deactivated.

N0150M30;

program end.

Any time the macro is called (while executing the G66.1), the L--word

programming the number of repetitions is in effect. Any attempt to

reprogram an L--word outside of a G66.1 block is interpreted as an

argument assignment for parameter #12.

Important: When nesting a macro (any macro including G66.1) within a

G66.1 macro, the outer G66.1 macro is executed after each individual

block of the nested macro, except for paramacro command blocks such as

assignment, goto, etc.

Example 28.21

Nesting a Modal Macro

N0100G66.1P1001;

N0200G65P1002;

After the execution of each individual block within the macro 1002, the

macro 1001 is called.
You can define the L--word or any optional argument statements in a G66.1

block as any valid parametric expression. For example:

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