50408g
Post
HASTE
Postprocessor
Formatting Reference Manual
Have you seen Appendix E? IF NOT, YOU SHOULD! Please see page 119 now.What is this manual and who is it for?
This is the second of two manuals written for PostHASTE – it contains detailed information regarding the PostHASTE formatting templates.
This manual was written for people who are already familiar with the basic concepts covered in the manual entitled Getting Started with PostHASTE. If you haven't already, please read (or review) that manual.
What is PostHASTE?
PostHASTE (sometimes referred to as “the post” for short) is a software system that translates your CAM system's tool motion output (CL files) into 'NC program' text (or 'ASCII') files to drive NC or CNC machines. PostHaste can create programs in any of these formats:
• EIA (sometimes referred to as 'ISO') standard:
EIA programs are the most common type of machine control files; they typically use G, X, Y, Z, T and/or M codes (among others) for various machine movements and functions.
• 'Conversational':
Conversational programs are usually somewhat similar to EIA programs, but typically have words or phrases (such as 'LINE' or 'ARC') in place of some or all of the standard letter codes.
• Tab-sequential (or “columnar”):
These types of programs are not very common anymore, but are sometimes needed for older (e.g. 'Bandit less expensive (such as Emco-Maier) machines. These programs have the various
numerical values arranged in columns (instead of using a letter); the location (or spacing) of the numbers within each line determines the significance of the value. For example the first column may be an X position, the second column the Y position, and so on.
Limitations of PostHASTE
Some machines do not use the above conventions and therefore PostHaste may not be suitable for use in generating NC programs for them; among them are some Brother and older Mazak ('Mazatrol' language) machines and several others. If you have any doubt as to whether or not PostHaste is suitable for your machine, then call us; we will be able to help you determine its suitability. If it is not, then you may either purchase a postprocessor that has been customized to the specific machine, or get as close to it as possible by configuring PostHaste, then editing the NC code (using a text editor) to suit your machine exactly.
Table Of Contents
What is this manual and who is it for? ...i
What is PostHASTE? ...i
Limitations of PostHASTE ...i
1. POSTHASTE BASICS ... 1
1.1 How PostHaste works... 1
1.2 Template file extension naming conventions ... 1
2. FORMAT TEMPLATES - THE BASICS... 2
2.1 Overall structure of the template file... 2
First - the NAME line ... 2
The address (letter) formats ... 2
Commands and 'Switches'... 3
Basic rules regarding commands ... 3
The “Sequences” ... 3
2.1.1 Comments in the format ... 4
3. THE LETTER FORMATS... 5
C__ (the COLUMN number - used only for columnar programs - see examples later)... 6
S_ (the “Spaces” number - used only for columnar programs - see examples later) ... 6
+ (the plus sign) ... 6
- (the minus sign) ... 6
> (the “up to...” sign) ... 6
A numeral (in the above example the number: 3) ... 6
. (a decimal point) ... 7
> (the “up to...” sign [again]) ... 7
A number (in the above example the number: 4) ... 7
x - the OUTPUT character. ... 7
The OUTPUT character for COLUMNAR style programs:... 7
3.1 Advanced letter formatting ... 8
3.1.1 Suppression of a letter (“numbers only” output) ... 8
3.1.2 Letter format modifiers ... 8
Add __... 8
DivBy _ and DivInto _ ... 9
Inc 10 IncFrom _... 10 Limit __ __... 10 Clamp __ __... 10 Mod __ ... 11 Modal ... 11 Mult __... 11 No-Opt ... 12 Sub __ ... 12
3.1.3 How Letter Format Modifiers are used together... 12
Hierarchy of Modifiers: ... 13
Notes re “LIMIT checking”: ... 14
Regarding IncFrom:... 14
4. COMMANDS AND 'SWITCHES' ... 15
What's a Switch? ... 15
4.1 List of Commands and Switches (the ones that are not used inside sequences) ... 15
Note: See section 5.3 for commands that are used only inside of sequences. ... 15
We have listed all of the commands and switches in this section in alphabetical order, except for... .. 15
4.1.1 Ask ... 16
How to make the Ask repeat... 17
4.1.2 AskPeckClear? ... 17
4.1.3 ByDiameter? (lathe only) ... 17
4.1.4 Comment ... 18
4.1.5 Convert ... 18
4.1.6 Coolant ... 19
Examples:... 19
4.1.6.1 Using [Cool] in an IF statement ... 19
4.1.7 DComp ... 19
4.1.8 Drive... 20
4.1.9 Each ... 20
4.1.10 EOB ('End Of Block' characters) ... 20
4.1.11 EOF ('End Of File' characters)... 21
4.1.12 Feed and Rapid ... 21
4.1.13 FeedType ... 21
4.1.14 First#?... 21
4.1.16 HCode2, VCode2, and DCode2 ... 22 4.1.17 Inc/Abs ... 22 4.1.18 Inch/MM... 22 4.1.19 Incremental? ... 22 4.1.20 Ignore ... 23 4.1.21 Leading0s?... 23 4.1.22 LocalOutput? ... 23
Important! Make sure your [Work] numbers match! ... 24
4.1.23 ModalGs ... 24
4.1.24 ModalLetters... 24
4.1.25 Notes: / EndOfNotes (or EndNotes) ... 25
4.1.26 Rename... 26
4.1.27 ReturnPlane or RetPlane ... 26
4.1.28 RevSigns... 27
4.1.29 RoundToQuad?... 27
Automatic 'round center to startpoint' feature... 27
4.1.30 RevTurret2? ... 28
4.1.31 Sequence#s ... 28
4.1.32 Spaces? ... 29
4.1.33 SpeedType (lathe only) ... 29
4.1.34 Spindle... 29 4.1.35 SpliceSubs?... 29 4.1.36 Thread ... 29 4.1.37 TLAxisEnabled? ... 30 4.1.38 Tolerance ... 30 4.1.39 Tools... 30 4.1.40 UpperCaseComments?... 31 4.1.41 Verbose?... 31 4.1.42 Work... 31 4.1.43 WorkDefault ... 32 4.1.44 ZRestart? ... 32
4.2 Arc processing commands and switches ... 33
4.2.1 ArcPlane ... 33
Using the [ArcPlane] variable in an ArcCode sequence ... 34
4.2.2 Cw and Ccw... 35
4.2.4 CtrCode>180 and CtrCode360 ... 35
4.2.5 CtrIncremental?... 36
4.2.6 ByQuadrants?... 36
4.2.7 Helical?... 36
4.2.7.1 Helical arcs - Handling special cases... 36
So, what value is output with the K? ... 37
What if you want some other K value?... 37
4.2.8 MaxRad ... 38
4.2.9 MinRad ... 38
4.2.10 MinArc ... 38
4.3 Special commands for Columnar style formats... 39
4.3.1 Spaces ... 39
4.3.2 Dummy ... 39
5. THE “SEQUENCES”... 40
5.1 Using Variables:... 40
For a complete list of variable names and descriptions, see Appendix A. ... 41
5.2 The Sequence Descriptions... 42
5.2.1 The standard sequences ... 42
5.2.1.1 StartCode... 42 5.2.1.2 1stToolChange... 43 5.2.1.3 ToolChange ... 44 5.2.1.4 Infeed ... 44 5.2.1.5 OutFeed... 44 5.2.1.6 EndCode... 45 5.2.2 Canned Cycles ... 46
5.2.2.1 Two ways to output canned cycles: 'canned' and 'longhand'... 46
You may “mix and match” your drilling cycle methods... 46
5.2.2.2 Cancel ... 47
“End cancel” vs. “End” ... 47
The 'Cancel' sequence... 47
5.2.2.3 Peck drilling (The Peck and ChipBreak cycles)... 47
…but what if my machine does not have a Peck or ChipBreak cycle?... 48
5.2.2.4 Advanced canned cycle control... 48
5.2.3 Controlling 'modality' - the “Force?” option ... 49
5.2.4.1 Sequences for custom and multi-line movements LineCode, RapidCode and ArcCode
(CwCode, CCWCode) ... 50
Important notes regarding ArcCode (and CwCode and CcwCode):... 51
LineCode and RapidCode sequences... 51
5.2.4.2 AutoThread (used for lathe only) ... 51
[TParams] variable ... 52
"Individual" thread parameter variables available... 52
5.2.4.3 Index (used for machines with rotary axes) ... 53
... for machines with ONE rotary axis ... 53
Which letter should I use on my INDEX line? / Do I need the minus sign?... 53
INDEX definition when rotary axis on CAD model does not match machine orientation... 54
... for machines with TWO (or more) rotary axes ... 54
5.2.4.4 Stop ... 54
Handling ‘Optional Stop’ (OPSTOP) CL records... 55
5.2.4.5 Upon, UponRec & Cycle sequences... 55
Upon ... 55
The Every, PreScan and Unique modifiers... 56
The Relate option for 'Upon ... Unique' sequences: ... 57
UponRec and Cycle ... 58
Using variables with UponRec or Cycle to handle the incoming values... 60
Cycle (using variables) ... 60
More UponRec and Cycle examples... 61
5.2.5 CallMe and Call (User-defined sequences and 'reusing' sequences) ... 61
5.3 Commands that can be used inside of sequences... 62
5.3.1 Call ... 62
5.3.2 Comments ... 63
5.3.3 If, Else and EndIf ... 63
5.3.4 File... 64
What the File commands can do for you ... 64
How to use the File commands ... 64
* Important notes re the Alias and Empty commands... ... 66
5.3.4.1 'File' usage example: Creating a 'tool list' at the top of the program. ... 67
5.3.5 NoEol and EOL... 68
5.3.5.1 EOL... 68
5.3.6 Set... 69
6. WORK FIXTURE OFFSETS (G54, ETC.): HOW THEY [WORK] ... 71
The 3 issues (in the format template) that control Work offsets... 71
Work offsets "in a nutshell" ... 71
But, what if you DON'T want work offsets in your NC programs?... 72
Handling 'non-standard' work offsets (G54.1 P_ , G15 H_ ... etc.)... 72
Details, details, details... ... 72
The Work line ... 73
The WorkDefault line ... 73
The [Work] variable (used in the sequences) ... 73
Changing [Work] offsets between drilling cycles. ... 74
Getting rid of redundant G54 (et al) codes ... 75
7. SPECIAL FEATURES ... 76
7.1 Using Equations (mathematical operations)... 77
7.1.1 Mathematical symbols and functions ... 77
Hierarchy of operations & use of parentheses ... 78
7.2 Suppressing line numbers and outputting blank lines ... 78
Suppressing line numbers ... 78
Outputting blank lines... 79
7.3 'Text output' and text {variables} ... 79
7.3.1 Direct ('hard-coded') text output ... 79
7.3.2 Regarding use of 'quotes' (and outputting quotes in your code) ... 80
7.3.3 Using {text variables} ... 80
7.3.4 Important information regarding text and text variables:... 81
7.4 “Search and Replace”... 81
Avoid 'double-replacements'!... 82
The NoComment option ... 82
The ALL option... 83
7.5 If / Else Logic ... 84
Logical operators ('Equals', 'Greater than', etc.)... 85
Testing 2 conditions: Using AND and OR with IF... 85
7.6 Outputting subs (subprograms), and the automatic 'multiple part' program feature ... 85
7.6.1 Basic Fanuc setup example... 86
7.6.2 Automatic multiple part programs ... 86
7.6.3 Sequences, variables and switches used for subs... 88
7.6.3.1 SubCall sequence... 88
7.6.3.2 SubStart, SubEnd, and Between sequences ... 88
7.6.3.3 [Sub], [SubLine] and [Times] (sub variables)... 89
7.6.3.4 Switches used to control subs ... 89
SpliceSubs? switch ... 89
7.7 The PostHaste.log file (for “debugging”) ... 90
Inhibiting the log file for faster processing... 91
8. “SPECIAL CASE” TACTICS & NOTES ... 93
8.1 Concerning incremental / absolute output and the [IncMode] variable... 93
8.2 How to format “P1=” type codes... 94
8.3 'Block deletes' on multi-part sub calls ... 95
9. APPENDIX A - LIST OF VARIABLES ... 96
Categories of variables ... 96
The variables... ... 97
9.1.1.1 Variables that apply to movements in general ... 98
9.1.1.2 Variables that can be used to format arc movements ... 101
9.1.1.3 Variables related to “point-to-point” Drilling cycles ... 102
9.1.1.4 Variables set from the Tool or Tool Change information ... 104
9.1.1.5 Variables used for subroutines or subprograms ... 107
9.1.1.6 Text Variables ... 107
9.1.1.7 Prompted Variables ... 108
9.1.1.8 Variables used for Wire EDM posts... 109
9.1.1.9 General Purpose (Misc.) variables ... 110
10. APPENDIX B - LIST OF “RETIRED” FUNCTIONS... 112
11. APPENDIX C - APT-CL RECORDS RECOGNIZED... 113
CL records IGNORED by PostHaste: ... 113
CL records recognized by PostHaste:... 114
12. APPENDIX D - HANDLING ROTARY AXES... 116
Definitions: ... 116
12.2 Where do the actual rotary angle values come from?... 116
12.2.1 MULTAX data... 116
12.2.2 Coordinate system (CS or CSYS) data ... 117
12.2.3 TLAXIS record data... 117
TLAxisEnabled? switch... 118
12.2.4 ROTATE, ROTHED or ROTABL records ... 118
The VertCSame? switch... 118
1. PostHASTE Basics
PostHASTE is basically a translator that reads CL (“Cutter Location”) tool path data and outputs it according to a formatting template that you can easily modify.
PostHASTE operates quite simply - it usually only prompts you for two things... - the CL file to open and
- (optionally) which machine format file you want to use.
...PostHASTE will then generate the NC program and save it according to the information you enter in response to the prompts.
This manual discusses how to modify the format templates to suit your needs.
1.1 How PostHaste works
PostHaste gets all of the configuration information for each machine from a format template file. (In the context of this manual, we will refer to it as either simply the format or the template.)
All you have to do to change a machine program format is to modify the contents of the corresponding template file. This can be done easily with any word processor or text editor.
The primary purpose of this manual is to explain how to modify the template(s) to achieve the desired output for 3 and 4 axis milling and 2 axis lathes. (Other instruction manuals are available for Mill-Turn machines [that is, lathes with live tooling] and 5 axis milling machines.)
1.2 Template file extension naming conventions
We recommend using the file name extensions (the three characters that typically follow the period in a file name) in the chart below to differentiate between format files for various types of machines.
The numbers in the extensions indicates the number of supported axes.
Extension(s) Machine type(s)
.pM2 to .pM5 Milling (2 axis to 5 axis machines)
.pT2 to .pT4 Turning (Lathes) - 2 to 4 axis
.pU2 to .pU5 mUltifunction (Mill-Turn) machines - 2 to 5 axis. .pL2 to .pL5 Laser...
.pF2... Flame or plasma
.pP2... Punch presses
.pE2 wire EDM
2. Format templates - the basics
This section will familiarize you with the overall structure of the format file.We highly recommend that while reading the following information, that you also load a format template file into the editor of your choice so you can follow along on your screen.
2.1 Overall structure of the template file
Now, all of the formatting information that PostHASTE requires is placed in the format template file in these 4 basic areas:
1. The NAME line
2. The address (letter) formats 3. Commands and switches 4. The “Sequences”
The following four sections briefly describe what these do Please take a look at a template file (on your screen) while you read the following; doing this will greatly help you get a good idea of how the template file works.
First - the NAME line
When you edit a template file, you will notice that the word NAME is the first thing in the format. The
NAME line starts the description of each machine format. Without a NAME line, you don't have a
format. Sorry - that's just the way it is.
After the required NAME line, the remainder of the template can be broken into 3 sections (as described in brief below). These 3 sections look basically the same from one machine format to the next, so the easiest way to create a new NC code format is to copy an existing machine format template, then alter it to fit your needs.
The address (letter) formats
This lists the letters that can be used in your format - in the order that they will appear in the lines of
machine program code - and the exact formatting of the numerical values that accompany each letter.
Here's an excerpt from the letter format section of a Fanuc template:
O >4 O can be up to 4 digits, no decimal. N >4
G >2 G can be up to 2 digits, no decimal.
X ->3.>4 X can have minus sign, up to 3 before, up to 4 after decimal. Y ->3.>4
Commands and 'Switches'
After the letter formats, there is typically a page or two full of commands such as...
ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85
Sequence#s N 0 1 1 Char, Freq, Increment, Start HCode X
VCode Y FeedCode F
Spaces? Y Spaces between words?
...Commands like the above tell the post basic information that is used commonly in many areas of the final machine program. (You may see section 4.1 to learn more about all of the available commands and
switches.)
Basic rules regarding commands
PostHaste expects to find the commands and switches written in a particular way; therefore any
modifications that you make to the file must be done in STRICT ADHERENCE to the rules outlined here. As you have already seen (on the NAME line); this is the kind of structure that PostHASTE expects to find in the format:
- a command word (such as “name”), then
- a SINGLE SPACE (to separate the word from the following instructions), then
- the parameters (letters, numbers or other specific words) pertaining to that particular command. If there is more than one parameter, then the parameters are always separated by a single space. Note: As you will see below, you must always be careful to not use more than one space between parameters. If you do, then you will turn the remainder of the line into a 'comment' that PostHaste will ignore.
The “Sequences”
The sequences describe where all of the words (letters and numbers) appear in the final program. They look similar to an NC program, as these sequences show:
StartCode O[Program#] G90 End 1stToolChange N[Block] T[Tool] M6 G0 G40 G80 G[Work] X[H] Y[V]
G43 Z[D] H[Lcomp] M[Direct] S[Speed] M[Cool]
End Drill
G81 X[H] Y[V] Z[D] R[RLevel] F[FRate] F. in, R. out. end cancel
G80 end ... EndCode G28 G49 Z0 S100 G28 G91 X0 Y0 T[Tool1] M6 G90 M30 End
There are sequences to describe every portion of a finished machine program. You can get more information on sequences in section 5.
Please note that again, all of the words in the sequences must be separated by a single space.
2.1.1
Comments in the format
NOTE: PostHaste will IGNORE ANYTHING ON THE LINE THAT HAS 2 OR MORE
ADJACENT SPACES BEFORE IT - this allows you to put comments in the file in either of these 2 easy ways:
1. Simply move the cursor a few spaces past the end of a command line, then type your comment.
2. Type any comment on its own line - just make sure that the line has some leading spaces.
We HIGHLY recommend that you make liberal use of comments! They take only a few
seconds to write, but could save you many minutes (or hours!) of frustration later when you need to make changes to your format!
CAUTION: BE CAREFUL NOT TO ACCIDENTALLY “COMMENT OUT” part of the actual
3. The Letter Formats
This is a series of lines that each start with a specific character (usually a letter) followed by some numbers and signs. This is a list of all of the characters that your NC machine needs (and in the order that they will appear on any line of NC code). Add, change and/or delete letters and/or instructions so that they are arranged in the order that they appear in a line of NC code and are formatted according to the following information (if you look at the templates you will see something like these).
Helpful hint: When reading the letter formats, the arrow (>) means “up to”.
/ 00 % 00
“00” (“No digits before the decimal, no decimal, then no digits after”) is the format for any character that you wish to appear by itself (that is, with no numbers) - which makes it perfect for describing the percent sign (%) or “block delete” (/) characters, as it does in these examples.
N >4 N address: (NO - sign allowed,) up to 4 characters (no decimal).
X ->3.>4 X address: - sign allowed, up to 3 places before the decimal, a decimal, then up to 4 digits after.
F >32 F address: (NO - sign allowed,) up to 3 places before the decimal, (NO decimal,) then 2 digits after. The post will add trailing zeros; thus a F value of -2.0 will be output as F200
G 2 G address: always 2 digits; a G value of 0 will be output as G00
R +->24 R address: + sign is mandatory (unless the value is negative, in which case the '-' will appear), up to 2 places before the (invisible) decimal, then 4 after (adds trailing 0s such that an R value of 1.5 becomes R+15000).
You can see that the formatting options above gives you a lot of flexibility and are relatively self-explanatory.
(Note: The examples above do not show any of the “advanced character formatting” that can be done - as detailed in section 3.1.)
NOTE: You can also format lower case letters. PostHaste will accept characters with ASCII values
between 33 (!) and 122 (z). (The exclamation point [!] is a special case - read about it below in the section entitled “Suppressing line numbers and outputting blank lines” - section 7.1.)
The “maximum” possible letter format is something like this:
? C__ S_ +->_.>_ x
...where the “?” is the character (usually a letter) to be formatted, the “blanks" (_) can be any numeral, and the “x” is an optional character (or a set of empty quotes, like “”. Empty quotes here suppresses the output of the letter altogether. See section 3.1 [Advanced letter formatting] for more on this.)
Here's what each of the characters in the formatting lines do:
C__ (the COLUMN number used only for columnar programs -see examples later)
The number following the C notes the Column number at which this word starts. Note that there is a space after the number to separate this information from the next part of the line. (Note: There are special
commands [Spaces and Dummy] that are needed for columnar style programs - read about them in section 4.3: Commands and Switches.)
S_ (the “Spaces” number - used only for columnar programs - see examples later)
The numeral after the S determines how many spaces this word will take in the NC block. (Note: There are special commands [Spaces and Dummy] that are needed for columnar style programs - read about them in section 4.3: Commands and Switches.)
+ (the plus sign)
This causes PostHaste to output a + sign on the number if it is not negative. It must be the first formatting character in this line of your file if used at all.
- (the minus sign)
As would be expected, this causes PostHaste to output a - (“minus”) sign on the number if it IS negative. It must be the next formatting character if a - sign is ever to be used for this character address.
> (the “up to...” sign)
This (actually the “greater than” sign) is supposed to be an arrow that means that the number of digits before the decimal point can be “up to N places” (where the N is the next number on the format line
[explained below]) and causes NO LEADING ZEROS TO BE OUTPUT in this address. IF THIS ARROW IS LEFT OUT, THEN THE POST WILL ADD LEADING 0s so that the number of digits before the decimal will always be the following number...
A numeral (in the above example the number: 3)
If the above “up to” arrow is used then this is the MAXIMUM number of digits that may appear before the decimal point.
If the above “up to” arrow is NOT used then this is the number of digits that will ALWAYS appear before the decimal point.
. (a decimal point)
The presence of the decimal point in the line here will indicate that this address requires a decimal point. Conversely; if this character is absent, then it will not be output in the NC code. You can also use
COMMAS (,) instead of decimal points - this is common for use with European machine tools.
> (the “up to...” sign [again])
Just like above; this arrow means that the number of digits AFTER the decimal point can be “up to N places” (where the N is the next number on the format line [explained below]) and causes NO TRAILING ZEROS TO BE OUTPUT in this address. IF THIS ARROW IS LEFT OUT, THEN THE POST WILL ADD TRAILING 0s so that the number of digits after the decimal will always be the following number...
A number (in the above example the number: 4)
This is always a single digit that indicates the number of digits available AFTER the decimal point: If the above “up to” arrow is used then this is the MAXIMUM number of digits that may appear after the decimal point.
If the above “up to” arrow is NOT used then this is the number of digits that will ALWAYS appear after the decimal point.
x - the OUTPUT character.
If for any reason you wish to have a letter placed in the NC program INSTEAD of the one that is actually described by the formats, you may place this letter here. This comes in handy when for instance, the same letter must be formatted differently when it is used in different places. Case in point is the Bridgeport milling control: any negative Z value with a minus (like “Z-1.5”) is usually BELOW the Z0 point, but in the case of drilling cycles, no minus sign is required for the Z! Here are the lines that you can put in your format to accommodate this condition:
Put these 2 lines in the “letter formats” section:
Z ->3.>4 A >3.>4 Z
A canned cycle description should look like this:
G81 X[H] Y[V] A[D] F[FRate] |
In this case a normally unused letter (A) is called in the drilling cycles, but the format line of the letter A ends with “ Z” so that a Z will actually come out in the NC code. It will also appear WITHOUT a minus sign (because of the absence of the “-“ in the “A” format line).
In other words, the post formats for A, but outputs a Z. This is only one example of how this can be used; the possibilities are endless!
The OUTPUT character for COLUMNAR style programs:
This output character designation works slightly differently when you are formatting a COLUMNAR style program (remember as mentioned above; the SPACES line designates a format as columnar); IF NO OUTPUT CHARACTER IS SPECIFIED, THEN A SPACE WILL BE OUTPUT IN PLACE OF THE LETTER INSTEAD OF THE LETTER ISTELF. (That's why in the examples above the T is repeated at the end of the T format line, and also why the note for the K address says that no letter will appear in the NC program; because there is no K repeated at the end of the format line.)
Note: There are special commands [Spaces and Dummy] that are needed for columnar style programs -read about them in section 4.3: Commands and Switches.
3.1 Advanced letter formatting
In addition to the “basic” formatting options described above, there are some other things you can add to the end of a letter format line to achieve many other operations. Here is a list of them:
3.1.1
Suppression of a letter (“numbers only” output)
You can suppress the output of a letter by putting a set of empty quotes after the letter format (where you would usually place the “output character”). For example, this line could be used to put “Line numbers” in the program without the “N” preceding them:
N >4 ''
This would cause the resulting program to look like this: instead of this:
1 O12 N1 O12
2 G0 G28 X0 Y0 Z0 N2 G0 G28 X0 Y0 Z0
3 T1 M6 N3 T1 M6
3.1.2
Letter format modifiers
Letter formats can also have specific modifiers assigned to them for the purpose of Limit checking, conversion factors (MODulo, SUBtraction, MULTiplication and/or ADDition by any value[s]), Modal and Force attributes (read below) and 2 different types of “Incremental” designation: INC and IncFrom. These modifiers can simply be appended to the end of any “Letter format” line (as shown in the various examples in the discussion below).
Note: - You can ADD or MULT by a LETTER, not just a number. We had originally planned to let you ADD or MULT a variable, but this way is much better because the letter you add or mult can be assigned to different variables at different times (and in turn, even IT can be made incremental, and have any other letter added, multed... etc), so it is infinitely more flexible.
This is a quick list of how they work (the “_” in the headings below represents a number or letter that the modifier requires):
Add __
Follow ADD with any number or variable that you want to add to the initial word value. The example below adds .1 to all Z values:
Z ->3.>4 Add .1
As you might suspect, negative numbers can be used to effectively “subtract” a number from a particular word - in this case we're now subtracting .1 from the Z values:
Z ->3.>4 Add -.1
You can use the Add option to add variables as well as numbers to your program values. This is handy for using on some milling machines that require that the RLevel value be added to the Z value for drilling. Just assign a substitute letter to be used to output the drilling Z and add the RLevel variable like this:
Although you can easily add variables to your values, you can't subtract them in this way because the post won't recognize “-[RLevel]”. To handle this problem, we've given you the Sub modifier below...
DivBy _ and DivInto _
These are modifiers that allow you to use division in 2 different ways: - DivBy _
...divides the letter's value by some other number or variable before outputting. If you want to divide the letter's value BY some number or variable, then use DivBy. The following example will divide all X values by 2:
X ->3.>4 DivBy 2
...Resulting in the code "X12." being output as "X6.0" - DivInto _
...divides the number or variable following DivInto into the letter's value before outputting it. As an example, to output the pitch on a tapping cycle you would format the letter to return the RECIPROCAL of the [Step] value by dividing the value INTO 1 (e.g. "1/pitch") like this...
Q ->3.>4 DivInto 1
...then simply use Q[Step] in the TAP sequence. This would result in "Q20." being output for a 1/4-20 tap, for instance.
___
Like all letter math modifiers, DivInto and DivBy...
- can be followed by numerical constants, other variables or other letters.
- should NOT be used on N (line) numbers. (You can get around this to SOME extent by adding the line "each N[Block]" to your format...)
If the use of either of these modifiers results in an attempted "division by zero", then... - the user will be warned
- the letter value will be left 'unmodified' (the division will not take place), and - the post will continue.
Force
Always forces the appearance of the word (or just the letter if used in conjunction with MODAL.)
Example: This is used commonly in Heidenhain conversational formats, where a particular letter (such as
'R') must appear (by itself) on every line, but a number only appears when the value has changed.
Inc
The value of this word will be output as an increment from its last absolute value. (Last abs. value is subtracted.) Example:
X ->3.>4 Inc
IncFrom _
Specifies another letter: The LAST absolute value of THAT letter will be subtracted from the value of this word.
Example: Some controls require that the Z value for drilling be measured incrementally from the R value.
In those cases, use this format:
z ->3.>4 Z IncFrom R
(NOTE: In this case, make sure that the R is processed BEFORE the z, otherwise the Z output will be incremental from the LAST value of R instead of the current value.)
Limit __ __
Follow this with 2 numbers: the minimum and maximum limits. A warning message will appear if the tool motion file causes the letter to be outside the specified range. When the warning message appears, the user will have the option to continue or abort. (If the user chooses to continue, the 'bad' number WILL appear in the output.)
Note: A single letter may not be formatted using Limit and Clamp. You may only use one of these on each letter format.
Clamp __ __
Similar to Limit above, follow this with 2 numbers to indicate the minimum and maximum allowable values of the letter being formatted. Unlike the Limit action, the post will not output a warning, but it will 'clamp' the output value so that numbers larger than the 'upper clamp' value will be output AS the 'upper clamp' value. Likewise; values smaller than the lower clamp value will be output AS the lower value. Examples:
The number would normally be output
this way,
but the letter is formatted
like this, ...so it actually appearsin the code like this: Why?
F9523.4 F >4.>3 Clamp 1 8000 F8000.0
Because it is over the upper limit (8000), it is output as F8000.
S22 S >4 Clamp 50 9000 S50
It is below the lower limit (50) so it is output as S50.
This is especially helpful when formatting the feed rate letter (especially if used for 'inverse time feed rate', where very short movements can produce very large F values).
Note: A single letter may not be formatted using Limit and Clamp. You may only use one of these on each letter.
Mod __
This is the mathematical modulo function which returns the 'remainder' of a division operation. This is used commonly for machines that have a rotary axis with a 'numerical limit' of 360, but can be used for other things as well.
Here are simple examples that show how the Mod function affects the output of various values: 0 mod 360 = 0 1 mod 360 = 1 320 mod 360 = 320 360 mod 360 = 0 361 mod 360 = 1 410.03 mod 360 = 50.03 720 mod 360 = 0 725 mod 360 = 5 -45 mod 360 = -45 -360 mod 360 = 0 -363.41 mod 360 = -3.41 ...etc.
(Please note that the Mod function also works the same regardless of whether the incoming value is a positive and negative numbers.)
Here is an example of how to use the Mod modifier in your template:
To format the letter A properly for a 4 axis mill to get this output (when the rotary table keeps turning the same direction as it approaches, then continues past the '360 degree' boundary)...
... X.1 A-356.0 X.2 A-358.0 X.3 A0.0 X.4 A-2.0 X.5 A-4.0 ...
... use the 'modulo' function on the letter A like this:
A ->3.>3 Mod 360
Modal
Causes a word to be suppressed (not output at all) unless its value has actually changed since the last time the letter was output.
(Note: This has exactly the same effect as listing the letter in the ModalLetters command line. See section 4.1.24 for information on the ModalLetters command.)
Mult __
Just like the Add modifier, follow MULT with any number or variable that you would like to multiply by the initial word value. This example “doubles” the X value by multiplying by 2:
X ->3.>4 Mult 2
For example, the sign of a number can be reversed by multiplying it by -1 like the letter X shown here:
Also, the mult modifier can be used to “divide” a number by using the reciprocal of that number. For instance, a number can be “divided by 2” by simply “multiplying by 1/2” like this:
X ->3.>4 Mult .5
No-Opt
Code "zero optimization" can be overridden with the No-Opt modifier.
By default, when the post outputs a "0" value along with "floating point" words (such as "X ->3.>4"), it suppresses the decimal point so that the output appears as "X0" instead of "X0." . This can save a significant amount of code in a long program. If, however, you want to prevent this optimization from taking place, you can add the "No-Opt" modifier onto any letter in the letter format section like this:
X ->3.>4 No-Opt
This will cause a zero value to be output as "X0.".
(Remember, upper or lower case doesn't matter on the modifiers.)
Sub __
As you would expect, follow Sub with any number or variable that you want to SUBTRACT from the initial word value. The example below subtracts 1.5 from all X values:
X ->3.>4 Sub 1.5
Even though you could do the same thing by Adding “1.5”, you can't use the Add to subtract variables -that's why we've given you the Sub option. Here's how we could subtract the RLevel variable from the Z value (if we wanted to):
Z ->3.>4 Sub [RLevel]
(Remember to use [brackets] when specifying variables.)
One of the nicest by-products of this modifier is the ability to make any letter's value "incremental" from any other variable. For example, if we wanted the letter W to be output incremental from the current X (horizontal position) value, we could format it in this way :
W ->3.>4 Sub [H]
3.1.3
How Letter Format Modifiers are used together
Sometimes, you must use more than one modifier to get the results you want. As an example...
Giving the MODAL modifier will prevent PostHaste from repeating the same values on later lines if the value of that letter has not changed. Some conversational machines require the letter to be output by itself (without the numerical value) if the value has not changed, such as the “R F M” required on all moves by the Heidenhain conversational format. In these cases, add the FORCE parameter AND the MODAL parameter (the order does not matter) like this:
X >3,>4
R >2 Modal Force F >31 Modal Force M >2 Modal Force
Notice that no “Modal” modifier need be given to X. This is because the post assumes that certain codes (including the HCode, VCode, DCode, and FeedCode - usually X, Y, Z, and F) are modal. If you want any of them NOT to be modal, then add a “ModalLetters” line (somewhere after the letter formats) to change the default “modality” of these (and any other) letters. Read more about the ModalLetters command below. Any letter(s) can be designated as incremental simply by using the INC modifier. For example, the
following letter formats tell the post to output only the Z axis movements as incremental, while outputting absolute X and Y values:
N >4 G >2 X ->3.>4 Y ->3.>4 Z ->3.>4 Inc I ->3.>4 ...
The sample formatting lines below could be used for a Bridgeport milling post set up to output in Metric mode from American (SAE) dimensioned geometry. For metric, we simply multiply the X,Y, and Z values by 25.4 (the “inch-to-metric” conversion factor).
Furthermore, the 2 lines below allow 2 different “Z” formats: one that allows negative numbers (for contour milling), and another used for drilling. Z values used in drilling (“canned”) cycles on a Bridgeport machine can have no minus sign, and are measured incrementally down from the RLevel point. So, we have a normal Z format line for contour milling, and we also format another letter (in this case “A”) to output a non-signed incremental Z value with 2.54 mm ADDed to compensate for a .1” RLevel level. (If a different vertical clearance value is used when designing the tool motion, then you must change this value to match. For example, if you used .05” for the “rapid down” clearance, then use 1.27mm as the “additive” in the post.)
The “Limit” values used in these examples are arbitrary - your machine may be quite different.
Z ->3.>4 Limit -150 125 Mult 25.4
A >3.>4 Z Limit 0 150 Mult 25.4 IncFrom Z
| |
Notice: any “output letter” used Use “IncFrom” to indicate MUST follow the numeric formatting letters measured incrementally BEFORE Mult, Add, Limit and/or Inc. from another letter.
After the “output letter”, the order of the rest of the modifiers (Mult, Add, Modal, Force, Limit, IncFrom and Inc) makes no difference. For example, formatting the “secondary Z” using the line below would result in exactly the same NC program, even though the modifiers are in a completely different order:
A >3.>4 Z IncFrom Z Mult 25.4 Limit 0 150 |
Notice: again, the “output letter” (Z) is BEFORE the modifiers.
Hierarchy of Modifiers:
There is a hierarchy to the order in which the numerical functions (Mult, DivBy, DivInto, Add, Sub,
Mod, Inc, IncFrom and IncSign) and Limit checks are performed (regardless of the order they are placed
in the format):
- First, the original value is multiplied by the multiplier, - DivBy or DivInto are applied next,
- modulo is then applied (to the total so far)
- the result is then checked against the limit values.*
- Next, the result is converted to incremental (if Inc or IncFrom is present) - finally, the sign ( + or - ) of the resulting value is altered by IncSign.
* Note that the limit is checked before the value is made incremental. This has the effect of checking the original “absolute” value (not the resulting incremental value) against the limits.
Notes re “LIMIT checking”:
• Limits are not checked on phrases that are the result of a “Replace” statement. In other words, if you inadvertently replace a phrase with another that is beyond a limit, then no warning will appear.
• Limit values are Absolute! In other words, even if the letter is incremental, PostHaste will keep track of the absolute value of the letter, and warn if the absolute position values indicated by the “Limit”
parameter have been exceeded.
Regarding IncFrom:
Always remember (as mentioned in the discussion above) that the value of any word modified by INCFROM is affected by the CURRENT value of the “IncFrom” letter. This means that if a letter is incremental from another letter on the same line of code, THE “INCFROM” LETTER (Z in the examples here) SHOULD BE CALLED FIRST! This means that, of the 2 sample lines below, ONLY THE SECOND WOULD PRODUCE THE PROPER RESULT. This is because PostHaste processes the words in the order they appear * on the line. So in the first line below, it gets to the A value BEFORE the Z has been set to the RLevel value, so in this case the A value would be output as measured incrementally from whatever the Z value was BEFORE this line was processed.
Wrong: G81 X[H] Y[V] A[D] Z[RLevel] F[FRate] Right: G81 X[H] Y[V] Z[RLevel] A[D] F[FRate]
* Remember that the order that the words appear in the sequences does NOT control the order that they appear in the resulting code: that is determined by the order the letters are listed in the “letter format” section of the Template.
4. Commands and 'Switches'
Commands and “switches” are used by PostHaste to describe certain aspects of the code for your machine. These commands and switches are usually placed in the template after the letter format section and before the sequences. These are all explained in detail in this section of the manual.
Note: There are also other commands that are used only inside of sequences; those are not discussed here – see section 5.3 for those.
What's a Switch?
Any word that you see in the templates followed by a question mark (such as RevTurret2? or First#?) are called “switches” because they refer to various code conditions that can be turned on or off with a “YES or NO”. This is done simply by placing a Y or N after that switch. Watch for switches in the descriptions below.
4.1 List of Commands and Switches
(the ones that are not used inside sequences)
Note: See section 5.3 for commands that are used only inside of sequences.
In the format template, any of the needed commands or switches should be listed AFTER the letter formatting section, and BEFORE the first sequence. The order in which they are listed in your format is usually not important. (Any exceptions to this will be noted in the corresponding sections below.)
We have listed all of the commands and switches in this section in alphabetical order, except for...
...commands and switches relating to the following topics, which are discussed in the sections noted here:
Topic: Discussed in section:
Arcs 4.2
Columnar style formats 4.3
Subprograms (or Subroutines) 7.6
4.1.1 Ask
Use of this command allows you to have PostHaste ask you a question when it runs - the number you type in response to the question then sets the value of any variable you choose. Any variable can be used, but care must be taken to not overwrite a variable that has been set from the tool motion file (unless, of course, that is what you really want to do).
Here's a simple example that changes the output at the end of your program from an M30 to an M99, based on the value that the post asks you:
Ask [Val1] 'Enter 30 for a main program, 99 for a sub.' '30' EndCode
M[Val1] (Outputs M30 for main program or M99 for a sub.) End
The three parameters after the “Ask” are...
- The variable to set (Remember, there are 20 “unused” variables named Val1 to Val20 that you can use that are not normally set from an incoming tool motion file).
- the first quoted phrase specifies the exact wording of the prompt. - the second quoted phrase specifies the default answer.
The variable can then be used later in any sequence portion of the format to output a numerical value with any letter.
Here are some examples of how you may use ASK in the template. First, you place any needed ASK statement(s) in your template like this:
Ask [Val2] 'What is X CLEARANCE diameter for cut off?' '4.5' Ask [Val3] 'Cut off Spindle Speed:' '200'
Ask [Val1] 'What is Z value for cut off?' '-3'
Then, you access the “asked” variable(s) in a Sequence, as in this example of an automated “cutoff” cycle in the ENDCODE section of a lathe format:
EndCode
G0 Z.2 { Rapid to tool change position } G28 U0 W0 M9 T[LastTool] { Cancel Offset for LAST tool. } /0 M0
G50 X0 Z0 T1200 M[Cool]
G96 S[Val3] M[Direct] { Val3 is Cut off Spin. Speed G0 Z[Val1] X[Val2] T1212 { Cut off Z,X: Val1,2
G1 X0 F.003
G0 X[Val2] { Clear to diam. G28 U0 W0 T1200
/0 M99 M30 End
When PostHaste runs, a prompt dialog (like the one pictured here) will appear for each “Ask” question. You can just press ENTER to use the optional default value (in this case
Warning:
Any time you add (what you think is) a 'new' variable to a post, make sure that that variable is NOT
being used for some other purpose in the post already! Before adding a new variable, ALWAYS do a
“Search” to make sure that you don't mistakenly re-use a variable that is being used for something else. Making this mistake can result in VERY strange output - and a big mess to “debug”!
How to make the Ask repeat
You can have PostHaste ask any question just once per run, or make it ask the question(s) every time a certain sequence is output. For instance, if you want a question to be asked every time a tool is changed
(for example), then simply place the Ask line(s) inside the ToolChange sequence. The same holds true for any sequence. This comes in handy, for instance when formatting for a wire EDM to ask the user for
different “burn” settings every time an INFEED (Cuttercomp application) move is made.
If you would like a particular question asked only once per run, then simply place the ASK line somewhere NOT within any sequence. (By the way, ASK lines are permissible within an IF structure.)
Whatever value the user enters in response to each question will become the value of the specified variable until that variable is ASKed again, or until that variable is reset by something in the incoming tool motion file. (Remember: if you use Val1 to Val20, then they normally won't be reset by incoming tool motion [unless they are placed on a Cycle or UponRec definition line].)
4.1.2 AskPeckClear?
Setting this switch to Y tells PostHaste ask you for the peck clearance ([PeckClear] variable) value. If your machine supports this parameter in its peck drilling cycle, then after each peck the tool will rapid down into the hole to this distance from the current bottom before it starts feeding in on each subsequent peck. If you set this switch to N, then PostHaste uses .050 as this value.
Note: if the Peck drilling sequence has “none” in it, the “longhand” peck drilling cycles will use this value in the discrete movements that are generated.
Instead of having the post ask you for this value, you may 'hard-code' a particular value into your tempate(s) by using a Set cd like this:
Set [PeckClear] to .03
4.1.3 ByDiameter?
(lathe only)
This is a “switch” that you may use for LATHE work to indicate how the vertical movements are
designated on your lathe. The X values on most lathes must be given as work DIAMETER, but some allow you to use RADIUS values. If yours uses DIAMETRIC X values, the put a Y (for YES) after ByDiameter like this:
ByDiameter? Y
If your lathe operates on RADIUS values for X then put N (for NO):
4.1.4 Comment
The Comment command indicates the character(s) that mark the beginning and end of 'comments' that the machine will display on the screen, but otherwise ignore. On most modern controls, comments must be enclosed in parentheses, so the Comment command will look like this:
Comment ( )
(Notice the spaces!) Some machines do NOT need a “end” comment character; in this case, just indicate the comment START character:
Comment '
(Machines that use only a “comment start” character will ignore anything in the block that starts with the comment character.)
Other machines may require more that a single character to start and end comments, like Heidenhain controls, which we can also format by using this Comments command:
Comment (MSG, )
If your machine does not accept comments at all, then you need to disable the Comment command line
(by either completely deleting it, or placing a few leading spaces in front of the line so that PostHaste ignores that line). Since the Comments command is what tells the post which characters to output before & after any comments, the post logic is set up such that if there ARE no comment characters, then the post will output no comments, so all comments (PPRINT records) found in the CL file will be ignored.
NOTE: Do NOT confuse the Comment command discussed above with the Comments command that is used inside of sequences (to tell the post exactly where to put the comments in the code). See section 5.3.2 for information on the Comments command.
4.1.5 Convert
This works very much like the Replace command – except that it works on incoming CL records – that is, before the CL data is processed by the post. There are many uses for this command – limited only by your imagination. Here are a few ways that we've used it:
- Convert 'unrecognized' CL records into something that will be usable by the post. Example:
Convert 'PIERCE / OFF' to 'RAPID'
- Delete unneeded words or phrases in the incoming CL records. Example:
Convert 'TOOL NAME : ' to ''
- Use Convert in conjunction with an UponRec sequence to process incoming records in a 'non-standard' way. Example:
Convert 'APPLY / LASER' to 'APPLY / 1' Set Val1 flag for laser, or.…. Convert 'APPLY / PUNCH' to 'APPLY / 0' Reset it to 0 for Punch mode. Uponrec Apply [Val1] Val1 = laser flag.
if [Val1] = 1
G25 e5 Replace 'e05' with '(LASER OFFSET)' !0 M44
!0 M45 endif end
- 'Un-comment' an incoming comment in the CL file so that you can actually use data that was stored in the CL file as a comment. Example:
Convert '$$-> CSYS' to 'CSYS'
You can use the Convert command multiple times.
NOTE: Like the Ignore command (below), Convert can be used either in the format template file, or in the PostHASTE.CFG file. (Put Convert commands in your .CFG file for CL records that you want all of your posts to use that same conversion, or put it in the template file[s] when you only want certain posts to perform the conversion.)
Note: In templates that use Convert and Ignore commands, the Convert operation will be performed before the Ignore command.
4.1.6 Coolant
Similarly to the Spindle command, the Coolant command is followed by the numerical values for the “M codes” for the various available coolant modes.
Examples:
For APT-CL versions of PostHaste:
Coolant 8 9 7 50 M values: On, Off, Mist*, Hi pressure (Thru) On
* Note: If no “mist” coolant option is available on your machine, then put in the same M value that you are using for flood [ON] coolant so that at least you will get coolant into the NC program if you mistakenly choose MIST instead of FLOOD in your CAM system.
4.1.6.1 Using [Cool] in an IF statement
The [Cool] variable can be used in an IF statement, but you have to test its "Ordinal" value (0,1,2,3 etc.),
not the "M" value (8, 9, 7, 88 etc.), as you might think at first glance.
We did this so you can see if ANY coolant is 'on' by testing like this:
IF [Cool] > 0 ...
The value of the [Cool] variable - in the context of an IF statement – is shown below:
• Flood = 1 ( If [Cool] = 1 ... ) * • Off = 0 ( If [Cool] = 0 ... etc. ) * • Mist = 2
• THRU or HIGH = 3
4.1.7 DComp
The 3 values following the DCOMP command correspond to the machine's three diameter offset directions: Left, Right, and Cancel, respectively.
DComp 41 42 40 Left, Right & Cancel G values
In a template that uses the above DComp line, the [Side] variable (usually used in an InFeed sequence like this: G[Side]) will return a 41 when the CL file has a CUTCOM / LEFT record active, and 42 when a CUTCOM / RIGHT record is active.
4.1.8 Drive
The Drive command specifies the folder and, optionally, the extension of the final NC code file. This allows you to route the NC code files for different machines into different directories with (optionally) different extensions. (If DRIVE is not used, the NC code file will end up in same folder as the incoming CL file, and it will have the default .NCC extension.)
If, for example, you would like to re-route the output into a different directory (in this case the C:\Acro-1 directory), then use the DRIVE line as follows:
Drive C:\Acro-1\ or Drive C:\ACRO-1\
NOTES:
- Make sure that you include the proper drive letter (in this case the "C:"). If you omit the drive letter, the AutoOpen feature will not work correctly.
- You can use 'network' drives if you like. (example: “S:” )
- Note that if you are specifying only the folder (not the extension), then the last character MUST be a backslash (\), because the post simply appends this parameter verbatim onto the front of the finished NC code file name (since file names must be separated from the folder name by a backslash).
You can also use the DRIVE parameter to specify a different file name extension, as in this example:
Drive C:\Acro-1\*.ABC
This will cause the file to be output with the .ABC extension instead of the default .NCC.
Another possibility is to put the NC code files for all of your different machines into the same directory, but use different file name extensions for each machine. You can do this by using the same path (folder) name in the Drive commands for each machine format, but specifying a different extension for each.
4.1.9 Each
Use this command when you want a certain code to be output on each line of your NC program. It can be followed by a letter or a variable as in these examples:
Each $0 or Each S[Speed]
4.1.10 EOB ('End Of Block' characters)
Use of the EOB (End of Block) command allows you to designate exactly what characters are output at the end of each line (block) of your NC program in place of the standard "Carriage Return" (CR) and Line Feed (LF) characters (ASCII values 13 and 10). This is done by listing the ASCII values of the desired characters after "EOB" (separated by spaces, as usual).
For example, if you want a semicolon (;) instead of the LF, then your EOB command will look like this:
EOB 13 59
...because 13 is the ASCII value of the CR and 59 is the semicolon character. You can have up to 20 numbers (ASCII characters) in your EOB "word".
4.1.11 EOF ('End Of File' characters)
Use this command in the same way as the EOB command above to designate any special "End of File" characters you would like. This comes in handy if you need to output non-standard characters that can't be easily formatted in the EndCode section.
Remember also that the last line of your program will include the standard CR,LF (unless you change it with EOB as mentioned earlier), so the actual characters at the end of your file will be the 'EOB' PLUS the EOF characters.
4.1.12 Feed and Rapid
The Feed and Rapid lines indicate the exact letter and numerical value that cause the machine to start moving in 'feed' and 'rapid' modes, respectively. In the templates you will see a line that says:
Feed G1
That's because on the machines we use here a G1 indicates that a move at the specified feed rate is going to be programmed in this block.
Likewise, the line...
Rapid G0
...describes the NC word that causes a rapid move to take place.
Some machines do use G1 for ALL linear moves (regardless of 'feed' or 'rapid' mode) and simply use a high feed rate to move the machine in 'rapid' mode, so you could use something like this if you want:
Rapid G1 F1000
(Note: as of this writing, the Rapid line will accept two words [as shown immediately above], but the Feed line accepts only one.)
4.1.13 FeedType
This line lists the letter and the possible values of the NC word that indicates the type of value that will control the spindle speed: RPM and CSS (constant surface speed). The most common format for this is...
FeedType G 95 94 93 ( Val's for IPR, IPM, 'Inverse time' )
“Inverse time” is normally used only with 4-axis versions of the milling post-processor: it changes the feed rate (usually F) code to output the reciprocal of the number of seconds required to complete the current movement.
4.1.14 First#?
This switch indicates whether or no you want a Sequence (block) number on the 1st line of your program. If you do, then follow FIRST#? with a Y (YES). If not, then use N (NO).
4.1.15 HCode, VCode, DCode and FeedCode
These commands are followed by the CHARACTER that corresponds to their function (the H, V, and D in the 1st 3 commands stand for Horizontal, Vertical, and Depth, respectively). For standard milling, these characters are almost always X, Y, Z, and F. For standard turning work: HCode is Z, VCode is X, and the FeedCode is usually F (DCode [depth] is not used for turning).
4.1.16 HCode2, VCode2, and DCode2
Just like the HCode, VCode, and DCode designations, these allow you to designate the letters used (for 2-turret lathes only) to indicate movements of the 2nd turret (in the case that they are different from the letters used for the 1st turret). For instance, the Fanuc/Miyano lathe (with the drilling axis) uses a B for all
movements of the drilling axis, so we put the following line in our format template (and make sure in the CAM system that all drilling is done on turret # 2):
HCode2 B
Then (when using turret number 2) PostHaste will automatically use output B instead of Z. (Make sure you add the letter you use to the list of letter formats.)
NOTE: The RevTurret2? switch can be used to automatically reverse the sign of X axis value. Read about it in section 4.1.30
4.1.17 Inc/Abs
This line indicates the letter and numerical values that set incremental or absolute programming mode on this NC machine. You should include the following line in your template:
Inc/Abs G 91 90
... so the post will be able to detect that you have switched output modes.
This is an absolute necessity if you want to include any absolute code (G90) in an incremental (G91) format program, and vice-versa.
Including a G91 or G90 word in any sequence (in formats using the “Inc/Abs G 91 90” line) will cause the output of the HCode, VCode, DCode, and Rotary axis code (the one preceding any reference to
[RotAngle]) to be output in an incremental or absolute fashion, respectively. You can also use the [IncMode] variable (read about this below) in place of the 90 or 91 to read and output the mode directly from the tool motion file like this: G[IncMode] .
4.1.18 Inch/MM
The two numbers following this parameter indicate the value of the letter that switches the machine into INCH and MM programming, respectively. These values will can be accessed in the sequences through use of the [UnitMode] variable. The post automatically assigns 70 or 71 to [UnitMode] - so you only need to use the "Inch/MM" line if you want different values. (Typically, a word like "G[Unitmode]" would be used in the StartCode sequence to set the units of measurement for the entire program.)
Inch/MM 70 71
4.1.19 Incremental?
Setting this switch to "Y" tells the post that when the post starts outputting the code, that you want it to be in incremental mode. The default mode of the post is "N". Be aware, however, that if you have codes within the sequences that change to absolute or incremental (usually G90 and G91), that those codes will cause the post to switch modes regardless of the "Incremental?" setting. See the "Inc/Abs" parameter for the actual incremental or absolute codes that have been specified in your template.
4.1.20 Ignore
This command can be used to tell the post to “ignore” certain records in the incoming CL file. Examples:
Ignore INTOL Ignore PITCH
You can use this command multiple times.
NOTE: Like the Convert command (above), Ignore can be used either in the format template file, or in the PostHASTE.CFG file. (Put Ignore commands in your .CFG file for CL records that you want all of your posts to ignore – put it in the template file[s] when you only want certain posts to ignore certain records.)
4.1.21 Leading0s?
Many older controls require a “leading zero” on numbers whose absolute value is less than 1 (for instance
X-0.5 as opposed to X-.5). For compatibility purposes, the default method of output for PostHaste is to add the leading zeroes. If you want to inhibit the leading zeros, then set this switch to N.
Note: this command is also helpful if you just want to produce somewhat more 'compact' code.
4.1.22 LocalOutput?
If the following 3 conditions exist, then you will need to use the LocalOutput? switch and set it to 'Y'
to tell the post to output your NC program so that all XYZ output is relative to the 'local' (current) coordinate system (CS or CSYS):
1. When you are posting for machines with rotary axes AND... 2. your CL files include CSYS (coordinate system) data, AND...
3. you are using work offsets (the [Work] variable - G54, G55, etc) to set a different origin location on each face of the part.
When CSYS data is being used to determine the rotary angles, then using this setting will cause the post to rotate and/or shift the incoming XYZ values as needed (which are stored in the CL file in 'world'
coordinate space) per the CSYS data from the CL file, so that the coordinates output to the NC program
will match the 'local' ([Work]) origin.
By default (if you do not have this switch in your template), it is the equivalent of 'LocalOutput? N', and all locations (regardless of rotary angle) will be output from the same origin. They will be rotated (only) about the center line of rotation - but not 'shifted' to match the CSYS.
NOTE: Since CSYS data is usually stored in CL files as a 'comment' like this...
$$-> CSYS / ..., ... , ...
... you must also include a Convert line in the template (or PostHaste.CFG file), to get rid of the comment marker (the '$$-> ') and enable the post to read the CSYS data from 'comment' lines in the CL file.
Example:
Convert '$$-> CSYS' to 'CSYS' LocalOutput? Y
Important! Make sure your [Work] numbers match!
If your post uses LocalOutput? Y, then you must make sure that each machining operation in your
CAM system has the proper [Work] number assigned to it! If your system has a place to assign work
offset numbers to each operation, then do so carefully - to make sure that you always assign the same work offset number to operations that are done on the same face. If your system does NOT have this capability, then you should set up the post to assign these numbers properly.
For example, Some CAM users cannot directly enter a Work/Fixture Offset (WFO) number directly in their CAM system, but they may want to set the work offset number according to the Coordinate System (CS) number, so when you change CSs, the post automatically outputs a matching G54, G55 etc. You may do so by including a Convert line and a matching Upon sequence in your template (you may put the Convert line in your PostHaste.CFG file to simplify your templates):
Convert '$$-> CS NUMBER' to 'WORK /' UponRec WORK [Work]
Add 53 to [Work] end
NOTE: the above example only works for cam systems that include this ‘commented’ cs record in the CL file!
This will assign G54 to CS number 1, G55 to CS number 2, etc.
(Note: In lieu of using the Upon WORK sequence above, you can instead format a special letter for use with [Work] (and add 53 to it in the 'letter format' section):
g >2 G Add 53 Format the letter...
...
Work g ...(don't forget your Work command!)...
... Index X Z[Ilevel]
X[H] Y[V] B[RotAngle] g[Work]+53 ...and make sure you use the proper letter.
... (Not only in Index, but wherever [Work] is used!)
4.1.23 ModalGs
This is simply a list of all of the G values that are “modal”: this means that any G code in this list will remain in effect (and not be repeated) until another G code from this list is output. This prevents, for instance, a G1 from being output on every line when there are consecutive linear moves. G values that should appear on this line are G codes for any “movement” commands: linear, rapid, circular, and “canned” cycle G values. Example:
ModalGs 0 1 2 3 73 74 80 81 82 83 84 85 86 87
4.1.24 ModalLetters
For most machines, certain letters are modal - that is, they are not output unless their value has changed. The letters that most machines allow to be modal are:
- the ones listed in the HCode, VCode, DCode, and FeedCode commands (Usually X, Y, Z, and F). - The one used in conjunction with the [RotAngle] variable (Usually A or B).
- The one used in conjunction with the [RLevel] variable (usually “R”) inside the canned cycle sequences (such as Drill, Peck, Tap, Ream, etc.)
If a different letter is used with RLevel in different cycles, then the LAST one listed in the format is the only one that will be repeated on secondary holes.
When any of the canned cycles mentioned above are defined in the normal way (as in the example below), PostHaste will output optimized code (the program with the least number of codes) for all points following the first one. For instance - if you define the Drill cycle this way...
Drill
G81 X[H] Y[V] Z[D] R[RLevel] F[Frate] end cancel
... then all points after the first (which will be on the G81 line) will only include the X, Y, Z and “RLevel” (usually “R”) words whose values have CHANGED - because all of these values are assumed to be modal (unless, of course, you override this with the method described above).
However, the modality of these (and other) letters can be set by using the ModalLetters command. For instance, if you do NOT want the “RLevel” value to be modal (therefore causing it to be output on every line of a standard canned cycle), use the “ModalLetters” list, and leave the “R” out of it as shown here:
ModalLetters X Y Z F
Or, if you want another letter to be output only when it has changed (Q, for example), it can be added to the ModalLetters line like this:
ModalLetters X Y Z F R Q
4.1.25 Notes: / EndOfNotes (or EndNotes)
These commands can be used to 'comment out' an entire section of your template. This is helpful when you want to...
- write a large amount of comments in your template, or
- temporarily disable a large amount of your template information. Example:
Notes:
The line above causes PostHaste to ignore all of these lines...
until the 'EndNotes' or 'EndOfNotes' word is found at the beginning of a line (like the line below).
EndOfNotes
You can use Notes: / EndOfNotes as many times as you would like in your templates, either inside or outside of sequences.
Notes:
• Don't forget the colon (:) following Notes: