Rockwell Automation 8520-MUM 9/Series CNC Mill Operation and Programming Manual Documentation Set User Manual

Page 712

Advertising
background image

Paramacros

Chapter 28

28-12

Example 28.10

Nested WHILE DO Commands

N1#1=1;

N2WHILE[#1LT10]DO1;

N3#1=[#1+1];

N4WHILE[#1EQ2]DO2;

N5...;

N6END2;

N7END1;

N8...;

In Example 28.10, blocks N2 through N7 are repeated until the condition
in block N2 becomes false. Within DO loop 1, DO loop 2 will be repeated
until the condition in block N4 becomes false.

The following subsections describe assigning different paramacro
parameter values and how these parameters are used in a paramacro. Use
parameters for paramacros to replace a numeric value. They can be said to
be used as a variable.

There are 5 types of parameters that may be called for use in a paramacro:

local - independent set of variables assigned to each nested macro
common - variables available to all programs
system - variables that indicate specific system condition
PAL - provide variables shared between part and PAL programs
dual process - provide variables shared between processes

The following subsections describe these different types of parameters
independently. This in no way means that they are not interchangeable in
the same macro program. Mixing the different types of parameters in the
same paramacro is acceptable.

Local parameters are #1 - #33. There are 5 sets of local parameters. The
first set is reserved for use in the main program and any subprogram called
by that main program with an M98. The remaining four sets are for each
nested level of macro (4 levels of nesting maximum).

Assigned parameter values are specific to the individual macro nesting
levels. Local parameters are assigned as described on page 28-37.

28.4
Parameter Assignments

28.4.1
Local Parameter
Assignments

Advertising