Chapter 7
145
UM10372_PCNC440_Manual_0221A
PROgRAMMiNg
7.7.2.2 Subroutine Parameters
Subroune parameters are specically reserved for call arguments. By denion, these are
parameters #1-#30 and are local to the subroune.
7.7.2.3 Named Parameters
Named parameters work like numbered parameters but are easier to read and remember. All
parameter names are converted to lowercase and have spaces and tabs removed. Named parameters
must be enclosed with < > marks.
#<named parameter here> is a local named parameter. By default, a named parameter is local to
the scope in which it is assigned.
You can’t access a local parameter outside of its subroune. This is so two subrounes can use the
same parameter names without fear of one subroune overwring the values in another.
#<_global named parameter here> (i.e., name starng with an underscore) is a global named
parameter. They are accessible from within called subrounes and may set values within subrounes
that are accessible to the caller. As far as scope is concerned, they act just like regular numeric
parameters. They are not made persistent by storage in a le.
Examples:
Declaration of named global variable
#<_endmill_dia> = 0.049
Reference to previously declared global variable
#<_endmill_rad> = [#<_endmill_dia>/2.0]
NOTE: The global parameters _a, _b, _c, . . . _z are reserved for special use. Do not use these parameters.
Mixed Literal and Named Parameters
o100 call [0.0] [0.0] [#<_inside_cutout>-#<_endmill_dia>] [#<_Zcut>] [#<_
feedrate>]
7.7.3 Expressions
An expression is a set of characters starng with a le bracket ([) and ending with a balancing
right bracket (]). Located between the brackets are numbers, parameter values, binary operators,
funcons, and other expressions. An expression is evaluated to produce a number. An example of
an expression is:
[1 + acos[0] - [#3 ** [4.0/2]]]
All expressions on a line are evaluated when the line is read and before anything on the line is executed.
7.7.3.1 Binary Operators
Binary operators only appear inside expressions. There are three types of binary operators:
mathemacal, logical, and relaonal.