NUMBERED PARAMETERS REFERENCE

NUMBERED PARAMETERS REFERENCE

A numbered parameter is recognized by the pound symbol (#) followed by an integer between 1 and 5399. The parameter is referred to by this integer, and its value is whatever number is stored in the parameter. A value is stored in a parameter with the (=) operator.

Example: #3 = 15 (set parameter 3 to 15)

A parameter setting does not take effect until after all parameter values on the same line have been found. For example, if parameter 3 has been previously set to 15 and the line: #3=6 G01 X#3 is interpreted, a straight move to a point where X = 15 occurs before the value of parameter 3 is set to 6.

The # symbol takes precedence over other operations. For example, #1+2 means the number found by adding 2 to the value of parameter 1, not the value found in parameter 3. Of course, #[1+2] does mean the value found in parameter 3.

The # character may be repeated; for example ##2 means the value of parameter whose index is the (integer) value of parameter 2. PathPilot maintains a number of read-only parameters. Only parameters for the relevant axes are maintained: (X Y Z A) for mill and (X Z) for mill. The remaining parameters for unused axes are undefined.

READ-ONLY PARAMETERS

  • 1-30: Subroutine local parameters of call arguments. These parameters are local to the subroutine. For further information, see Programming with Subroutines later in this chapter
  • 31-5000: G-code operator parameters. These parameters are global in G-code file
  • 5061-5070: Result of G38.2 probe (X Y Z A B C U V W)
  • 5161-5169: G28 home for (X Y Z A B C U V W)
  • 5181-5189: G30 home for (X Y Z A B C U V W)
  • 5210: 1 if G92 offsets are active, 0 if not
  • 5211-5219: G92 offset (X Y Z A B C U V W)
  • 5220: Current coordinate system number 1-9 for G54 – G59.3
  • 5221-5230: Coordinate System 1, G54 (X Y Z A B C U V W R) – R denotes XY rotation angle around Z-axis
  • 5241-5250: Coordinate System 2, G55 (X Y Z A B C U V W R)
  • 5261-5270: Coordinate System 3, G56 (X Y Z A B C U V W R)
  • 5281-5290: Coordinate System 4, G57 (X Y Z A B C U V W R)
  • 5301-5310: Coordinate System 5, G58 (X Y Z A B C U V W R)
  • 5321-5330: Coordinate System 6, G59 (X Y Z A B C U V W R)
  • 5341-5350: Coordinate System 7, G59.1 (X Y Z A B C U V W R)
  • 5361-5370: Coordinate System 8, G59.2 (X Y Z A B C U V W R)
  • 5381-5390: Coordinate System 9, G59.3 (X Y Z A B C U V W R)
  • 5399: Result of M66 – check or wait for input
  • 5400: Current tool number
  • 5401-5409: Tool offset (X Y Z A B C U V W)
  • 5410: Current tool diameter
  • 5411: Current tool front angle
  • 5412: Current tool back angle
  • 5413: Current tool orientation
  • 5420-5428: Current position including offsets in current program units (X Y Z A B C U V W)

PARAMETERS REFERENCE

PARAMETERS REFERENCE

The RS274/NGC language supports parameters. Parameters are analogous to variables in other programming languages. PathPilot maintains an array of 10,320 numerical parameters. Many of them have specific uses. The parameters that are associated with fixtures are persistent over time. Other parameters are undefined when the operating system is loaded. The parameters are preserved when the interpreter is reset. Parameters 1 to 1000 can be used by the code of part-programs.

There are several types of parameters of different purpose and appearance. The only value type supported by parameters is floating-point; there are no string, Boolean or integer types in G-code like in other programming languages. However, logic expressions can be formulated with Boolean operators (AND, OR, XOR, and the comparison operators EQ, NE, GT, GE ,LT, LE), and the MOD, ROUND, FUP and FIX operators support integer arithmetic.

PARAMETER SYNTAX

There are three types of parameters, numbered, named local, and named global. The type of the parameter is defined by its syntax:

  • Numbered – #4711
  • Named local – #
  • Named global – #<_globalvalue>

PARAMETER SCOPE

The scope of a parameter is either global or local within a subroutine. The scope of each parameter is inferred from its syntax. Subroutine parameters and named local parameters have local scope. Named global parameters and all numbered parameters starting from #31 are global in scope. RS274/NGC uses lexical scoping. In a subroutine, only the local parameters defined therein and any global parameters are visible. The local parameters of a calling procedure are not visible in a called procedure.

BEHAVIOR OF UNINITIALIZED PARAMETERS

Uninitialized global parameters and unused subroutine parameters return the value zero when used in an expression. Uninitialized named parameters signal an error when used in an expression.

PARAMETER MODE

The mode of a parameter can either be read/write or read-only. Read/write parameters may be assigned values within an assignment statement. Read-only parameters cannot be assigned values. They may appear in expressions, but not on the left-hand side of an assignment statement.

PERSISTENCE AND VOLATILITY

Parameters can either be persistent or volatile. When the operating system is powered off, volatile parameters lose their values and are reset to zero. The values of persistent parameters are saved in a disc file and restored to their previous values when the operating system is powered on again. All parameters except numbered parameters in the current persistent range (5163 to 5390) are volatile.

INTENDED USAGE

Numbered parameters in the range #31-#5000, named global, and local parameters are available for general-purpose storage of floating-point values, like intermediate results, flags, etc., throughout program execution. They are read/write (can be assigned a value). Subroutine parameters, numbered parameters #1-#30, and system parameters are read-only and not available for general use. Subroutine parameters are used to hold the actual parameters passed to a subroutine. Numbered parameters in the range of #1-#30 are used to access offsets of coordinate systems. System parameters are used to determine the current running version and are read-only.

ADVANCED PROGRAMMING

ADVANCED PROGRAMMING

Parameter and expression programming language features are not used in common G-code application (hand coding), G-code created by PathPilot conversational programming, or the majority of third-party CAM-programming systems.

There are significant differences between controls in the way parameters work. Do not assume that code from another control works in the same way with the operating system. We don’t recommend writing parametric G-code — i’ts difficult to debug, and difficult for another operator to understand. Modern CAM virtually eliminates the need for it.

Read the following sections for reference: