3 modal paramacro call (g66.1), Example 20.19 illustrates modal macro operation – Rockwell Automation 8520-GUM 9/Series CNC Grinder Operation and Programming Manual Documentation Set User Manual

Page 696

Advertising
background image

Paramacros

Chapter 20

20-52

Example 20.19 illustrates modal macro operation.

Example 20.19

Modal Macro Operation

(MAIN);

O1000;
NO10G90;
N020G66P1001L2A1.1;
N030X1;

N040Z.25

N050G66P1002A2;
N060X1.;

N070G67;
N090G67;
N100M30;

Parameter #1 is set at 1.1 in macro 1001.
X Axis is moved 1 unit and then macro 1001 is called and
executed 2 times.
Z Axis is moved .25 units and then macro 1001 is called and
executed 2 times.
Parameter #1 is set at 2. in macro 1002

.

X axis is moved 1 unit then macro 1002 is called and
executed once.
Macro 1002 is canceled.
Macro 1001 is canceled.

(MACRO);

O1001;
N200Z#1;

N210#1=1.7
N220M99;

Z Axis moves an amount equal to the current value for
parameter #1
Parameter #1 for macro 1001 is set at 1.7.
Macro end.

(MACRO);

O1002;
N300Z#1;

N310M99;

Z Axis moves an amount equal to the current value set
parameter #1 (in this case always 2 units). Macro 1001 is
called and executed twice.
Macro end.

Important: When the control executes block N040, the original value as
set in block N020 for parameter number 1 is ignored, and the most current
value (1.7) is used. The first time macro 1001 is executed, Z moves 1.1
units. The second time macro 1001 is executed, Z moves 1.7 units.

Use this format when calling a paramacro using the G66.1 command:

G66.1 P_ L_ A_ B_;

Where:

Determines:

P

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

L

the number of times the macro is executed. L ranges from 1 - 9999, and can 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. Arguments may be specified as any valid parametric expression.

20.6.3
Modal Paramacro Call
(G66.1)

Advertising