Direct assignment through programming – Rockwell Automation 8520-MUM 9/Series CNC Mill Operation and Programming Manual Documentation Set User Manual

Page 739

Advertising
background image

Paramacros

Chapter 28

28-39

To enter a value for a parameter # using an argument, enter the word
corresponding to the desired parameter number in a block that calls a
paramacro (for legal argument locations, see specific formats for calling
the macro) followed by the value to assign that parameter. For example:

G65P1001A1.1 B19;

assigns the value of:

1.1 to local parameter #1 in paramacro 1001

19 to local parameter #2 in paramacro 1001

You can specify arguments as any valid parametric expression. For
example:

G246A#100B[#500+10.0]C[SIN[#101]];

Direct Assignment Through Programming

This assignment method applies to Local, Common, System, and PAL
parameters. You can perform direct assignment in Main, Macro, or MDI
programs. Direct assignment is done by setting the parameter equal to
some value in an equation using the “ = ” operator. For example, to assign
a value of 2 to parameter number 100, simply enter the following program
block:

#100=2;

The value to the left of the equals sign must contain the # sign followed by
a legal parameter number. This parameter number may also take on the
form of:

#parameter expression = parameter expression

Example 28.14

Calling Parameter Numbers

#6=1;

#144=1;

#[SIN[#6]]=1;

#[148/2]=1;

#[#6]=1;

All of the above can be used as legal parameter numbers. Any time that a
different parameter is used between the [] symbols, the current value of
that parameter is used for evaluation. For example:

#1=4;

#1=#1+2;

The net result of the above two blocks would be the assignment of a value
of 6 to parameter #1.

Advertising