PostHASTE for GibbsCAM 2005 - Format Reference Manual

April 3, 2017 | Author: IphoneicandiArt | Category: N/A
Share Embed Donate


Short Description

Download PostHASTE for GibbsCAM 2005 - Format Reference Manual...

Description

50408g

PostHASTE 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 3.

Comments in the format ...................................................................................................... 4

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

Force............................................................................................................................................................ 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.15

HCode, VCode, DCode and FeedCode........................................................................... 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.3

CtrCode............................................................................................................................. 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 4.3

MinArc .......................................................................................................................... 38

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

Additional sequences for special purposes......................................................................... 50

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 5.3

CallMe and Call (User-defined sequences and 'reusing' sequences) .................................. 61

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 5.3.5

NoEol and EOL................................................................................................................. 68

5.3.5.1 5.3.6

'File' usage example: Creating a 'tool list' at the top of the program. ....................... 67 EOL....................................................................................................................... 68

Set..................................................................................................................................... 69

5.3.6.1

Limitations of SET commands............................................................................... 70

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.2.1

Sub numbering ...................................................................................................... 87

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.1

[RotAngle] vs. [AAxis], [BAxis] and [CAxis] ............................................................... 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 13.

APPENDIX E - WHAT'S NEW WITH POSTHASTE AND THIS MANUAL? ............ 119

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) .pM2 to .pM5 .pT2 to .pT4 .pU2 to .pU5 .pL2 to .pL5 .pF2... .pP2... .pE2 .pW2...

Machine type(s) Milling (2 axis to 5 axis machines) Turning (Lathes) - 2 to 4 axis mUltifunction (Mill-Turn) machines - 2 to 5 axis. Laser... Flame or plasma Punch presses wire EDM Water jet

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 N G X Y

>4 >4 >2 ->3.>4 ->3.>4

O can be up to 4 digits, no decimal. G can be up to 2 digits, no decimal. X can have minus sign, up to 3 before, up to 4 after decimal.

When you're ready to learn all about letter formatting, see section 3.

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] end cancel Cancel

F. in, R. out.

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 formatting information by mistakenly entering 2 spaces in place of 1!

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 % N X F

00 >4 ->3.>4 >32

G 2 R +->24

“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 address: (NO - sign allowed,) up to 4 characters (no decimal). X address: - sign allowed, up to 3 places before the decimal, a decimal, then up to 4 digits after. 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 address: always 2 digits; a G value of 0 will be output as G00 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 selfexplanatory. (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: 1 O12 2 G0 G28 X0 Y0 Z0 3 T1 M6

3.1.2

instead of this: N1 O12 N2 G0 G28 X0 Y0 Z0 N3 T1 M6

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: C >3.>4 Z Add [RLevel]

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. R ->3.>4 Modal Force

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 appears in the code like this:

F9523.4

F >4.>3 Clamp 1 8000

F8000.0

S22

S >4 Clamp 50 9000

S50

Why? Because it is over the upper limit (8000), it is output as F8000. 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 X.2 X.3 X.4 X.5 ...

A-356.0 A-358.0 A0.0 A-2.0 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: X ->3.>4 Mult -1

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 R F M

>3,>4 >2 Modal Force >31 Modal Force >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 G X Y Z I

>4 >2 ->3.>4 ->3.>4 ->3.>4 Inc ->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 MUST follow the numeric formatting BEFORE Mult, Add, Limit and/or Inc.

Use “IncFrom” to indicate letters measured incrementally 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,

-

then addition and subtraction are performed,

-

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: Right:

G81 X[H] Y[V] A[D] Z[RLevel] F[FRate] 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 Columnar style formats Subprograms (or Subroutines) Commands that are used inside of sequences

4.2 4.3 7.6 5.3

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] End

(Outputs M30 for main program or M99 for a sub.)

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 G28 U0 W0 M9 T[LastTool] /0 M0 G50 X0 Z0 T1200 M[Cool] G96 S[Val3] M[Direct] G0 Z[Val1] X[Val2] T1212 G1 X0 F.003 G0 X[Val2] G28 U0 W0 T1200 /0 M99 M30 End

{ Rapid to tool change position } { Cancel Offset for LAST tool. }

{ Val3 is Cut off Spin. Speed { Cut off Z,X: Val1,2 { Clear to diam.

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 4.5), or enter any other number you wish.

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): ByDiameter? N

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' Convert 'APPLY / PUNCH' to 'APPLY / 0'

Set Val1 flag for laser, or.…. 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 2turret 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:



Either of the words EndOfNotes or EndNotes may be used – they are interchangeable.

4.1.26 Rename This command allows you to make up any name you want to use for any variable. (Some people call this capability "user-defined variables".) It is most commonly used to replace the names of the standard 'user' variables (Val1 to Val20) with names that are more descriptive. We commonly rename the 'Val...' variables because PostHaste never 'automatically' sets the [Val1] to [Val20] values from information coming in from the CL data - they are safe to use for any purpose you like without fear of interference by the CL data or PostHaste's internal workings. (However, you can also use Rename to 'override' the name of any other variable as well.) Here are some examples: Rename [Val9] to [ModeOfPreviousOp] Rename [Val20] to [DrillingHasAlreadyStarted] Rename [LComp] to [XMultiplier] ( 180 and CtrCode360

These two commands let you further optimize your NC programs by allowing you to indicate different "center codes" for 2 special cases for arcs: ones that are greater than 180 degrees, and "full circle" (360 degree) arcs. Just like the original CtrCode command, you can follow these commands with one, two, or three letters, and they work the same way. (See CtrCode above.) These commands come in handy when you want to optimize the code by using "R" wherever possible. The problem with most machines is that "R" can only be used for arcs with 180 or less degrees of sweep angle. Some machines allow the use of negative R values to indicate arcs of greater than 180 degree sweep, so for these machines you can use the CtrCode>180 command with a letter that has been formatted to be multiplied by -1 (see example below). However, not even these machines are able to complete a 360 degree arc (a full circle) using the R designation, so for these arcs we have to "relapse" into using I and J again That's what our CtrCode360 is for... In the "Letter format" section of the PostForm, we add the following line: r ->3.>4 R Mult -1

Used only for arcs > 180 degrees.

Then, typically farther down, we use these lines: CtrCode R CtrCode>180 r CtrCode360 I J

Arc-center words for Arcs 180 deg. "Full-circle" arc-center words

If only the CtrCode line is used (and the other two are not), then there is no distinction made between the 3 cases of arcs - they will all be output in the same way. This is fine if you want to use I and J as arc centers. As mentioned above in the discussion of CtrCode, if you like, you can simply use the "ByQuadrants? Y" option to simply break all arcs into 90 degrees or less sweep. This lets you avoid all these special cases, but may add to the length of the NC program by creating more lines of code to handle the additional arcs.

4.2.5

CtrIncremental?

The information after this command is only used if the “2 letter” codes (typically I and J [or for turning: I and K]) are used to indicate the center point of the arc. Put Y or N after the “CtrIncremental?” command to answer the question: “Does your machine measure the center of the arcs incrementally from the start point of the arc?”. IF YOU INDICATE “N”, THEN THE NUMERICAL VALUES OF THE 2 “CENTER” ADDRESSES WILL BE TAKEN AS ABSOLUTE FROM THE PROGRAM ORIGIN.

4.2.6

ByQuadrants?

Many NC machines do not give you the ability to program arcs of more than 90 degrees in a single block of code. This inability of the control requires that you program the circular moves “by quadrants” by breaking arcs at the quadrant boundaries. Thus to create a full circular move, you must program 1 block for each “quarter” of the arc (and even break it into 5 arcs if the starting point of the arc is not on a quadrant boundary!) If your machine has this limitation, then put a Y after the BYQUADRANTS? command. But if your machine allows full circle programming in 1 block, then indicate N.

4.2.7

Helical?

Unless otherwise indicated (with Helical? N ), the post assumes that your machine allows helical arc moves - which are typically nothing more than G2 or G3 blocks with a Z added such that the start and end points are at a different Z level. If the machine does NOT support helical interpolation, then add the following line to the template, and the post will break the helix into linear moves (using the chordal tolerance value indicated on the MaxRad line - so don't forget to add a MaxRad command too...): Helical? N

4.2.7.1

Helical arcs - Handling special cases

On helical arcs (as with all arcs), PostHaste's 'standard' arc processing only outputs 2 'center point' coordinates; the 2 letters that correspond to the arc's plane [ArcPlane] - typically I and J for arcs in the XY plane. (Note: even helical arcs have an implied plane - the plane perpendicular to the center line of the

helix.) If you need additional code on helical arcs (for example, the Siemens 2100 control requires a K value for helixes), this will require adding an ArcCode sequence to your template. The example below is an ArcCode sequence that will output a K value for the center (of ALL arcs) along with the standard I and J. ArcCode G[ArcDir] X[H] Y[V] Z[D] I[IVal] J[JVal] K[KVal] end

If you only want K values added when it's a HELICAL arc, then you can use an IF structure to only include the K if the startpoint Z doesn't match the endpoint Z: ArcCode if [LastD] [D] G[ArcDir] X[H] Y[V] Z[D] I[IVal] J[JVal] K[KVal] else G[ArcDir] X[H] Y[V] Z[D] I[IVal] J[JVal] endif end

(Adds K to helixes only.) (Non-helical arcs don't get K.)

....This could become more involved if you need to support other planes (G18, G19), and even more so if you need Helical arcs in the other planes... you may have to add some 'plane test' logic to your ArcCode like this: ArcCode if [ArcPlane] = 17 AND [D] [LastD] (XY Plane AND Helical.) ...(Code to output XY plane Helical arcs goes here)... EXIT 34 Q ->34 q >4 Q R ->3.>4 r ->3.>4 R Mult -1 ... AutoThread Automatic thread canned cycle G76 A[TParams] Q[VBite] R[VLeave] G76 X[V] Z[H] P[Depth] Q[Peck1] r[Taper] F[Frate] end

Note: Even though the NC machine requires a P number for TParams, in this example the TParams is assigned to the "A" letter address that is formatted to output the letter P. (This is done by including the line "A 60 P" in the letter formatting section of the template.) We did this in this case because the 2nd line of the format above also requires a P word (formatted for the [Depth] parameter), and it is NOT 6 digits there - so we have to have 2 different formats that output the 2 different P words.

Here's another example - this time, a single-line version used for some Fanuc controls and Haas lathes: AutoThread G76 X[V] Z[H] K[Depth] F[Frate] A60 End

Below is a 'quick reference' chart of the variables commonly used in AutoThread cycles. Variable

Significance to machine (Fanuc 10T):

[Chams] [Depth] [FRate] [Passes] [Peck1] [Pitch]

# of lead-out threads Total depth of thread (radius) thread lead # of finish (spring) passes. Depth of 1st pass The TPI value of the current thread. This is usually equivalent to “1/Lead”(Note – Pitch not usually used for metric threading.) Tool tip angle The # of ‘starts’ a thread has. Minimum pass depth: The passes get smaller and smaller until they reach this value, then they get no smaller. Differential of start diam. and end diam. (EndV-StartV) The ‘infeed angle’ of the thread – usually equivalent to the angle of the tip of the threading tool. 6 digit code containing 3 parameters; see explanation directly below. Finish stock: How much stock to leave before final pass(es)

[StartAng] [Starts] [Step] [Taper] [TipAng] [TParams] [VLeave]

[TParams] variable The [TParams] (Threading Parameters) variable is used in common "AutoThreading" (G76) cycles on Fanuc-style lathe controllers. It is usually output as a 6-digit "P" number that actually holds 3 different values that use 2 digits each. Some machines need it output with a different letter, but here's an example of how it's usually formatted for Fanuc 0T controls (among others): In an actual NC program, the A[TParams] word listed in the sequence above may end up looking like this: G76 P020360 ...

- The first 2 digits (02) indicates the number of finish passes ("spring passes") that are cut by the lathe after reaching the final thread depth. - The 2nd 2 digits (03) is the number of the "lead-out chamfer" threads. - The last 2 digits indicates the "Cutting infeed angle" in this case, "60". On some lathes, these last 2 digits can only be set to the following values: 80, 60, 55, 30, 29, or 00 (See a Fanuc Lathe manual for more details on the use of this word in your lathe threading NC programs.) "Individual" thread parameter variables available

The variables: [Passes], [Chams], and [TipAng] allow access to the individual values available in the [TParams] variable.

5.2.4.3

Index (used for machines with rotary axes)

For machines that have one or two rotary axes, this sequence dictates how the post outputs rapid moves that include rotary axis motion. This discussion addresses only machines with one rotary axis.* First of all, you may place an axis letter (usually X, but sometimes Y) following INDEX to indicate the "default" rotary table orientation (using an X means that the axis of rotation is parallel to the X axis.) IMPORTANT: Depending on which CAM system you're using, you may need to indicate the codes necessary to make sure the tool clears the workpiece, moves in X and Y while indexing the rotary axis, then moves the tool back down to the desired end point of the move. (Some CAM systems can output 'dangerous' rotary motions, so be very careful!) ... for machines with ONE rotary axis Machines that have a single rotary axis use the [RotAngle] variable. This example will generate code that cancels the length compensation (retracting the tool to “Z home” position) before rotating, then reapplies LComp afterwards: Index X G0 G49 G90 Z0 X[H] Y[V] A[RotAngle] G43 H[LComp] M[Cool] Z[D] End

...This one just lifts the tool to the “initial plane” level: Index X G0 Z[ILevel] X[H] Y[V] A[RotAngle] Z[D] End

...and this one creates a 'direct' 4-axis simultaneous rapid move. (Only use this if you are sure that the CL file contains ONLY “safe” indexing movements!!!): Index X G0 X[H] Y[V] Z[D] A[RotAngle] End Which letter should I use on my INDEX line? / Do I need the minus sign?

Note that in the examples above, the letter X is used on the INDEX line. You may use any one of these... Index Index Index Index

X XY Y-

...depending on which axis your rotary axis is parallel to, and which way it rotates. Most 'vertical' mills will use X or X-, most horizontal mills will use Y or Y-. (MillTurn machines will

*

For machines with 2 or more rotary axes, please see the manual entitled “Formatting 5 Axis Posts”

Adding the minus (-) will reverse the sign of the rotary angle. So, if you're getting “A-90.” when you want “A90.” (for example) then just add the minus sign. (...Or remove it if it's already there.)

INDEX definition when rotary axis on CAD model does not match machine orientation

The INDEX line will be different depending on whether the indexing axis of your CAD model actually matches the machine's rotary axis orientation. Here are the two different conditions that the post is set up to handle: •

Condition 1 - Model rotation axis matches machine rotation axis:

This is a standard condition (described above) where the CAD data is oriented to rotate about the X or Y axis, and your machine does also. In the standard cases, we use "Index Y" (or Y-) for typical Horizontal mills, or "Index X" (or X-) for Vertical mills, respectively. Remember that in the 'standard' cases, the "-" is added to the letter to reverse the sign of the rotary angles - which also effectively reverses the direction of most rotary tables. •

Condition 2 - Model rotation axis does NOT match the machine rotation axis:

This is sometimes done when the programmer wants to draw a complete tombstone in the CAD model sometimes they will lay it out so that the model is oriented to index (rotate) about the Z axis instead of the Y axis. In this case, we typically use an "Index Z Y-" sequence to tell the post that the incoming data is oriented to rotate around the Z axis while the machine actually rotates about the Y axis. Please note that the minus sign (-) on the Y does NOT work the same as it does in the standard setup (condition 1 above) - instead of reversing the sign of the rotary angle, in this case it indicates which direction the tool is coming from (in the CAD model) when the tombstone is in home (B0) position. In most cases, this will be from the "Y-" direction, so we use an Index definition like this: Index Z Y… end

NOTE - If you use Index Z Y (without the ‘-‘), the post will interpret B0 as being the side of the part towards the “Y+” direction, so the B angles will be different by 180 degrees. If you need B0 to be one of the other faces, then use the ADD modifier on the B letter format to add whatever additional angle you need (90, -90, etc.) to get the desired rotation, like this: B ->3.>3 Add 90 …

... for machines with TWO (or more) rotary axes The way that PostHaste formats multiple rotary axes is significantly different from machines with a single rotary axis. This topic is covered in a separate manual – the one entitled “Formatting 5 Axis Posts with the PostHASTE Postprocessor”. Please read about it there. 5.2.4.4

Stop

When a STOP record appears in the CL file, the Stop sequence is output. Here is a suggested layout for a Stop sequence: Stop Set [Val1] to [D] G0 G91 G28 Z0

SPINDL / RPM, 500.00, CLW 12 >FEDRAT / 100.00, IPM 13 >GOTO / 0.00, 0.471000, 0.500000 G70 G50 G19 H0 M9 T5 G0 G32 G40 G80 M5 M9 M6 S500 M3 G0 X0 Y0.471 M9 D5 G43 H5 Z0.5 14 >CYCLE / DRILL, DEPTH, 0.093000, IPM, 5.00, CLEAR, 0.10 15 >GOTO / 0.00, 0.471000, 0.400000 G81 F5. R0.5 Z-0.193 G98 G0 X0 Y0.471 16 >CYCLE / OFF G80 … … 64 >FEDRAT / 100.00, IPM 65 >GOTO / -1.00, 0.906000, 1.125000 G1 F100. Y0.906 66 >SPINDL / OFF 69 >LOADTL / 6 74 >SPINDL / RPM, 500.00, CLW

75 >FEDRAT / 300.00, IPM 76 >GOTO / -1.205000, 0.00, 0.800000 G70 G50 G19 H0 T6 G0 G32 G40 G80 M5 M9 M6S500 M3 G0 X-1.205 Y0 M9 D6 G43 H6 Z0.8 78 >CYCLE / BRKCHP, DEPTH, 0.137940, STEP, 0.030000, $ IPM, 1.00, CLEAR, 0.00, RETURN, 0.50, $ DWELL, 1.00, TIMES, 1 79 >GOTO / -1.205000, 0.00, 0.400000 G73 F1. Q0.03 D0.05 V-0.03 R0.4 Z-0.1379 G98 G0 X-1.205 Y0 80 >GOTO / -1.00, 0.471000, 0.400000 X-1. Y0.471 Z0.2621 81 >GOTO / 0.00, 0.471000, 0.400000 X0 … … 86 >GOTO / -1.00, -0.471000, 0.400000 X-1. 87 >CYCLE / OFF G80 88 >FEDRAT / 300.00, IPM 89 >GOTO / -1.00, -0.471000, 0.450000 G1 F300. Z0.45 90 >SPINDL / OFF 92 >FINI G31 M30

This file is overwritten each time you run the post, so if you want to save it, you will either have to rename it or move it to another folder. “F.Y.I.” - Looking at the beginning of this log file also tells you two important things about how PostHaste works: 1. The StartCode (in this case, the first 2 lines of NC code) is always generated before any CL data is read. 2. The 1stToolChange sequence is always “triggered” by the first GOTO in the CL data. Inhibiting the log file for faster processing. If you need to process long jobs, inhibiting the automatic generation of the .log file may help the post run slightly faster when processing. If you would like to inhibit this feature, add the following line to your PostHaste.CFG file: Logging? N

The “N” (no) tells the post to NOT create a PostHaste.LOG file. If this line is omitted (or if you use “Y”), then the post WILL create a PostHaste.LOG file (the equivalent of “Logging? Y”).

8. “Special Case” Tactics & Notes This section of the manual covers some tactics that you can use to achieve NC code output to match some special cases that we've come across over the years. This section is by no means an exhaustive reference of all the things you can achieve, because the only limits are your imagination. This section is meant to help stimulate your imagination by giving a few examples of how we've used some of the formatting “tools” in the GS post to overcome some specific formatting problems.

8.1 Concerning incremental / absolute output and the [IncMode] variable The [IncMode] variable gives you a great deal of control over how the absolute/incremental codes are placed in your NC programs. Instead of “hard coding” a G90 or G91 in any sequence, you can use G[IncMode] . The difference is that when the tool motion file that comes from the CAM program designates which parts of the tool motion are to be coded in incremental or absolute mode, PostHaste automatically places the corresponding G code in the location you've specified with G[IncMode]. For the [IncMode] variable to work, the following line MUST be present in the template: Inc/Abs G 91 90

( Inc first, then Abs. )

If you don't have it, PostHaste will warn you to add it before it will process the tool motion. You can use [IncMode] in any sequence. Here are 2 examples: ToolChange T[Tool] M6 G0 G[IncMode] X[H] Y[V] S[Speed] M[Direct] G[43] Z[D] H[LComp] End Sub O[Sub] G[IncMode] end

[----IncMode established at each tool change...

[----IncMode established at each sub.

Note: A G90 or G91 (according to the Inc/Abs line as formatted above) will automatically appear in the NC code whenever the mode is changed by information coming in from the tool motion file. This will NOT happen if the [IncMode] variable is used as the “trigger” variable for an UPON sequence - because the post expects you to have formatted your UPON sequence to handle it properly.

8.2 How to format “P1=” type codes. If you will recall, in the very first pages of the post-processor manual, it is clearly stated that PostHaste is designed to output NC code such that EVERY “word” of the code is “a letter followed by a number”. However, you can use the “replace” feature to overcome this limitation. Here's a good example of a case where this can be done. Some machines require drilling (and other) parameters to be output in a way that requires more than just “a letter followed by a number”. For example, look at this peck drilling cycle: G83 X1.0 Y2.0 P1=.5 P2=.25

( P1 is the hole bottom Z, P2 is peck increment. )

To output this, use the following lines to your template: Peck G83 X[H] Y[V] a[D] b[Step] end replace 'a' with 'P1=' replace 'b' with 'P2='

Of course, you must make sure that the letters “a” and “b” have been formatted in the “letter format” section of the file by using lines like these: a >3.>4 b >3.>4

As you can see, the “replace” feature is limited only by your imagination. To see it in intensive use, look at a “Heidenhain Conversational” format.

8.3 'Block deletes' on multi-part sub calls In multi-part programs, it is helpful to have 'block delete' (/) characters on all sub calls except the ones operating on the first fixture location. This way you can prove out a program on only 1 fixture (by turning on your machine's block delete switch), then activate the other fixtures later by turning it off. Here's what you may want such code may look (especially note the lines in bold)... % O1 T1 M6 ( T1 - SHELL MILL [NO COOLANT]) N1 G0 G40 G80 G90 G54 X7.25 Y5. G43 H3 Z0.25 S8000 M3 G54 G0 X7.25 Y5. M98 P2 / G55 G0 X7.25 Y5. (All offsets except G54 have block delete...) / M98 P2 / G56 G0 X7.25 Y5. / M98 P2 / G57 G0 X7.25 Y5. / M98 P2 M5 G91 G28 Z0 M9 T2 M6 ( T2 - SPOT DRILL) N1 G0 G90 G57 X8. Y13.5 G43 H1 Z0.25 M8 S8000 M3 / G57 G0 X8. Y13.5 / M98 P3 / G56 G0 X8. Y13.5 / M98 P3 / G55 G0 X8. Y13.5 / M98 P3 G54 G0 X8. Y13.5 M98 P3 M5 ...

If this is the kind of output that you want, then you may achieve it by simply using an IF condition: SubCall Describes the code used to call subs from the 'main' program. IF [Work] = 54 G0 G[Work] X[H] Y[V] M98 P[Sub]+[Program#] ELSE '/ ' G0 G[Work] X[H] Y[V] '/ ' M98 P[Sub]+[Program#] ENDIF end

Please note the trailing space character inside the quotes. Remember - when text is output, the post does NOT automatically pad it with spaces, as it does the actual output 'words' (such as G0 or X[H]) when the "Spaces? Y" switch is used.

9. Appendix A - List of Variables Following are lists that describe all of the variables that you can use in the sequences. Because there are so many types of values that can be used in a machine program there are several pages of variables listed here. You certainly do not need to memorize all of the variables - they are here for your reference. (You may, however want to just “skim” it to get an idea of what's available.) NOTE: You may see other variables in your template that are not listed here. This could happen in one of 2 cases: 1.

'User-defined' variable names may have been created (using a Rename command - see section 4.1.26) by the person who created or modified the template.

OR... 2.

We may have missed documenting some of them in this manual! (Sorry!)

SO... If you see a variable in your template that you don't recognize from the lists below, then first check all of the Rename lines in the template. If there is NOT a matching Rename line, then that means we missed documenting it! If this is the case, please notify us and we will make sure that it is added to future revisions of this manual. Categories of variables In the lists of variables below, there is a Category column. This is what each category means: Category

Relevance

Axis position Motion attributes Arc motion Drilling Tool Change Prompted

These are the actual positions of the machines axes. Various information about the movement (distance moved, feed rate, etc.) Variables that are used only in processing arc motions. Variables that are used only in processing drilling ('point to point 'canned' cycles. Information related to the tool change process, or attributes of the tool itself The values of these variables will be asked of the user when the post runs - they are generally NOT set by the incoming CL data. Variables used for calling and/or defining machine subroutines and/or subprograms. Variables that don't fit into any of the above categories

Subs General

The variables... In addition to supplying 'categories', we have grouped the variables into separate lists according to the areas of usage in the format. Generally, all of the variables in a list will be used in the same sequence (or related sequences). NOTE: Within each list, the variables are listed in alphabetical order.

NOTE: Variables marked with asterisk (*) are probably not supported by your CAM system, so you should generally avoid using them. (Although you may employ them as “general use” variables by setting their values by using the Set command within the format.)

9.1.1.1

Variables that apply to movements in general

You can use these variables in any sequence that produces motion. (ToolChange, Index, RapidCode, LineCode, CwCode, etc.) Variable(s)

Category

Details

Related / similar items

AAxis, BAxis, CAxis Adir, Bdir, Cdir

Rotary motion Rotary motion

RotAngle

ADist, BDist, CDist

Rotary motion

CPref

Rotary motion

D Dist4

Axis position Motion attributes Motion attributes Motion attributes Axis position Motion attributes

The (angular) position for the rotary axes ON 5 (or more) AXIS POSTS. (4 axis posts usually use RotAngle.) Typically only available on 5 (or more) axis Mill posts (or MillTurns with more than 1 rotary axis). The direction (0 = no rotary motion, 1 = Ccw, 2 = CW) that each rotary axis is moving on the current move (4 axis posts usually use RotAxDir.) These directions follow the ISO standard for tool rotation. (See the 5 axis Addendum manual for details on this.) Typically only available on 5 (or more) axis Mill posts (or MillTurns with more than 1 rotary axis). The distance (in degrees) each rotary axis is moving on the current move (4 axis posts usually use Dist4.) You may Set this variable to indicate the "preferred C value for the post to output whenever the machine has to do a (relatively long) rapid move (where the tool is moved into ‘'tool shank vertical’ [“I,J,K = 0,0,1”] position) moves". This is only needed on machines with a C axis that has physical limits; user should USUALLY set this to the 'mid-travel' value of his C axis; this should minimize the occurence of ‘unwinds’ by setting the C axis to its ‘middle of range’. (default 0) to allow user to set “Depth” (Z) linear axis endpoint position of the current movement Similar to Hdist, Vdist and DDist, but this is the angular measurement of the current rotary axis move (4 axis milling applications only). The “degrees per minute” feed rate (used in rotary axis milling only).

DPM FRate H HCDC, VCDC

H2, V2

Motion attributes

HDist, VDist, DDist

Motion attributes

HVector, VVector

Motion attributes

InvTime

Motion attributes

Feed rate value. This outputs in the proper units (IPM, IPR, MMPM, Inverse time, etc.) as needed. Horizontal (X) linear axis endpoint position of the current movement. "CDC" (cutter diameter compensation) vectors - used by some older Cincinnati machines. NOTE: For these to be active, the CDC command must first be specified in the “Commands & Switches” section of your post. Example: CDC P Q (4 axis Wire EDM posts only:) These hold the X and Y positions of the endpoint of the current movement (Rapid, feed or arc) for movements on the secondary (auxilliary) plane. These variables hold the linear distances that each axis is to travel on the current move. These are SIGNED (+ or -) values: if X is moving in the negative direction, [HDist] will be a negative value. These 2 values indicate the (vector) direction of the first completely compensated cutting move. They are used on machines that do not have “look ahead” ability to indicate which way the tool is going to go on the move AFTER the infeed. You will notice that they are used on the INFEED line of the Fanuc 3000C format. The reciprocal of MoveTime - “Inverse time” is a method that many milling machines equipped with rotary axes use to determine the actual feed rate. For those machines, this value is used instead of FRate.

AAxis, BAxis, CAxis, RotAxDir

HDist, VDist, DDist, Dist4

Unwind sequence

H, V, LastH, LastV, LastD HDist, VDist, DDist FRate, InvTime Plunge, FeedType, DPM, InvTime V, D, LastH, LastV, LastD IVect, JVect, KVect

H, V, Hctr2, VCtr2

Dist4, MoveLength

FRate variable, RotaryFeed command

Variable(s)

Category

Details

Related / similar items

IVect, JVect, KVect

Motion attributes

HCDC, VCDC, NormH, NormV, NormD

LastH, LastV, LastD, LastRotAng

Axis position

The 3 components of the unitized vector that describes “3D offset” - used only for machines that support this type of offset and where the incoming tool motion (CL) file provides this information. The post will not output these vectors automatically; the LineCode sequence is typically used to output these values if the machine needs them - as in this example: LineCode G1 X[H] Y[V] Z[D] I[IVect] J[JVect] K[KVect] F[Frate] end These hold the H, V and D and rotary (milling 4th axis) values that were previously output (typically the XYZ values of the endpoint of the previous movement). In other words, these values typically indicate where the tool is immediately before the current move is processed & output. BUT THAT IS NOT ALWAYS THE CASE. READ THE IMPORTANT INFORMATION BELOW REGARDING THE USE OF THESE VARIABLES.

H, V, D, RotAngle

Beware outputting (and calculations using) [LastH], [LastV] or [LastD]: Since the value in [LastD] (for example) gets updated IMMEDIATELY (to the current [D] value) upon [D] being output, you must check or use [LastD] in any output BEFORE [D] IS OUTPUT! This is why in the helical arc examples shown in section 4.2.7.1 we have the K value on the line BEFORE the Z value. (If we put it after Z, then [LastD] would have already been updated, and would be equal to [D].) The same is true with the variables [LastH] and [LastV]. If you need to use the value of [Last_] variables in several places in a sequence, then a way that you can get around this problem is to 'memorize' the [Last_] value into another variable, then use that variable instead. Here's a good example - in this RapidCode sequence, we have added 'Z safety logic' to help prevent crashes, so the first thing we do is memorize the [LastD] value: RapidCode Set [Val1] to [LastD] Set [Val2] to [D]

MoveLength

Motion attributes

Memorize "From" & "to" Z val's

if [Val2] < [Val1] G0 X[H] Y[V] Z[D] endif

Going down? XY first, then Z.

if [Val2] = [Val1] G0 X[H] Y[V] Z[D] endif

Same Z... Output XYZ together

if [Val2] > [Val1] G0 Z[D] X[H] Y[V] endif end

Going up: Z first, then XY.

This is the total distance from the start to the end of the current move, measured "as the bird flies" (not around arcs). It is essentially the hypotenuse of the "3D triangle" defined by the start and end points of the current movement. (This is always a positive value.)

Hdist, Vdist, DDist

Variable(s)

Category

Details

Related / similar items

MoveTime

Motion attributes

InvTime, MoveLength, TotalCutTime, TotalCutDist

NormH, NormV, NormD

Motion attributes

Pitch

Drilling, Threading

PolarAngle

Motion attributes

The length of time (in minutes) that the machine should take to complete the current movement. (Calculated by dividing MoveLength by the [IPM or MMPM] feed rate.) These variables define the 3D compensation vector used to indicate 3D offset direction when machining a 3D surfaces. They are ONLY set when they are read from the '3rd triplet' of GOTO records (after first being activated by a MODE or APPLY record like this): MODE/3DCOMP,ON or APPLY/3DCOMP,ON These variables can be used in the LineCode sequence like this: LineCode G1 X[H] Y[V] Z[D] I[NormH] J[NORMV] K[NORMD] F[Frate] end This is the reciprocal of the thread lead (1 / lead). Example: for a 1/4-20 thread, the lead is .05, so [Pitch] = 20 (which is 1/.05). It gets set during TAP cycles or when reading THREAD information from the CL file. (Typically used for MillTurn machines when milling on the face of the part…) This is the (typically C axis) angle of the current move’s endpoint (with 0 degrees being along the X+ axis direction). This is almost always used in conjunction with the PolarDist variable like this:

IVect, JVect, KVect

PolarDist, PolarBreak

if [Mode] = 3 and [IVect] < .99 Face (Polar) Milling: G1 X[PolarDist] Z[D] C[PolarAngle] F[Frate] endif

PolarBreak

Motion attributes

PolarDist

Motion attributes Axis position

RotAngle RotAxDir V RLevel TotalCutDist

Motion attributes Axis position Motion Attributes Motion Attributes

HOWEVER, you may use PolarDist and PolarAngle whenever you need to output the ‘polar’ location of the current move’s endpoint (or the current hole lcation, in the case of drilling cycles); PolarDist will indicate the distance of the current endpoint from the origin, and PolarAngle will be the angle (measured in ‘CAD standard’ method: 0 degrees is “3 o’clock”…) On MillTurn machines, when this variable is set to a non-zero number, the post will break lines and arcs that are milled on the 'face' of the workpiece (typically in the XY plane) into short linear polar (typically X,C) moves. This allows milling on the face of parts on MillTurn machines that do not have a Y axis. If this is what you want to do, then Set [PolarBreak] to the 'chordal deviation tolerance' that you want to hold on face contour milling operations. Almost always used in conjunction with PolarAngle – see discussion re PolarAngle above. The (angular) position for the milling rotary axis ON 4 AXIS MILLS ONLY. (5 axis posts MUST use AAxis, BAxis and/or CAxis instead!) Set to 1 when the milling rotary table is to move counterclockwise, and -1 when clockwise. Vertical (Y) linear axis endpoint dimension... Vertical clearance: the lowest of the two rapid levels. (Usually the R value in a canned cycle - mill only.) This is an ESTIMATE of the total distance the tool has traveled (so far) while in FEED mode. (Not rapid.) This is typically used in the EndCode sequence to display the overall estimated CUTTING (not including rapid) time as in this example: EndCode M30 %0 '(EST._FEED_TIME:_' t[TotalCutTime] '_MIN._[' t[TotalCutDist] '_IN.])'

End

MaxRad command, PolarDist and PolarAngle variables

PolarAngle, PolarBreak LastRotAng, AAxis, BAxis, CAxis RotAngle, Adir, Bdir, CDir H, D, LastH, LastV, LastD

TotalCutTime, MoveLength, FileSize

Variable(s)

Category

Details

Related / similar items

TotalCutTime

Motion Attributes

This is an ESTIMATE of the total TIME (in minutes) that the tool has spent (so far) while in FEED mode. (Does not include rapid moves.) See usage example immediately above.

TotalCutDist, MoveTime, FileSize

9.1.1.2

Variables that can be used to format arc movements

These variables are only used in the ArcCode sequence. (Note - in older posts, there may be CwCode and CcwCode sequences instead of a single ArcCode sequence. Variable(s)

Category

Details

Related / similar items

ArcDir

Arc motion

All other variables in this chart.

ArcPlane ArcRad

Arc motion Arc motion

The “Direction numnber” of the arc. The number is set with the CW and CCW commands. For instance, if you have the following CW and CCW commands in your template… Cw G2 Ccw G3 …then [ArcDir] will be 2 for clockwise arcs, and 3 for counter-clockwise. ArcDir is typically used with the letter G (in the ArcCode sequence) like this: Ccw G[ArcDir] X[H] Y[V] … See the discussion of the ArcPlane command in section 4.2.1 The radius of the arc.

ArcStartH, ArcStartV EndAng HCtr, VCtr, DCtr HCtr2, VCtr2

Arc motion Arc motion Arc motion

Ival, Jval

Arc motion

Normal1, Normal2, Normal3

Arc motion

StartAng, EndAng

Arc motion

Sweep

Arc motion

Arc motion

These variables hold the horizontal and vertical coordinates, respectively, of the start point of the current arc. See discussion of StartAng below. Absolute (X,Y,Z respectively) location of the arc center. Absolute location of the arc center – for arcs on the ‘auxilliary’ (or secondary) plane. The I and J values for the arc center. These will be either absolute or incremental (from the arc startpoint) depending on the CtrIncremental? switch setting. These variables hold the X, Y and Z components (respectively) for the “normal” vector of the most current arc. This vector describes the ‘axle’ of the arc and is usually set to 0,0,1 for Counter Clockwise arcs and 0,0,-1 for Clockwose. (Note - Unigraphics posts are exactly the opposite. See the Unigraphics? switch.) Ouputs the starting and ending angles of the current arc. (Angles will be in the range of 0 to 359.999, with “3 o'clock being 0 degrees, positive angles going ccw.) This is used to output the span of an arc (measured in degrees). This can be done by including it in the ArcCode (or CWCODE and CCWCODE) sequences (see below). The value output will be negative (-) for Clockwise arcs, and positive (+) for Counter-clockwise arcs. Therefore, if you need the output value to always be positive, then make sure that the letter you use it with is formatted with no minus sign (-). (Likewise, if you need to reverse the sign so that CW arcs are positive sweep and CCW are negative, then use the MULT modifier to multiply the letter's value by negative 1.)

ArcPlane command All other variables in this chart. H, V StartAng All other variables in this chart. HCtr, VCtr, H2, V2 HCtr, VCtr

IVect, JVect, KVect

All other variables in this chart. All other variables in this chart.

9.1.1.3

Variables related to “point-to-point” Drilling cycles

Some of the sequences that these variables are used in are Drill, Peck, Tap, etc. Variable(s)

Category

Details

Related / similar items

Cycle

Drilling

Tap

Dwell LastHole

General Drilling

See discussion of this in section 9.1.1.4 – as this variable is normally used in ToolChange and 1st ToolChange sequences. Dwell time (measured in seconds) at the bottom of a hole. This variable is automatically set to 1 when processing the last hole (and ONLY the last hole) in a point-to-point sequence. It is usually used in an IF statement to add or remove certain codes when processing the last hole of a drill cycle. The following example shows how to use LastHole in an IF structure (see "If/Then Logic") to get a special code (in this case "G98") on the last hole. Drill 5

[Rigid]

(first 5 lines are for the 1st hole in the cycle)

if [LastHole] = 1 G81 G98 X[H] Y[V] Z[D] R[RLevel] F[FRate] else G81 X[H] Y[V] Z[D] R[RLevel] F[FRate] endif if [LastHole] = 1 X[H] Y[V] G98 else X[H] Y[V] endif

Orient

Drilling

PeckClear

Drilling

Pitch

Drilling

PointH, PointV, PointD

Drilling

RetPlane

Drilling

end cancel [Orient] will be set to 1 when the CL file’s CYCLE record (describing the current drilling cycle) includes the minor word ‘ORIENT’ (otherwise [Orient] will be 0.) This is the “hole bottom clearance” distance that the post will use when generating peck drilling cycles. The default value is .050” unless the AskPeckClear? switch is set to Y (or if you use a Set command to set it to another value). Example - for metric posts we recommend:

[Rigid], [Orient]

AskPeckClear? switch (see section 4.1.2 )

Set [PeckClear] to 1

This is the reciprocal of the thread lead (1 / [Step]). Example: for a 1/4-20 thread, the lead is .05, so [Pitch] = 20 (which is 1/.05). Note; To use [Pitch], a FeedType command must be used earlier in the template. Most drilling Canned cycles require a Z value indicating the absolute Z position of the BOTTOM of the hole. That is why you usually see a Z[D] word in most Canned cycle descriptions. Some machines, however, require the designation of the Z level at TOP of the hole (the SURFACE of the part), rather than at the hole bottom. For those machines, use the PointD (“Point Depth”) variable instead. PointH and Point V are useful in 5 axis posts if you need to designate the XY location of the top of the hole. The value of the return plane mode (Initial plane = G98,“Rapid plane” = G99.) The actual number output depends on the “ReturnPlane” command (read about it in the Commands & Switches section earlier).

[Step]

[H], [V], [D]

Variable(s)

Category

Details

Related / similar items

Rigid

Tapping

[Rigid] is set to 1 when the cycle being processed is a rigid tap cycle. You may use an IF structure to output your TAP or Cancel sequences accordingly. Examples:

[LastHole]

Tap 6 If [Rigid] > 0 G93 G84 X[H] Y[V] Z[D] K[VBite] R[RLevel] F[FRate] else G84 X[H] Y[V] Z[D] R[RLevel] F[FRate] endif X[H] Y[V] W[RPlane] end cancel Cancel G80 if [Rigid] > 0 G94 endif end

Step

Drilling

Tap

Drilling

Note: Since [Rigid] is not reset until the start of the next cycle, it can be used in the CANCEL sequence as well as the TAP sequence. For PECK cycle: the “pecking” value (mill only; lathe uses SBite) For TAP cycle: the thread “lead” (the distance from one thread peak to the next). Note that [Step] is the reciprocal of [Pitch]; e.g. for a _-20 thread ([Pitch] = 20), the [Step] value is .05 (which is 1/20) See discussion of this in section 9.1.1.4 – as this is normally used in ToolChange and 1st ToolChange sequences.

[Pitch]

Tap

9.1.1.4

Variables set from the Tool or Tool Change information

These variables are typically used in the ToolChange and 1stToolChange sequences. Some of them are used other places as well. Remenber - variables marked with asterisk (*) are probably not supported by your CAM system, so you should generally avoid using them. (Although you may employ them as “general use” variables by setting their values by using the Set command within the template.) Variable(s)

Category

Details

Related / similar items (variables, unless noted)

Comp Cool

Tool change info Tool change info

LComp, DComp

Corner * Cycle

Tool change info Tool change info

Lathe Tool compensation offset #. (Not used for milling posts.) Coolant M code value (on, off, mist). Typically M8, M9 and M7, respectively The “corner radius” of the tool. The [Cycle] variable gets set - when there is a holemaking or threading cycle upcoming - according to the cycle type. Unless noted, the values listed below are for posts running in MILL mode. ADD 100 when post is in TURN (Lathe) mode: Note that [Cycle] is set to 0 when 'milling' (In other words, NOT doing any drilling cycles), and 100 when in 'turning' mode (e.g. turning or grooving). (Lathe) threading = 107 Drill = 13 (Remember: add 100 if in lathe mode...) LTap = 14 Peck = 15 Tap = 16 Ream = 17 Bore = 18 Back = 19 Custom1 = 21 Custom2 = 22 Custom3 = 23 ChipBreak = 28 CSink = 29 (Please note that there are 'gaps' in the numbering sequence above.) SO... If you want to differentiate between MILL and DRILL cycles in a mill post you would do something like this... ToolChange ... if [Cycle] = 0 Milling... milling does these lines else drilling does these... endif ... end ... and the same for a turning post, except that you would add 100 like this: ...

ToolRad, ToolDiam [Tap], [Rigid] and [Style] variables

Variable(s)

Category

Details

Related / similar items (variables, unless noted)

if [Cycle] = 100 ... DComp

CRC

Depth * Direct FeedType

Tool change info Tool change info Tool change info

Flutes *

Tool change info

IncMode

Tool change info

LastDep * LastTool

Tool change info Tool change info

LComp NextTool

Tool change info Tool change info

Plunge

Machining info

ILevel Range

Positioning Tool change info

SBite * SClear *

Tool change info Machining info

Side

CRC

SLeave *

Machining info

Speed SpeedType

Tool change info Tool change info

Spindle#

Tool change info

Diameter compensation offset #. (mill only) Usually used in the Infeed sequence, but some machines like this value put in the ToolChange sequences. Depth of the upcoming cycle (mill only) M code value of Spindle direction; Cw (3) or Ccw (4) G code value of IPM (usually 95), IPR (94) or “Inverse time” (93) designator that was set in the FEEDTYPE line (described above). (mill and lathe only) The number of flutes (cutting edges) this tool has (FYI: drills typically have 2). Will output the numerical value that corresponds to incremental or absolute program output according to the “INC/ABS” line (see above) - typically 90 or 91 (as in 'G90' and 'G91'). Depth of the previous cycle (mill only) The T# of the last tool used (commonly used in lathe programs to cancel compensation). Length compensation offset #. (mill only) The T# of the tool that is to be used AFTER the current tool. (Usually used to pre-select a tool for machines equipped with armtype tool changers.) In the program's final tool change, NextTool will be set to the first tool number used in the program (it will be equal to [Tool1]). (See the ToolChange sequence example at the top of section 7.5 for an example of how to suppress 'pre-selection' of a tool in the program's final tool change.) Plunge feed rate value (mill only). Usually used in the Infeed sequence. Z dimension used for lateral rapid moves (mill only). Spindle range number – read from the CL file's SPINDL record (the number following the RANGE minor word) “Side bite”: the XY step distance for multi-pass side milling Side (XY) clearance amount. (Typically the length of the 'Infeed' move [the move on which a G41 or G42 may appear to apply CRC.) Cutter compensation Left/Right side value (usually 41 or 42). Usually used in the Infeed sequence. 'Side Leave': Amount that the current toolpath will “leave” on the side of the contour being cut (amount to leave in X/Y) (Note: Sleave] and [Vleave] are not available with most CAM systems.) Spindle speed (usually an “S” value). G code value of RPM (97) or CSS (96) designator that was set in the SPEEDTYPE line (described above). (lathe only) The spindle number. (Only useful on lathes or MillTurns with more than 1 spindle.)

Lcomp, Tool, Side

D Speed, Range SpeedType

INC/ABS command

NextTool, Tool, Tool1 Dcomp, Tool LastTool, Tool, Tool1

FRate RLevel Speed, Direct Step Dcomp, Side

DComp Vleave

Direct, Range Speed, FeedType Turret

Variable(s)

Category

Details

Related / similar items (variables, unless noted)

Tap

Tool change info

Use the following IF structure in your ToolChange or 1stToolChange sequences to detect an upcoming TAP or LTAP cycle: If [Cycle] = [TAP] ... else ... endif

[Cycle] variable

The IF line in the example above is equivalent to... If [Cycle] = 13 OR [Cycle] = 14 ... See the [Cycle] variable for the list of cycle values.

Tool Tool1

Tool change info Tool change info

ToolDiam ToolRad Turret

Tool change info Tool change info Tool change info

UnitMode

Tool change info

VLeave *

Machining info

Work

Tool change / prompted (See “Details” column)

The [Tap] variable should actually be considered as a 'constant' (In other words, it is always set to the same value automatically by the post, and you should NEVER use a 'Set' command to change its value). “T” number The T number of the 1st tool in the program; this is usually referenced in the EndCode section to put the first tool back in the spindle (mill) or to return the turret back to tool position 1 (lathe) at the end of the program. The diameter of the tool. RADIUS value (1/2 the ToolDiam) of the current tool. This is the # of the turret now active. (Typically used in lathe or MillTurn posts only.) If your CAM system ever sets the [Turret] to 2, then the post will not run unless you add the HCode2, VCode2 and/or DCode2 commands to your template (to tell the post which letters you want assigned to the 2nd turret.). Read about these commands in section 4.1.16 Also available for turret 2 only is the RevTurret2? switch. Read about that in section 4.1.30 Will output the numerical value that corresponds to inch or MM programming mode according to the “INCH/MM” command. For example, if the following line is used... Inch/MM 70 71 ...then the following code (within a ToolChange sequence, for example) will output G70 when in INCH mode, and a G71 when in MM mode. G[UnitMode] 'Vertical Leave': Amount that the current toolpath will “leave” in the Z dimension for finishing with a later operation or tool. (Note: [Sleave] and [Vleave] are not applicable to most CAM systems.) Work offset # (usually in the range of 54 to 59). The user will be prompted for the first occurrence of this value if it is not found in the incoming CL data.

LastTool, NextTool, Tool1 LastTool, NextTool, Tool

ToolRad, Corner ToolDiam, Corner [Tool] & [Style] variables, RevTurret2? switch.

IncMode

SLeave

WorkDefault and Work commands. (See Appendix C for details on this topic!)

9.1.1.5

Variables used for subroutines or subprograms

You will find these variables in use in the SubStart, SubEnd and SubCall sequences. Variable(s)

Category

Details

Related / similar items

Sub

Subs

Times

SubLine

Subs

Times

Subs

This is the value of the sub number, and can be used in the SubStart and SubCall sequences. Typical usages: SubStart O[Sub] End SubCall M98 P[Sub] L[Times] End This is used in the SubCall sequence in place of [Sub] if the machine must call a sub by its starting block (N) number (as opposed to using the sub number itself). SubCall M98 P[SubLine] End This is used to designate the number of times a sub repeats; it is usually used only in the SubCall sequence.

9.1.1.6

See [Sub] details above for an example of how this is used in SubCall sequence.

Text Variables

These are the only variables that do not output numeric data - instead they output text. You can instantly tell the difference between a text variable and a numeric variable by the type of bracket that is used: Numeric variables have [square brackets] and text variables have {curly brackets }. See section 7.3 for details on... - how to output text, - outputting text variables and - using text and text variables in the File Alias command. Variable(s)

Category

{Partno}

Text

{CLPath} {CL Name} {CL Ext} {TemplatePath} {Template Name} {Template Ext} {OutputPath} {Output Name} {Output Ext}

Text Text Text Text Text Text Text Text Text

Details Use this variable to access or output the text in the PARTNO CL record. (Note: You can only use this variable with CAM systems that output APT-CL files that include a PARTNO record.) The 'drive and path' to the CL file. Example: C:\CLFiles\ The CL file name only (no path or extension) Example: Job123 The CL file extension (usually 3 letters) including the 'dot' Example: .INC The 'drive and path' to the format template file. Example: C:\PostHaste\Formats\ The format template file name only (no path or extension) Example: Fanuc 15iM, LeBlond The template file extension (usually 3 letters), includes the 'dot' Example: .pM3 The 'drive and path' to the final NC program file. Example: C:\NCPrograms\Mills\LeBlond\ The final NC program file name only (no path or extension) Example: Job123 Setup 1 The final NC program file name extension (usually 3 letters), includes the 'dot' Example: .NCC

9.1.1.7

Prompted Variables

The values of these variables may not be set in the CL data. If you use any of these variables in your format, then you will be prompted to enter their value(s) when the post starts processing your code. Variable(s)

Category

Details

Related / similar items

EndH, EndV

Prompted

ToolH, ToolV, ToolD

MaxRPM

Tool change / prompted (See “Details” column) Prompted Axis position / Prompted

Position to which you would like the tool to come to rest at END of the program. Maximum spindle speed limit (used with Lathe only; usually in conjunction with a G50 or G92) The user will be prompted for the first occurrence of this value if it is not found in the incoming CL data. This number appears at the top of an NC program Tool change position. This is typically used in a ToolChange sequence to move the tool to a particular (prompted) X, Y, and/or Z location before executing the tool change (M6) proper. Work origin offset coordinates (usually used with a G92 or G10 command).

Program# ToolH, ToolV, ToolD WorkH, WorkV, WorkD

Prompted

EndH, EndV

9.1.1.8

Variables used for Wire EDM posts.

These are variables that don't really fit into any other category... Variable(s)

Category

Details

Related / similar items

InitPower

Wire EDM

Power, SparkGap, WireFeed

LowerDist, UpperDist Power

Wire EDM

‘Initial power’ setting value (Note – this variable will be set only if the CL file supports this function.) Uppoer & lower wire guide distances.

SparkGap

Wire EDM

Thickness WireFeed

Wire EDM Wire EDM

Wire EDM

‘Power’ setting value (Note – this variable will be set only if the CL file supports this function.) ‘Initial power’ value (Note – this variable will be set only if the CL file supports this function.) Thickness of the part. ‘Initial power’ value (Note – this variable will be set only if the CL file supports this function.)

Thickness InitPower, SparkGap, WireFeed InitPower, Power, WireFeed LowerDist, UpperDist InitPower, Power, SparkGap

9.1.1.9

General Purpose (Misc.) variables

These are variables that don't really fit into any other category... Variable(s)

Category

Details

Related / similar items

Block

General

The Block (or: sequence) number. This is automatically produced according to the Sequence#s line in the format (see above). If the 'frequency' of the Sequence#s is set to 0 (like this)...

The exclamation point (example: !0 ) can be used to suppress the output of block numbers.

Sequence#s N 0 1 1 1 Char, freq., incr, start

EndN FileSize LinTol

Mode

Lathe Roughing General Rotary axes

General

...then N[Block] can be used to 'force' out N numbers on certain lines. Example: N[Block] T[Tool] M6 See discussion of StartN below. The number of bytes in the final NC program file (so far). (NOTE – 5 axis and MillTurn posts only.) Set this variable to a non-zero number to activate PostHaste’s “Linearization” function (that will insert extra movements to break up movements with relatively large rotary angle changes into shorter moves to reduce tool tip gouging.). This variable is updated by the LINTOL record in APT CL files, or can be SET by the user like this: Set [LinTol] to .001 This variable is used mostly in MillTurn machine formats to determine if the operation is in milling or Turning mode. For MillTurn posts this is typically set by the MODE or APPLY record coming from the CL file … [Mode] = 1 when Turning,... per these CL records: MODE / TURN or APPLY / TURN [Mode] = 3 when Milling. This occurs when these records are found: MODE / MILL or APPLY / MILL For Wire EDM posts… [Mode] = 2 when in “2 axis” mode – typically when a contour is being cut that requires no independent movement of the UV (auxilliary or secondary) wire guide. [Mode] = 10 when in “4 axis” (typically ‘XYUV”) mode If you need to set the [Mode] yourself based on certain conditions, we recommend that you follow these conventions: Set [Mode] to 2 for “2D only” machining modes such as Laser, flame, 2 axis EDM, etc. Set [Mode] to 3 for simultaneous 3 axis milling mode. Set [Mode] to 4 for simultaneous 4 axis milling mode. Set [Mode] to 5 for simultaneous 5 axis milling mode. Set [Mode] to 6 for ‘generic’ MillTurn mode { XZC } Note: values of 7 to 9 are ‘reserved’ for possible future use – perhaps to differentiate different MillTurn modes (XYZC, XZBC, XYZBC,)

StartN TotalCutDist LINTOL (APT CL) record

MODE and TYPE commands

Variable(s)

Category

Details

Related / similar items

StartN, EndN

Lathe Roughing

These variables hold the “N numbers” (line numbers) of the starting and ending of the ‘finish path’ that is used for lathe roughing cycles. They are typically used in a Rough sequence like this: Rough G71 P[StartN] Q[EndN] U[VLeave] W[SLeave] … end

Stop

General

Taper

Lathe Threading

If a ‘full stop’ is commanded in the CL file, [Stop] will equal 0. If an ‘optional stop’ is commanded, this will equal 1. (Lathe only.) [Taper] holds the ‘diameter difference’ between the start diameter and the end diameter of the thread in AutoThread sequence. The taper of a thread is usually associated with the letter I or R. Example: G76 X[V] Z[H] P[Depth] Q[Peck1] I[Taper] F[Frate]

Val1 to Val20

General

These are general purpose 'user' variables that you can use for any purpose you want. These variables are not set by anything in the incoming CL data (unless you specifically use them in a Cycle or UponRec sequence definition line). When the post starts running, it always initializes these values to zero; the values of these variables can be set or changed only by using ADD, ASK, or SET statements or by putting them in the 'definition' (first) line of a Cycle or UponRec sequence.

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”!

See the Rename command (section 4.1.26) for more information on defining your own names for variables. See the Add, Ask, Set, Cycle, UponRec and IF (logic) sections for examples of how 'user' variables may be used.

10. Appendix B - List of “retired” functions. When working with OLD post formats, use this list to find things that aren't discussed earlier in the manual. (Functions are listed in alphabetical order.) As PostHASTE has advanced over many years, many of the original functions have been “retired” and replaced by better methods. For sake of clarity (and to reduce confusion), we discuss only the newer (better) solutions in the main sections of this manual. HOWEVER, for purposes of “backwards compatibility”, the “old” functions still work. You may come across some of these functions if you happen to be working on older PostHASTE templates. They are listed here for your convenience - in case you ever run across them and need to know what they do. Remember - there are better ways to achieve the same results: so we recommend that you do NOT use the retired functions - use instead the functions listed in the “Better to use” column of the table below. Item, Retirement M/Y

Better to use:

Notes:

9/94

[Square brackets]

2ndCircleCode, 4/93 CwCode, CcwCode 10/01 [CommentDelay] variable 12/01

ArcCode

Square brackets are now used for variables because (1) they are easier to type because they require no shift key, and (2) it makes IF commands less confusing if 'less than' () symbols are being used. Used for arc formats that require more than one line of code. (See p. 50)

ArcCode

Used for arc formats that require more than one line of code. (See p. 50)

Comments command

Varibles: [RPlane], [VClear] and [Vbite] 11/01 DCompAdd, LCompAdd 9/01 PostForm.* files 8/01

[Ilevel], [Rlevel] and [Step], respectively

See section 5.3.1for details on the Comments command. CommentDelay was used in older formats to 'postpone' comments for a few lines so that they would appear in a more useful location in your tool changes. The names RPlane and VClear were misleading because RPlane specified the “Initial Level” and has thus been changed to [ILevel]), and VClear specifies the “R level” (and has thus been changed to [RLevel]). Also, 'Step' sounds better than VBite. These commands were used with AuraCad/CAM product only. Since that product is no longer available, we have removed these commands. It's easier to just 'hard-code' this functionality as an equation (like D[DComp]+20) anyway. One machine format per file now, please. (Too many advantages to list here.) See Appendix B in the Getting Started manual for naming conventions. This is important! (The post does certain internal processes differently depending on the template file extension!) Removed last vestiges of .M and .L file extensions.

PConfig.M file 8/01 [CoolantOff] variable, 2/01

D[DComp]+20 H[LComp]+10 (etc.) “Single machine” format template files. (Examples: *.pM3 *.pM5 *.pT2 ...etc.) PostHASTE.cfg file Just use a simple... M9 ...instead of M[CoolantOff]

A long time ago, one of our larger customers requested that we add this variable. Since then, nobody has ever used it (as far as we know), and it makes thimgs more confusing, so it has been retired. If you really want to use it... (its value is set in the “Coolant” line) you may use it anywhere in the sequences that you want to turn the coolant off like this: M[CoolantOff] (See, M9 IS simpler, isn't it?)

11. Appendix C APT-CL Records recognized PostHaste automatically recognizes the APT-CL records in following list that start with the following words or symbols. ### NOTE -THIS SECTION IS "UNDER CONSTRUCTION" - WE WILL BE ADDING DESCRIPTIONS AND DETAILS OVER THE COMING MONTHS. THANK YOU FOR YOUR PATIENCE. - 3/22/04 ###

In addition to knowing which CL records PostHaste recognizes, It is probably just as important to know which CL records PostHaste IGNORES, so the first list below is a list of CL records that PostHaste IGNORES NOTE: If there is a record in your CL files that is NOT on either of these lists, PostHaste will issue a warning. HOWEVER - Remember you can always use an UPONREC sequence to... - cause PostHaste to 'recognize' one of the commands on the "not recognized" list, or - override PostHaste's 'default' way of handling a recognized record. CL records IGNORED by PostHaste: (listed in alphabetical order): AUTOPS

END

FINI

GOHOME

HEADER

INTOL

MACHIN

MCS

ORIGIN

OUTTOL

POSMAP

PSIS

ROW

SELECT

SEQNO

TLON

TOOLNO

UNITS

NOTE: Even though PostHaste ignores these records, you can override that attribute and enable them with an UponRec sequence in your template. Here's an example: UponRec INTOL [Val1] ... end

CL records recognized by PostHaste: CL Record Name ("Major word")

Description / notes / default actions, etc.

$$

Comment marker - the post will ignore all lines that start with '$$'. HOWEVER - you MAY 'Convert' them into actual valid records that you may process with PostHaste. (See details on the Convert command.) Processed the same as MODE. (See MODE below.) Some CAM systems use these records to describe arc movements instead of the standard 'CIRCLE & GOTO' pairs. Note - the ARCMOV record must immediately follow the ARCDAT record. (Along with ENDSUB and DEFSUB records,) describes subroutines or subprograms. Same as MOVARC Sets the [iLevel] value. Sets the [Cool] value. Some CAM systems output these records as a comment in the CL file. To utilize CSYS records, you must add the following line to your template or PostHaste.CFG file: Convert '$$-> CSYS' to 'CSYS' If this is done, then PostHaste’s ‘default’ handling of these records is to use them to automatically calculate the rotary angle(s). PostHaste also sets the variables [CSys1] to [CSys12] to the values that are in the CSYS records. Note - You can affect the way PostHaste interprets this record by use of the InvertCSYS? switch Indicates [Side] - typically used in the Infeed sequence. At this time, only the [ToolDiam] and [ToolRad] variables are set by PostHaste (from the number immediately following CUTTER . Specifies all types of holemaking cycles, and lathe threading. (Along with ENDSUB and CALSUB records,) describes subroutines or subprograms. Same as PPRINT (see notes re PPRINT below) (Along with DEFSUB and CALSUB records,) describes subroutines or subprograms. Spindle speed and mode

APPLY ARCDAT, ARCMOV CALSUB CIRCLE CLEARP COOLNT CSYS

CUTCOM or CUTDIR CUTTER CYCLE DEFSUB DISPLY ENDSUB FEDRAT FROM GOTO HOMEPT INDEX INDIRV INSERT LINTOL LOAD LOADTL MODE MOVARC MSYS

MULTAX PARTNO PPRINT

RAPID RETRCT ROTATE, ROTABL or ROTHED

General XYZ position of the endpoint of a linear or circular move, or the position at the 'top' of a hole. (Also see MULTAXI below.) Identical to the ROTATE command - see the note re ROTATE below. Used for arcs in CATIA... Text in the INSERT record will be placed directly and immediately into the final NC program. (No comment markers will be added.) Linearization tolerance - used in 5 axis milling applications. (This sets PostHaste’s [LinTol] variable.) PostHaste interprets LOADTL, LOAD and TURRET identically. PostHaste interprets LOADTL, LOAD and TURRET identically. Processed the same as APPLY Same as CIRCLE Similar to CSYS - but this is automatically interpreted as an 'inverted' CSYS. (Note - Unigraphics outputs MSYS records instead of CSYS, and Unigraphics does not put them in a ‘comment’, so no Convert command is needed for the post to read these records from Unigraphics CL files.) / ON or / OFF - indicates that upcoming GOTO records will include or exclude IJK (Tool shaft) vector data The text following PARTNO will be put into the {PartNo} text variable. (NO NUMERIC data will be parsed from the incoming PARTNO text.) Text following PPRINT will be output in the NC program as a comment. (PostHaste processes PPRINT records the same as DISPLY records.) You can use the comments command within your template to indicate where you want the comments to appear in the NC program. Turns the next GOTO into a rapid (typically G0) move. Used to set the rotary axis variables - typically [RotAngle] (if only 1 rotary axis on your machine) or 2 of the following: [AAxis], [BAxis], [CAxis]. (PostHaste processes the INDEX command in the same way.)

SET SPINDL STOP SYNCTR THREAD TLAXIS TURRET

Used to set the [Work] (Work fixture offset) variable. Spindle speed and mode Triggers PostHaste's STOP sequence. (typically M0 or M1, depending on template formatting) Used in synchronizing multiple turrets (on lathes & MillTurn machines) or multiple wire guides in 4 axis wire EDMs. Thread turning Similar to CSYS - can be used to calculate rotary angles. PostHaste interprets LOADTL, LOAD and TURRET records identically.

12. Appendix D Handling Rotary Axes This section of the manual lists information that you will need to understand in order to handle rotary axis issues with PostHaste.

NOTE - This section of the manual is 'under construction' - please excuse the temporary 'men at work' signs such as '###' or '
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF