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

Page 686

Advertising
background image

Paramacros

Chapter 20

20-42

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 can also take on the
form of:

#parameter expression = parameter expression

Example 20.14

Legal Parameter Numbers

#6=1;

#144=1;

#[14/2]=1;

#[#6]=1;

In Example 20.14, all of the parameter numbers are legal. Any time you
use a different parameter between the [] symbols, the current value of that
parameter is evaluated. 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.

Example 20.15 illustrates the assignment of values to the parameters.

Example 20.15

Assigning Values to Parameters

#100=1+1;

#100=5-3;

#100=#3;

#100=#7+1;

#100=#100+1;

You can also assign multiple paramacro parameters in a single block. In a
multiple assignment block, each assignment is separated by a comma. For
example:

#1=10,#100=ROUND[#2+#3],#500=10.0*5;

Advertising