AZPost Configuration Guide
AZPost Configuration Guide
Configuration Guide
NCData Services
www.NCDataServices.com
(928) 532-8045
1
Revised 30-MAR-2011
2
Introduction ...............................................................................................................6
The Challenge.................................................................................................................. 6
The Goal .......................................................................................................................... 8
The AZpost Concept........................................................................................................ 9
Prior to manufacturing process ................................................................................ 10
During manufacturing process.................................................................................. 10
Ready for machining ................................................................................................. 11
The Environment ......................................................................................................12
Installation .................................................................................................................... 12
File & Folder Structure.................................................................................................. 12
AZpost File Structure..................................................................................................... 13
APT File Structure.......................................................................................................... 14
The APTsource CLFile .................................................................................................... 15
The Machine Code ........................................................................................................ 17
The Configuration File...............................................................................................19
General Concepts.......................................................................................................... 19
SECTION ONE – Default Limits and Modes................................................................... 20
Predefined postprocessor statements ..................................................................... 21
SECTION TWO – Register Definitions and Values ......................................................... 28
G Register features: .................................................................................................. 31
M Register features: ................................................................................................. 31
SECTION THREE – Program MACRO Sequences ........................................................... 32
Postprocessor Key Words ......................................................................................... 33
SEQN Numeric value of sequence number for next (current) block ............. 33
CURTL Numeric value of the current tool .................................................... 33
NEXTL Numeric value of the next tool ......................................................... 33
GAGEZ Numeric value of the tool gauge length (set length)........................ 33
PIVOTZ Numeric value of the tool gauge point to tool pivot point or .......... 33
distance from machine table to A-axis center-line............................................... 33
CLEARP Numeric value of Z-axis at clearance from part zero ....................... 33
CURX Numeric value of the X-axis current position (GOTO) ......................... 33
CURY Numeric value of the Y-axis current position (GOTO) ......................... 33
CURZ Numeric value of the Z-axis current position (GOTO) ......................... 33
CURA Numeric value of the A-axis current position (GOTO)......................... 33
CURB Numeric value of the B-axis current position (GOTO) ......................... 33
CURC Numeric value of the C-axis current position (GOTO) ......................... 33
HOMEZ Numeric value of Z-axis at its home position (FROM) ...................... 33
HOMEX Numeric value of X-axis at its home position (FROM)...................... 33
HOMEY Numeric value of Y-axis at its home position (FROM)...................... 33
HOMEZ Numeric value of Z-axis at its home position (FROM) ...................... 33
FEED Numeric value of current feed rate (upm or upr)................................ 33
RPM Numeric value of current spindle speed in RPM ................................. 34
FIXTUR Numeric value of current fixture code ............................................. 34
3
COOLNT Numeric value of current coolant code............................................ 34
SEQNO/ON Used in macro to turn sequence numbers ON............................ 35
SEQNO/OFF Used in macro to turn sequence numbers OFF ......................... 35
OPSKIP/ON Used in macro to turn opskip (block delete) ON......................... 35
OPSKIP/OFF Used in macro to turn opskip (block delete) OFF............................. 35
TPRINT Text value of current tool description (from TPRINT) ...................... 35
If used followed by a > character it will be applied .............................................. 35
to the next block as a machine code comment.................................................... 35
PROGID Text value (numeric) of program ID (from PARTNO)........................ 35
PARTNO Text value of program description (from PARTNO).......................... 35
Inserting “text” in the output ................................................................................... 35
Conditional output of blocks..................................................................................... 36
Predefined Macros.................................................................................................... 37
MACRO/ START .................................................................................................... 37
MACRO/ FROM..................................................................................................... 38
MACRO/ FROM4................................................................................................... 38
MACRO/ TLCHG1 .................................................................................................. 40
MACRO/ TLCHG .................................................................................................... 41
MACRO/ GOHOME ............................................................................................... 42
MACRO/ RESTAR .................................................................................................. 43
MACRO/ RESTAR4 ................................................................................................ 43
Same as MACRO/RESTAR but is called by the AZpost postprocessor when the program is a
MULTAX tool path and has (6) parameter GOTO records. MACRO/ PRGEND .... 43
MACRO/ PRGEND................................................................................................. 44
MACRO/ PRGEND4............................................................................................... 44
SECTION FOUR – Additional Syntax Definitions............................................................ 45
Postprocessor Key Words ......................................................................................... 46
SEQN Numeric value of sequence number for next (current) block ............. 46
CURTL Numeric value of the current tool .................................................... 46
NEXTL Numeric value of the next tool ......................................................... 46
GAGEZ Numeric value of the tool gauge length (set length)........................ 46
PIVOTZ Numeric value of the tool gauge point to tool pivot point or .......... 46
distance from machine table to A-axis center-line............................................... 46
CLEARP Numeric value of Z-axis at clearance from part zero ....................... 46
CURX Numeric value of the X-axis current position (GOTO) ......................... 46
CURY Numeric value of the Y-axis current position (GOTO) ......................... 46
CURZ Numeric value of the Z-axis current position (GOTO) ......................... 46
CURA Numeric value of the A-axis current position (GOTO)......................... 46
CURB Numeric value of the B-axis current position (GOTO) ......................... 46
CURC Numeric value of the C-axis current position (GOTO) ......................... 46
HOMEZ Numeric value of Z-axis at its home position (FROM) ...................... 46
HOMEX Numeric value of X-axis at its home position (FROM)...................... 46
HOMEY Numeric value of Y-axis at its home position (FROM)...................... 46
HOMEZ Numeric value of Z-axis at its home position (FROM) ...................... 46
4
FEED Numeric value of current feed rate (upm or upr)................................ 46
RPM Numeric value of current spindle speed in RPM ................................. 47
FIXTUR Numeric value of current fixture code ............................................. 47
COOLNT Numeric value of current coolant code............................................ 47
SEQNO/ON Used in macro to turn sequence numbers ON............................ 48
SEQNO/OFF Used in macro to turn sequence numbers OFF ......................... 48
OPSKIP/ON Used in macro to turn opskip (block delete) ON......................... 48
OPSKIP/OFF Used in macro to turn opskip (block delete) OFF............................. 48
TPRINT Text value of current tool description (from TPRINT) ...................... 48
If used followed by a > character it will be applied .............................................. 48
to the next block as a machine code comment.................................................... 48
PROGID Text value (numeric) of program ID (from PARTNO)........................ 48
PARTNO Text value of program description (from PARTNO).......................... 48
Inserting “text” in the output ................................................................................... 48
Sample Configuration File......................................................................................... 49
5
Introduction
The Challenge
Mfg
Programmer
LOAD/ TOOL, 2
APTsource GOTO/ 2.5000, 5.0000, 0.0000
CLData
Postprocessor
N01T02M06
N02G00X025Y05
N03G43Z0H02
NCData
NC
Machine
Tool
The challenge in postprocessing has always been to make the part program (APT source) as
independent of the machine tool as possible. Making the part program independent of the
machine tool allows the APT source file to be post-processed for different machine tools (of the
same type) with little change to the program. This allows flexibility and efficiency on the shop
6
floor when the part is ready for manufacture since re-routing to a different machine tool would
be expedited.
7
The Goal
Mfg
Programmer
APTsource
CLData
AZpost
MachA.CFG MachB.CFG MachC.CFG
Remove unique machine tool syntax from the part program (APT source) and put this information in a
configuration file whose name can be referenced in the part program. The specific machine tool can
then be re-targeted by simply referencing a different configuration file.
8
The AZpost Concept
Machine Mfg
tool Programmer
information
HAASVF.pptable
APTsource
System editor MACHIN/VMC4X, HAASVF
(WordPad)
AZPost
Machine Tool Postprocessor
Configuration Files Executable
HAASVF.CFG VMC4X.EXE
NCData
NC
Machine
Tool
9
Prior to manufacturing process
/
*START_NC_INSTRUCTION NC_START_MACRO
*START_SEQUENCE
MACHIN/VMC4X,HAASVF,UNITS,INCHES,OUT,INCHES,OFF
PARTNO %MFG_IDENTIFIER %MFG_MACHINE_NAME
*END
*END
/
The APTsource file produced by CATIA will be targeted to the correct machine tool configuration
and machining group based on the information from the CAM pptable. The part program
(APTsource) may now be postprocessed for scheduled machining in the shop or can be held
(targeted) in APTsource form until scheduled for machining (see aptsource MACHIN/ below).
MACHIN/VMC4X,HAASVF,UNITS,INCHES,OUT,INCHES,OFF
PARTNO 123456 PART OPERATION POSTPROCESSOR TEST
$$ OPERATION NAME : Tool Change.2
$$ Start generation of : Tool Change.2
TLAXIS/ 0.000000, 0.000000, 1.000000
FROM / 0.00000, 0.00000, 6.00000
$$ TOOLCHANGEBEGINNING
CUTTER/ 1.000000, 0.000000, 0.500000, 0.000000, 45.000000,$
0.000000, 1.500000
TPRINT/T2 - SPOT DRILL 90 DEG
LOAD/TOOL,1,LENGTH, 4.528000
COOLNT/ON
10
Ready for machining
The APTsource can be postprocessed if scheduled for the original targeted machine tool.
< OR >
If scheduled for a different machine tool, the part program can be re-targeted by simply changing
the APTsource MACHIN/ reference to the correct machine tool configuration file and then
postprocessing.
11
The Environment
Installation
\AZpost
\bin Contains postprocessor executable files (.exe.)
\cfg Contains machine tool configuration files (.cfg)
When not using the Manufacturing Work Bench a Desk top shortcut can be created for each
postprocessor executable in the Azpost \bin folder. Each machine tool should have a
configuration file in the Azpost /cfg folder. Each configuration file must have a file extension of
.cfg and the file name must not exceed six (6) characters not counting the .cfg extension.
12
AZpost File Structure
Postprocessor
executable files
Machine tool
configuration files
AZpost
documentation
files
• The bin folder contains all the postprocessor executable files (.EXE)
• The cfg folder contains all the machine tool configuration files (.CFG)
• The doc folder contains AZpost documentation files (.DOC and .PDF)
13
APT File Structure
Macro folder by
machine tool
The APT folder can be sub-divided into working contract folders. These working folders can be
where the aptsource, postprocessor listing, and machine code files are created and stored.
A Macro folder can be created as a sub-folder for storing APT macros used by the postprocessors.
The Macro folder can be further sub-divided by machine tool. This allows different macros with
the same name to be created and stored for use with each machine tool. This method can be
used to keep the aptsource independent of the machine tool.
To postprocess an aptsource clfile the aptsource file can be dragged and dropped on the
postprocessor desk top icon. Postprocessor output files will be created in the same folder as the
aptsource clfile. Typical output files are created as follows:
14
The APTsource CLFile
st
PPRINTs before 1
Configuration File Cutter statement
MACHIN/VMC4X,HAASVF,UNITS,INCHES,OUT,INCHES,OFF
PARTNO 1234 PART OPERATION POSTPROCESSOR TEST FANUC GENERIC 3-AXIS
15
TPRINT/ T3 - 1/2 DIA END MILL LENGTH 2.500
LOAD/TOOL,3,LENGTH, 2.500000
COOLNT/ON
COOLNT/OFF
SPINDL/OFF
END
FINI
Program end
16
The Machine Code
START Macro
%
O1234 ( PART OPERATION POSTPROCESSOR TEST FANUC GENERIC 3-AXIS)
(POSTPROCESSING DATE: 03/17/2004 TIME: 10:59:00)
( MAKE FROM 8.5" X 4.5" X .5" ALUMINUM STOCK)
( LOCATE PART ZERO AT:)
DATIME, ON
( X = 0 IN FROM LEFT EDGE OF STOCK .5")
PPRINT,
( Y = LIST,
0 IN ON
FROM FRONT EDGE OF STOCK .5")
( Z = 0 AT BOTTOM OF STOCK)
17
N24 G02 X-.25 Y.5 I0. J.75 F5.
N25 G01 Y3.5
N26 G40 X-.3 Y3.55
PRGEND Macro
N27 Z.5
N28 M09
N29 M05
N30 G91 G28 Z0.
N31 G05P0
N32 G49 FOOTER, ON
N33 G91 G28 X0. Y0.
N34 M99
(TOTAL MACHINING TIME = 36716.70)
(PROGRAM SIZE IN BYTES = 604)
%
18
The Configuration File
General Concepts
The configuration file is a plain text file. Most editors can be used to edit the file. The Windows “Word
Pad” editor is recommended. The file extension for the configuration file must be .cfg and this extension
can be registered with Windows for editing by the Word Pad editor. If other document editors (i.e.
Word) are used, fonts and formatting must not be used (ie. turned off) and the file must be saved with
extension .CFG.
19
SECTION ONE – Default Limits and Modes
Section one contains APT predefined postprocessor statements that define default limits and
programming modes. The syntax for the statements follow standard APT rules as shown in the following
example:
LIMITS/ Major key word defining function (Axis limits) followed by a slash “/”
XAXIS Minor key word defining feature (X-axis limits) followed by a comma “,”
-40,40 Numeric values (with or without decimal point “.”) separated by commas.
$$ Text following double dollar is ignored by the postprocessor and is used
for commenting statement.
Comments $$ can be used anywhere and all text following the $$ in the statement is ignored by the
postprocessor. A comma separator is not used after the last minor word or value in the statement.
Specific syntax is defined by the postprocessor and is documented in the postprocessor The following
syntax is basic to all postprocessors:
Note: Major & minor key words must be as shown in upper case. Lower case text
must be replaced by appropriate numeric values.
20
Predefined postprocessor syntaxes
CLEARP/ value
Sets a clearance plane for Z-axis motion based on program coordinates. This value can then be
used in the MACROs defined in Section three of the configuration file.
Sets the maximum feed rate in (units per minute) that can be programmed for the machine tool.
Any programmed feed rate exceeding this value will create a warning in the listing and status files
and the programmed value will be replaced or recomputed using the maximum upm value. See
SET/ UNITS for defining units.
INCLUD/ windows_path
This syntax points the postprocessor to the location of the APT Macro folder for this specific
machine tool. Example: INCLUDE/C:\APT\MACROS\VMC4X
Sets the default axis values for postprocessor limit checking. Minor key word for specific axis
followed by a minimum and maximum value couplet. This statement also sets the total travel as
the difference between the maximum and minimum values for each axis.
Sets a machine tolerance value when computing A-axis rotation based on tool axis vectors in the
aptsource GOTO records. This allows tool axis vectors that are within the tolerance value of the
YZ plane to be accepted without errors.
Sets the selection (ready position) of the next tool for automatic output. See Section two in
reference to register T1 for next tool. See Section three for use of T1 in MACROs.
21
Sets the sequence numbering in the machine code program (i.e. N). Sequence begins with the
start value and is incremented using the increment value. Both values should be integer values
(non decimal). The sequence numbering can also be turned off using the OFF minor word.
Sets the maximum spindle RPM that can be programmed for the machine tool. Any programmed
spindle speed exceeding this value will create a warning in the listing and status files and the
programmed value will be replaced or recomputed using the maximum rpm value.
Sets A-axis plus (+) rotation to either CLW or CCLW when looking in the plus X-axis direction.
Default ISO standard PLUS = CLW.
Sets maximum degrees per minute for rotary axis, where dpm is a numerical value
Sets maximum inverse time feed rate number, where frn is a numeric value
SET/ ITUNIT, 1
60
Sets inverse time units, use 1 for minutes and 60 for seconds
22
SET/ AAXIS, TYPE, 1
2
Type 1 (default) defines absolute rotary angles signed plus or minus from rotary zero.
23
Type 2 defines rotary angles absolute (unsigned) with sign determining direction of rotation.
24
SET/ CIRCLE, QUADRT, OFFSET, INCR
FULL ABS
Sets a clipping value for the Z-axis. This value is used by the postprocessor to ignore any
aptsource GOTO statement that exceeds this Z-axis value. Used to remove automatic CATIA
created GOTO statements before and or after a CATIA tool change.
Sets the machine code comment message start characters and end characters.
Default SET/COMMSG,(,)
Sets the depth (Z,R) values used in the aptsource CYCLE statement to be either computed in
absolute (ABS) from program zero or incremental (INCR) from the cycle reference plane.
SET/ DATIME, ON
OFF
Sets the date and time stamp DATIME when the aptsource was postprocessed to be output in the
beginning of the machine code program (as comments). This is can be turned ON or OFF using
the corresponding minor key word.
SET/ FOOTER, ON
OFF
25
Sets the machining time and program size to be output at the end of the machine code program
(as comments). This is can be turned ON or OFF using the corresponding minor key word.
Sets the machine code format to insert blank spaces before each word address. This function can
be turned ON or OFF using the corresponding minor key word.
Sets the machine code format to insert a plus sign + when dimensional values are positive. This
function can be turned ON or OFF using the corresponding minor key word.
Sets the machine code format to add a zero after the decimal point on decimal format when
values are whole numbers. This function can be turned ON or OFF using the corresponding minor
key word.
Sets the machine axis positions at program start in program coordinates. These values
are used in computing time for program start, end, and tool changes. This command sets the
HOMEX, HOMEY, and HOMEZ variables. These values are overridden by the aptsource FROM
statement .
Sets the file extension characters for the machine code file (default NCD).
Example SET/ NCDEXT, MTF
Sets the default zero offset (origin) value in the fixture offset register (i.e. G54).
Sets distance from the spindle face to the rotary pivot point.
26
SET/ PPRINT, LIST, ON
OFF
Sets the aptsource PPRINTs before the first cutter statement to be output as comments. This is
can be turned ON or OFF using the corresponding minor key word.
SET/ TLCOMP, ON
OFF
Sets the maximum value for the tool that can be programmed in the aptsource using the
LOAD/TOOL or LOADTL command. Any programmed TOOL exceeding this value will create a
error message in the listing and status files and the postprocessor will output a manual tool
change in the machine code file.
Sets the TOOL LIST to be output in the beginning of the machine code program (as comments).
This is can be turned ON or OFF using the correponding minor key word.
Sets the program UNITS of the input aptsource and the machine code OUTput units. If the UNITS
and OUT are different the postprocessor will convert the input UNITS to the OUT put units for all
dimensional data. The UNITS minor key word is followed by its minor key word INCHES or MM.
The OUT minor key word is followed by its minor key word INCHES or MM.
27
SECTION TWO – Register Definitions and Values
Section two contains register definitions similar to machine tool control CNC register groups. The syntax
for these statements is shown and is described in the following examples:
Parameters
1--2—---3----4--5—- 6 thru 48 Comment
REGDEF/ Required for all register definitions (must be upper case followed by
a ‘/’)
2nd Parameter Word address user defined per machine tool code. Can be up to
six characters
28
All parameters are separated by a comma. A comma separator is not used after the last value in the
statement.
Registers are predefined in the postprocessor (2nd parameter) and can not be added to or deleted from
the configuration file. Word addresses, formats, modality, and numeric values of the predefined register
can be changed.
The order that the registers are output in the machine code block is determined by the order that the
registers are defined in section two of the configuration file. REGDEF records can be moved using the cut
and paste method found in most text editors.
Section two must end with an EOT (End of Table) statement.
Example 1:
Example 2:
29
point. Format (1) = decimal point output.
T Modality true. If value same as current then don’t output.
30
G Register features:
G0 General Undefined
G1 Interpolation RAPID, LINEAR, CIRCULAR CLW, CIRCULAR CCLW,
DWELL, SINGLE THREAD, THREAD CYCLE
G2 Plane Select XYPLAN, ZXPLAN, YZPLAN
G3 Mode Select ABSOLUTE, INCEMENTAL
G4 Spindle mode SUM, RPM
G5 Feed rate mode INVERSE_TIME, UPM, UPR
G6 Units mode INCHES, MM
G7 Cutter rad comp OFF, LEFT, RIGHT
G8 Tool length comp ADD, SUBTRACT, CANCEL
G9 Cycle type OFF (G80)
BRKCHP (HS PECK) (G73)
TAP (LEFT HAND) (G74)
TAP (HEAD) (G75)
FBORE (FINE BORE) (G76)
DRILL/CSINK (G81)
CBORE/ FACE (G82)
DEEP (G83)
TAP (RIGHT HAND) (G84)
BORE/ REAM (G85)
BORE6 (SPINDLE OFF) (G86)
BORE7 (BACK) (G87)
BORE8 (DWELL,SPINDLE OFF) (G88)
BORE9 (DWELL) (G89)
G10 Fixture offset LOCAL, MACHINE, 1, 2, 3, 4, 5, 6, DATUM
M Register features:
M0 General Undefined
M1 Tool Change LOAD/TOOL
M2 Coolant type OFF, ON/FLOOD, MIST, THRU, TAP, AIR, AUX
M3 Spindle mode OFF, CLW, CCLW, LOCK, CLAMP, UNCLAMP, LOW, HIGH
M4 Subroutine mode MAIN_END, RETRCT, CLEAR
M5 Program control STOP, OPSTOP, END, REWIND
31
SECTION THREE – Program MACRO Sequences
Section three contains Macro definitions that contain machine code sequences constructed using
the predefined registers and their values enclosed in parentheses. Macros are defined starting
with the Major word MACRO followed by a slash followed by the predefined macro name. The
body of the macro contains records containing the predefined registers and their values enclosed
in parentheses. The end of the macro is identified with the major word END. An EOF record
must be the last record in section three after the last macro. The syntax for these records is
shown and is described in the following examples:
Example:
The $$ can be used for documentation in the macro as shown and is ignored by the
postprocessor. The macro starts with the major word MACRO followed by a “/” and the
predefined name of the macro. Each predefined macro will be discussed below. The macro
must end with the major word END. The body of the macro can contain up to twelve (12) records
that represent the machine blocks to be output. Each record must end with a single $
representing the end of block character. Each record can contain registers followed by a pair of
parentheses () or text enclosed in a pair of double quotes “”. Parentheses and quotes can not be
mixed in a record. Key words representing postprocessor values can also be used inside the
register parentheses as follows:
() - Empty parentheses specifies that the current value of the register for the
specific macro will be output.
(9) – A numeric value specifies that the register is to be output with the given
numeric value according to the REGDEF format in section two. The value
can be specified with or without a decimal point.
Each register and parentheses pair must be separated from the next by a space character. The
end of block ($ character) is not separated by a space and can be then followed by a comment
beginning with a $$.
32
Key words are predefined by the postprocessor and the number of them can vary based on the
specific postprocessor and postprocessor type. The specific key words are defined in the
postprocessor documentation, but the basic key words are defined as follows:
PIVOTZ Numeric value of the tool gauge point to tool pivot point or
distance from machine table to A-axis center-line.
33
RPM Numeric value of current spindle speed in RPM
34
Postprocessor Key Syntaxes
The following syntaxes can be used as a macro record to control specific postprocessor output.
These syntaxes are used without an ending $.
The use of double quotes allows text to be specified for output in a block. This text is not
formatted or checked in any way for correctness. This can be used for outputting special
characters including blank records as follows:
35
Conditional output of blocks
Example:
Note that spaces are not allowed in the IF[…] syntax and that the key logical variables that are
referenced in the brackets most be predefined in the specific AZpost executable.
36
Predefined Macros
MACRO/ START
This macro is output at the immediate beginning of the machine code program. It can be used to
output any special characters and any program identification information using the PROGID and
PARTNO key words.
Example:
Aptsource:
Macro Specification:
MACRO/START
“%”
O(PROGID) PARTNO
END
%
O1234 (PART OPERATION POSTPROCESSOR TEST FANUC GENERIC 3-AXIS)
37
MACRO/ FROM
This macro is output at the beginning of the machine code program by the aptsource FROM
statement. This macro can be used to output any initial registers and values. The FROM
statement sets the HOMEX, HOMEY and HOMEZ values.
Example:
Aptsource:
Macro Specification:
MACRO/FROM
G6()$ $$ INITIALIZE UNITS
G1(0) G2(17) G3(90) G7(40) G8(49) G9(80)$ $$ INITIALIZE G CODES
END
N1 G20
N2 G00 G17 G90 G40 G49 G80
MACRO/ FROM4
Same as MACRO/FROM but is called by the AZpost postprocessor when the program is a MULTAX
tool path and has a (6) parameter FROM record.
38
MACRO/ RETRCT
This macro is output before all tool changes except the first. This macro can be used to cancel
any modes, turn of any functions and output any positioning moves prior to the tool change.
The aptsource
LOAD/ TOOL statement activates this macro.
Example:
Aptsource:
LOAD/TOOL,1,LENGTH, 4.000000
Macro Specification:
MACRO/RETRCT
M3(5)$ $$ SPINDLE OFF
G3(91) G8(28) ZZ(0.) M2(9)$ $$ Z-AXIS TO MACHINE ZERO, COOLNT OFF
G8(49)$ $$ CANCEL TOOL LENGTH
M5(1)$ $$ MACHINE OPTIONAL STOP
END
N13 M05
N14 G91 G28 Z0. M09
N15 G49
N16 M01
39
MACRO/ TLCHG1
This macro is output for the first tool change. This macro is used to output any codes for the tool
change block including tool description text. The aptsource LOAD/ TOOL statement activates this
macro.
Example:
Aptsource:
Macro Specification:
MACRO/TLCHG1
TPRINT> $$ Add TPRINT text to next block as comment
TT() M1(6)$ $$ Select and load the requested tool
END
40
MACRO/ TLCHG
This macro is output for all tool changes except the first. This macro is used to output any codes
for the tool change block including tool description text. The aptsource LOAD/ TOOL statement
activates this macro.
Example:
Aptsource:
Macro Specification:
MACRO/TLCHG
TPRINT> $$ Add TPRINT text to next block as comment
TT() M1(6)$ $$ Select and load the requested tool
END
41
MACRO/ GOHOME
This macro is output to position the machine tool axes to the machine home position. This macro
can be used to cancel any modes, turn off any functions and output the positioning moves. The
aptsource GOHOME
statement activates this macro.
Example:
Aptsource:
GOHOME
Macro Specification:
MACRO/GOHOME
M3(5)$ $$ SPINDLE OFF
G3(91) G8(28) ZZ(0.) M2(9)$ $$ Z-AXIS TO MACHINE ZERO, COOLNT OFF
G3(91) G8(28) XX(0.) YY(0.)$ $$ X & Y AXIS TO MACHINE ZERO
G8(49)$ $$ CANCEL TOOL LENGTH
M5(0)$ $$ MACHINE STOP
END
N13 M05
N14 G91 G28 Z0. M09
N14 G91 G28 X0. Y0.
N15 G49
N16 M00
42
MACRO/ RESTAR
This macro is output after all tool changes. This macro can be used to restart any modes, turn on
any functions and output any positioning moves after the tool change. The first aptsource GOTO
statement activates this macro. All values defined in aptsource FEDRAT, SPINDL and ORIGIN
statements after LOAD/TOOL are held until this GOTO statement.
Example:
Aptsource:
Macro Specification:
MACRO/RESTAR
“G05P10000” $$ High speed machining mode
G1(0) G3(90) G10() XX() YY() SS() M3()$ $$ First XY move after tlchg
G8(43) ZZ() HH() M2()$ $$ First Z-axis
END
N18 G05P10000
N19 G00 G90 G54 X1. Y-1. S1050 M03
N20 G43 H3 Z.5 M08
MACRO/ RESTAR4
Same as MACRO/RESTAR but is called by the AZpost postprocessor when the program is a
MULTAX tool path and has (6) parameter GOTO records.
43
MACRO/ PRGEND
This macro is output to end the program, position the machine tool axes to the machine home
position. This macro can be used to cancel any modes, turn off any functions and output the
positioning moves. The aptsource END statement activates this macro.
Example:
Aptsource:
END
Macro Specification:
MACRO/PRGEND
M2(9)$ $$ COOLNT OFF
M3(5)$ $$ SPINDLE OFF
G1(0) G3(91) G8(28) ZZ(0.)$ $$ Z AXIS TO MACHINE ZERO
“G05P0” $$ CANCEL High Speed Machining
G8(49)$ $$ CANCEL TOOL LENGTH
G1(0) G3(91) G8(28) XX(0.) YY(0.)$ $$ X & Y AXIS TO MACHINE ZERO
M5()$ $$ END PROGRAM
END
N28 M09
N29 M05
N30 G91 G28 Z0.
N31 G05P0
N32 G49
N33 G91 G28 X0. Y0.
N34 M99
MACRO/ PRGEND4
Same as MACRO/PRGEND but is called by the AZpost postprocessor when the program is a
MULTAX tool path and has (6) parameter GOTO records.
44
SECTION FOUR – Additional Syntax Definitions
Section four contains syntax definitions that contain machine code sequences constructed using
the predefined registers and their values enclosed in parentheses. Syntaxes are defined starting
with the Major word SYNDEF followed by a slash followed by the APT source syntax. The body of
the macro contains records containing the predefined registers and their values enclosed in
parentheses. An EOF record must be the last record in section four. The syntax for these records
is shown and is described in the following examples:
Example:
The $$ can be used for documentation in the macro as shown and is ignored by the
postprocessor. The macro starts with the major word MACRO followed by a “/” and the
predefined name of the macro. Each predefined macro will be discussed below. The macro
must end with the major word END. The body of the macro can contain up to twelve (12) records
that represent the machine blocks to be output. Each record must end with a single $
representing the end of block character. Each record can contain registers followed by a pair of
parentheses () or text enclosed in a pair of double quotes “”. Parentheses and quotes can not be
mixed in a record. Key words representing postprocessor values can also be used inside the
register parentheses as follows:
() - Empty parentheses specifies that the current value of the register for the
specific macro will be output.
(9) – A numeric value specifies that the register is to be output with the given
numeric value according to the REGDEF format in section two. The value
can be specified with or without a decimal point.
Each register and parentheses pair must be separated from the next by a space character. The
end of block ($ character) is not separated by a space and can be then followed by a comment
beginning with a $$.
45
Key words are predefined by the postprocessor and the number of them can vary based on the
specific postprocessor and postprocessor type. The specific key words are defined in the
postprocessor documentation, but the basic key words are defined as follows:
PIVOTZ Numeric value of the tool gauge point to tool pivot point or
distance from machine table to A-axis center-line.
46
RPM Numeric value of current spindle speed in RPM
47
Postprocessor Key Syntaxes
The following syntaxes can be used as a macro record to control specific postprocessor output.
These syntaxes are used without an ending $.
The use of double quotes allows text to be specified for output in a block. This text is not
formatted or checked in any way for correctness. This can be used for outputting special
characters including blank records as follows:
48
Appendix A
49
REGDEF/ X1, X, 214, 413, T $$ LINEAR ABSCISSA AXIS
REGDEF/ Y1, Y, 214, 413, T $$ LINEAR ORDINATE AXIS
REGDEF/ Z1, Z, 214, 413, T $$ LINEAR NORMAL AXIS
REGDEF/ Z2, Z, 214, 413, F $$ AXIAL DRILL DEPTH
REGDEF/ I1, I, 214, 413, F $$ ARC CENTER OFFSET PARALLEL TO ABSCISSA AXIS
REGDEF/ J1, J, 214, 413, F $$ ARC CENTER OFFSET PARALLEL TO ORDINATE AXIS
REGDEF/ K1, K, 214, 413, F $$ ARC CENTER OFFSET PARALLEL TO NORMAL AXIS
REGDEF/ D1, D, 260, 260, F $$ CUTTER RADIUS COMPENSATION REGISTER
REGDEF/ R1, R, 214, 413, F $$ CLEARANCE PLANE AXIAL DRILL CYCLE
REGDEF/ Q1, Q, 214, 413, F $$ INCREMENT VALUE DEEP & BREAK CHIP CYCLES
REGDEF/ A1, A, 214, 413, T $$ ROTARY AXIS AROUND ABSCISSA
REGDEF/ F1, F, 311, 412, T $$ FEED RATE VALUE
REGDEF/ P1, P, 244, 244, F $$ PROGRAM DWELL VALUE
REGDEF/ S1, S, 540, 540, T $$ SPINDLE SPEED VALUE
REGDEF/ T1, T, 240, 240, F $$ CURRENT TOOL NUMBER
REGDEF/ T2, T, 240, 240, F $$ NEXT TOOL NUMBER
REGDEF/ L1, L, 240, 240, F $$ SUBROUTINE NUMBER
REGDEF/ M0, M, 260, 260, T $$ GENERAL MISCELLANEOUS FUNCTIONS
REGDEF/ M1, M, 260, 260, F, 6 $$ TOOL CHANGE FUNCTIONS (LOAD/TOOL)
REGDEF/ M2, M, 240, 240, T, 9,8,7,12,50,51,8 $$ COOLANT FUNCTIONS
(OFF,ON/FLOOD,MIST,THRU,TAP,AIR,AUX)
REGDEF/ M3, M, 260, 260, T, 5,3,4,19,21,22,41,42 $$ SPINDLE FUNTIONS
(OFF,CLW,CCLW,LOCK,CLAMP,UNCLAMP,LOW,HIGH)
REGDEF/ M4, M, 260, 260, T, 17,98,99 $$ SUBROUTINE FUNCTIONS
(END,RETRCT,NO_RETRCT)
REGDEF/ M5, M, 260, 260, F, 0,1,2,30 $$ PROGRAM CONTROL FUNCTIONS
(STOP,OPSTOP,END,REWIND)
EOT
$$**********************************************************************************
$$ SECTION THREE - Program MACRO Sequences
$$**********************************************************************************
$$
$$*********** START MACRO SEQUENCE **************
MACRO/START
" "
"%" $$ Rewind stop code
O(PROGID) PARTNO $$ Program ID
END
$$*********** FROM MACRO SEQUENCE (3-AXIS) ***************
MACRO/FROM
G3() G6() G7(40) G9(80)$ $$ Initialization Block
END
$$*********** FROM MACRO SEQUENCE (4-AXIS) ***************
MACRO/FROM4
G3() G6() G7(40) G9(80) A1(0)$ $$ Initialization Block
END
$$**** RETRACT MACRO SEQUENCE (Tool Change) *****
MACRO/RETRCT
M2(9)$ $$ Coolant Off
G0(28) G3(91) Y1(HOMEY) Z1(CLEARP)$ $$ Machine Zero Y & Z-axis
END
$$******** 1ST TOOL CHANGE MACRO SEQUENCE *******
MACRO/TLCHG1
TPRINT> $$ Add TPRINT text to next block
T1() M1(6)$ $$ Select & Load programmed tool
END
$$***** ALL OTHER TOOL CHANGE MACRO SEQUENCE ****
50
MACRO/TLCHG
" " $$ Blank block before tool change
TPRINT> $$ Add TPRINT text to next block
T1() M1(6)$ $$ Select & Load programmed tool
END
$$*********** GOHOME MACRO SEQUENCE *************
MACRO/GOHOME
M2(9)$ $$ Coolant Off
G0(28) G3(91) Y1(HOMEY) Z1(HOMEZ)$ $$ Machine home Y & Z axis
END
$$*********** RESTART MACRO SEQUENCE (3-AXIS) ************
MACRO/RESTAR
G1(0) G3(90) G10() XX() YY() SS() M3()$ $$ 1st XY motion after Tool Change
G8() Z1() H1() M2()$ $$ 1st Z motion after Tool Change
END
$$*********** RESTART MACRO SEQUENCE (4-AXIS) ************
MACRO/RESTAR4
G1(0) G3(90) G10() X1() Y1() A1() S1() M3()$ $$ 1st XY motion after Tool Change
G8() Z1() H1() M2()$ $$ 1st Z motion after Tool Change
END
$$******* CYCLE ACTIVATE MACRO SEQUENCE *********
MACRO/CYCLE
G0() G9() X1() Y1() Z2() R1() F1()$ $$ CYCLE (DRILL,BORE, etc)Activation
G0() G9() X1() Y1() Z2() R1() Q1() F1()$ $$ CYCLE (DEEP,BRKCHIP) Activation
G0() G9() X1() Y1() Z2() R1() F1()$ $$ CYCLE (TAP)Activation
G9(80)$ $$ CYCLE De-activation Block
END
$$************* PROGRAM END SEQUENCE (3-AXIS) ************
MACRO/PRGEND
M3(5)$ $$ Spindle Off
G1(0) G2(28) G3(91) M2(9)$ $$ Z-axis home, Coolant Off
G1(0) G2(28) G3(91) Y1(HOMEY) Z1(HOMEZ)$ $$ Machine home XY Axis
M5(99)$ $$ End of Main program code
END
$$************* PROGRAM END SEQUENCE (4-AXIS) ************
MACRO/PRGEND4
M3(5)$ $$ Spindle Off
G1(0) G2(28) G3(91) M2(9)$ $$ Z-axxis home, Coolant Off
G1(0) G2(28) G3(91) Y1(HOMEY) Z1(HOMEZ) A1(0)$ $$ Machine home XY Axis
M5(99)$ $$ End of Main program code
END
$$**********************************************************************************
$$ SECTION FOUR - Additional Program SYNTAX Definitions
$$**********************************************************************************
SYNDEF/PALLET,IN $$ DEFINE LOAD PALLET SYNTAX
M0(77)$ $$ DEFINE HYPER MACHINE CODE BLOCK
SYNDEF/PALLET,OUT $$ DEFINE UNLOAD PALLET SYNTAX
M0(78)$ $$ DEFINE HYPER MACHINE CODE BLOCK
SYNDEF/CALSUB,&1,REP,&2 $$ DEFINE SUBROUTINE CALL SYNTAX
P2(&1) L1(&2)$ $$ DEFINE HYPER MACHINE CODE BLOCK
EOF
51