Operation Variables
The post-processor tracks information on an operation basis. A new operation is defined at each tool change as well as at each OPTYPE command (conditional upon the $OPMERGE variable setting). There is a built-in limit of 999 operations that can be recorded, after which processing will occur as normal but further operation information will not be updated to the operation variables.
$FOI |
First operation index for current tool (0:none) Type: Numeric, Read/Write |
This variable indicates the first operation index value ($OI) for the current tool. It is reset to zero at each tool change, and if zero at the start of a new operation, it is set to the new operation $OI value. This variable is informational only.
$OI |
Current operation index Type: Numeric, Read-only |
This variable can be used as a row number index into the $OPTAB, $OPMIN, $OPMAX and $OPSUM tables. It will be set to 1 if an operation has not yet been defined (i.e., the $OPxxx row number for the dummy operation). Otherwise, it will be set to the $OPxxx row for the current operation. For example, the starting sequence number of the current operation can be obtained by the expression: $OPTAB(8,$OI).
$OPARGS |
OPTYPE command arguments Type: Sequence, Read/Write |
This variable contains the arguments specified on the last OPTYPE command. Within an Operation Event (OE) macro, $OPARGS contains the previous operation arguments and $OE.OPARGS and $P2 contain the arguments of the OPTYPE command that invoked the OE look-ahead.
$OPMAX |
Maximum operation travel table Type: Numeric, Read/Write |
$OPMIN |
Minimum operation travel table Type: Numeric, Read/Write |
These tables contain maximum and minimum axes travel information for each operation. The tables are organized as $OPMAX(column,row) and $OPMIN(column,row), where each row contains information for a specific operation and each column contains the travel for each of the 15 possible machine axes, as follows (only $OPMAX shown):
$OPMAX(1-3,n)
X, Y and Z linear axes
$OPMAX(4-6,n)
U, V and W secondary linear axes
$OPMAX(7-9,n)
A’, B’ and C’ rotary table axes
$OPMAX(10-12,n)
A, B and C rotary head axes
$OPMAX(13,n)
Extending (quill) axis
$OPMAX(14-15,n)
N1 and N2 removable rotary head axes
Row 1 contains travel for the entire program to date. Rows 2 and later contain travel information for specific operations. The number of rows is defined by $OPSIZ. Use the $OI variable as a row index to access travel information for the current operation.
Travel information represents the travel to the current point in the program. A value of $NULL indicates that the axis has not moved or been referenced in a motion block.
The $OPMAX and $OPMIN tables are settable. The PPFUN/23,OP,row command can be used to reset minimum and maximum travel information for an entire row to $NULL.
$OPMERGE |
Operation table organization setting Type: Logical, Read/Write |
This variable controls when new rows are added to the operation tables. A new row is always added at each tool change. By default a new row is also added at the second and subsequent OPTYPE commands encountered between tool changes. Set $OPMERGE to $TRUE to inhibit the creation of new rows when OPTYPE commands are encountered.
$OPNAME |
Current operation name Type: String, Read/Write |
This variable holds the current operation name as defined by an OPNAME command. Setting the $OPNAME variable can indicate the start of a new operation (see $OPMERGE above). The operation name appears in diagnostic messages, the diagnostic summary, and in various components of the GENER user-interface.
$OPSIZ |
Size of operation tables Type: Numeric, Read-only |
This variable indicates the number of operation entries in the $OPxxx tables.
$OPSUM |
Operation summary table Type: Numeric, Read-only |
This table contains timing and feed information for all operations defined in the program. The table is organized as $OPSUM(column,row), where each row contains information for a specific operation and each column contains a specific type of summary information, as follows:
$OPSUM(1,n)
Total feed time (in seconds)
$OPSUM(2,n)
Total positioning time (in seconds)
$OPSUM(3,n)
Total of all other time (in seconds)
$OPSUM(4,n)
Minimum feed rate (in uPM)
$OPSUM(5,n)
Maximum feed rate (in uPM)
$OPSUM(6,n)
Minimum spindle speed (in RPM)
$OPSUM(7,n)
Maximum spindle speed (in RPM)
Row 1 is reserved for the dummy operation (i.e., all processing before the first operation is defined). Other operations appear at rows 2 and later in the order in which they were defined in the program. The number of rows is defined by $OPSIZ. Use the $OI variable as a row index to access summary information for the current operation. The minimum and maximum feed rate values are initialized to 10000 and –1 respectively, and are recorded at the endpoint of each motion. The minimum and maximum spindle speeds are initialized to zero, and are recorded at the endpoint of each motion if the spindle is turning.
$OPTAB |
Operation table Type: Any, Read/Write |
This table contains various information for all operations defined in the program. The table is organized as $OPTAB(column,row), where each row contains information for a specific operation and each column contains a specific type of information, as follows:
$OPTAB(1,n)
$TI tool index
$OPTAB(2,n)
$HI head index
$OPTAB(3,n)
$OPTYPE value
$OPTAB(4,n)
$OPARGS value(s)
$OPTAB(5,n)
$OPNAME string
$OPTAB(6,n)
Start time (in seconds)
$OPTAB(7,n)
End time (in seconds)
$OPTAB(8,n)
Start N block
$OPTAB(9,n)
End N block
$OPTAB(10,n)
Maximum diagnostic severity
$OPTAB(11,n)
Length compensation offsets (sequence)
$OPTAB(12,n)
Diameter compensation offsets (sequence)
$OPTAB(13,n)
Fixture compensation offsets (sequence)
$OPTAB(14-50,n)
Available for use
Row 1 is reserved for the dummy operation (i.e., all processing before the first operation is defined). Other operations appear at rows 2 and later in the order in which they were defined in the program.
$OPMERGE can affect how operations are added. The number of rows is defined by $OPSIZ. Use the $OI variable as a row index to access information for the current operation. There is a built-in limit of 999 operations that can be recorded, including the dummy operation, after which processing will occur as normal but further operation information will not be updated to the $OPMIN, $OPMAX, $OPSUM and $OPTAB tables.
The operation table is constructed as the NC program executes. The table is writable. Columns 14 through 50 are currently not used for any built-in purpose and therefore are available to store information of any type (including SEQUENCE).
$OPTYPE |
OPTYPE command operation type Type: Numeric, Read/Write |
This variable contains the operation type as a numeric value (not a keyword) as determined from the last OPTYPE command. Within an Operation Event (OE) macro, $OPTYPE contains the previous operation type and $OE.OPTYPE and $P1 contain the operation type of the OPTYPE command that invoked the OE look-ahead. $OPTYPE values are:
- –3:
OPTYPE has not been processed yet
- –2:
FINI encountered before feed motion
- –1:
OPTYPE encountered before feed motion
- 1:
TOOL: Tool change encountered before feed motion
- 2:
MILL: Feed motion encountered in milling mode
- 3:
TURN: Feed motion encountered in turning mode
- 4:
AXIAL: CYCLE motion encountered