Commands 

Commands are used by the post processor to identify information necessary to format the program correctly. These commands can be placed in any order. They should be placed before the sequence section of the machine file. These commands are generally grouped by their prospective function.

2ndCircleCode

ArcPlane

ArcWithLine?

ArcWithSame?

Ask

ByDiameter?

ByQuadrants?

Call and CallMe

CCW

CDC

CircDir

Comment

Coolant (Flush)

CtrCode

CtrCode>180

CtrCode360

CtrIncremental?

CW

DCode

DCode2

DComp

Drive

Dummy

 

Each

EOB

Feed

FeedCode

FeedType

First#?

Flush (Coolant)

HCode

HCode2

Helical?

Inc/Abs

Inch/MM

Incremental?Last#?

LComp

Leading0s?

MaxRad

MinRad

Mod

Modality

ModalGs

ModalLetters

Force

Rapid

Rename

RenumSubs?

Replace

ReturnPlane

RevSigns

RevTurret2?

Sequence#s

Spaces

Spaces?

SpeedCode

SpeedType

Spindle

Subs1st?

Tolerance

Tools

UpperCaseComments?

VCode

VCode2

VRapid

WindowSize

Work

WorkDefault

ZRestart?

 

Commands that are used in the POSTFORM files followed by a question mark (such as Spaces?) are called switches . These switches refer to various conditions required by the NC machine that can be turned on or off with a YES or NO indication. This is accomplished by placing a Y or N after that word.

2ndCircleCode — Mill, Lathe, EDM 

Some NC machines cannot process a circular move in just one block of program information. For these machines a second line is used to indicate whatever information could not be given on the first line. 2ndCircleCode is used to describe the NC word that initiates this second line of information. Some machines require a code to identify the second line of the arc information. This is sometimes an M99 code.

2ndCircleCode M99

Related Commands:  CtrCode, ByDiameter?, ByQuadrants?, CtrIncremental?

ArcPlane — Mill Only 

This command sets the plane for Circular interpolation in XY, YZ, XZ planes. This command must be placed before the CtrCode Command. Example:  ArcPlane G 17 18 19 # Arc Plane Selection

To use this feature of MPOST, the CtrCode needs to have the K letter added after I J. Example:  CtrCode I J K

See CtrCode — Mill, Lathe, EDM.

ArcWithLine? — EDM 

This command is used for 4 axis EDM only. It is used to break G2 and G3 arc moves into G1 linear moves. It is used in conjunction with the MaxRad command that defines the chordal breakdown value of the G1 linear moves.

This command defines whether the machine tool can accept arcs and lines for 4 axis cuts. When the command is entered with the Y, the EDM machine can accept an arc on one path with a line on the other. When the N is entered the arcs are broken into line segments based on the MaxRad values entered.

With the example below the output is with arcs and lines.

ArcWithLine? Y

With this example the arcs are broken into line segments based on the MaxRad command.

MaxRad 99 .001

ArcWithLine? N

Related Commands:  ArcWithSame, MaxRad

ArcWithSame? — EDM 

This command is used for 4 axis EDM only. It is used to break G2 and G3 arc moves into G1 linear moves. It is used in conjunction with the MaxRad command that defines the chordal breakdown value of the G1 linear moves.

This command defines whether the machine tool can accept arcs on both cut paths for 4 axis cuts. When the command is entered with the Y the EDM machine can accept an arc on both cut paths. When the N is entered the arcs are broken into line segments based on the MaxRad values entered.

With the example below the output is with arcs.

ArcWithSame? Y

With this example the arcs are broken into line segments based on the MaxRad command.

MaxRad 99 .001

ArcWithSame? N

Related Commands: ArcWithLine, MaxRad

Ask — Mill, Lathe, EDM 

You can set the value of a variable by responding to a prompt. The prompt is configured by the user to be displayed prior to the post generating the code or the number of times a sequence is executed. You can enter a default value that can be accepted by pressing the Enter key. You can define any question for the prompt desired. The response to the question, either the default or entered value, assigns a numeric value to the any variable name. These variables can be placed in the POSTFORM file for any letter.

When the Ask statement is placed outside a sequence, it is only displayed one time for each tool motion file. The value of the variable defined is used for the entire file.

The example below indicates the format for the Ask statement. This example is used for a lathe cutoff cycle. The first quoted string is the prompt question, and the second is the optional default value.

Ask [z] “What is the Z value for cutoff?” “-3”

Ask [val2] “What is the X value (Radius) position for cutoff>” “2”

Ask [speed] “What is the cutoff spindle speed?” “200”

The prompts above are used to enter the values for the cutoff sequence. These values can be accessed in the EndCode sequence as follows:

 

EndCode

 

 

G0 Z.2

 

 

G28 U0 W0 M9 T[lasttool]

 

 

/0 M0

 

 

G50 X0 Z0

 

 

T1200 M[cool]

 

 

G96 S[val3] M[direct]

# Cutoff spindle speed

 

G0 Z[val1] X[val2] T1212

# Cutoff Z, X values

 

G0 X[val2]

# Clear to diameter

 

G28 U0 W0 T1200

 

 

M30

 

 

End

 

The NC code below uses the default values for the Ask statements.

 

G0 Z.2

 

G28 U0 W0 M9 T1100

 

/ M0

 

G50 X0 Z0

 

T1200 M8

 

G96 S200 M3

 

G0 Z-3. X2. T1212

 

G0 X2.

 

G28 U0 W0 T1200

 

M30

When the Post Processor is activated, the Ask prompts are displayed as follows:

ENTER a single SPACE to abort, or

What is the Z value for cutoff? (-3)

You can abort the post operation by pressing the space bar, then pressing the Enter key. To accept the default value in parentheses, press the Enter key. To enter a value, key in the new value and press the Enter key.

The Ask statement can also be placed within a sequence. You can prompt for information each time the sequence is used by the post processor. In the example below you are prompted for a work offset at each tool change.

 

ToolChange

 

Ask [val1] “What is the work offset number? ““54”

 

M6 T[tool]

 

G0 G[val1] X[h] Y[v]

 

S[speed] M[direct]

 

G43 Z[d] H[lcomp]

 

End

The output code using the default value for the Ask statement:

 

M6 T1

 

G0 G54 X0 Y0

 

S2000 M3

 

G43 Z.1 H1

ByDiameter? — Lathe 

This switch specifies that all X values are multiplied by 2 for global diameter output. Some machines require a diameter output for turning. Enter a Y to output diameters.

ByDiameter? Y

Related Commands: 2ndCircleCode, CtrCode, ByQuadrants?, CtrIncremental?

ByQuadrants? — Mill, Lathe, EDM 

Many NC machines do not allow program arcs of more than 90 degrees in a single block of code. The program must code the circular moves by quadrants. This is accomplished by breaking arcs at the quadrant boundaries. To create a full circular move, you must program one 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 the machine has this limitation, enter a Y after the ByQuadrants? command. When the machine allows full circle programming in one block, enter N.

The following example uses a circle of radius 2.5, and a center at X0 Y0 being cut counter clockwise from X2.5 Y0. The following lines will be produced depending on the ByQuadrants option.

 

ByQuadrants? N

 

# Outputs G3 Y0 I-2.5 J0

 

ByQuadrants? Y

 

# Outputs the following:

 

 

G3 X0 Y2.5 I-2.5 J0

 

 

 

X-2.5 Y0 I0 J-2.5

 

 

 

X0 Y-2.5 I2.5 J0

 

 

 

X2.5 Y0 I0 J2.5

 

Related Commands: 2ndCircleCode, CtrCode, ByDiameter?, CtrIncremental?

Call and CallMe

The CallMe and Call commands allow you to create and/or 'remotely' execute any sequence from other places in the template, thereby eliminating the need to have identical lines of code in two (or more) different places in your template. (This is commonly used to eliminate the need to have identical lines inside the ToolChange and 1stToolChange sequences, for example.)

Examples

Call can be used to execute (or 'reuse') any standard sequence

Probably the most common (and sensible) use of the Call command would be in the ToolChange sequence, since the ToolChange sequence is usually just the same as the 1stToolChange sequence - with the addition of a few lines at the beginning.

This first example calls (executes) the 1stToolChange sequence from inside the ToolChange sequence (after the first few lines have turned off the coolant and retracted the tool):

1stToolChange

T[Tool] M6

G[Work] G0 X[H] Y[V] S[Speed] M[Direct]

G43 Z[D] H[Tool]

M[Cool]

End

ToolChange

M9

G0 G28 G91 Z0

Call 1stToolChange      << This single line takes the place of repeating the 4 lines found above in 1stToolChange.

End

CallMe can be used to create your own (a 'user-defined') sequence

Note: Sequences that you create (with the CallMe command) do not get executed (output) until they are Called from somewhere else in the template via a Call command.

CallMe DoSpeedIfChanged   << Creates the “DoSpeedIfChanged” sequence.

If [Val1] <> [Speed]

 S[Speed] NoEol

 Set [Val1] to [Speed]

EndIf

End   (Note that CallMe sequences end with “End”, just like any other sequence.)

RapidCode

Call DoSpeedIfChanged.   << Calls (outputs) the DoSpeedIfChanged sequence.

G0 X[H] Y[V] Z[D]

End

CCW — Mill, Lathe, EDM 

This is the letter and number for counterclockwise arcs.

CCW G3

Related Commands: CW, CircDir

CDC — Mill 

This command is used to identify the two letters (usually P and Q) to be included on all movement lines for the Cincinnati style DComp vectors.

CDC P Q

Related Commands: DComp, LComp

 CircDir — Mill, Lathe, EDM 

Machines that have one event code for an arc move must also specify the direction of rotation. This command must be followed by a letter and two numbers, the first for clockwise and the second for counterclockwise moves.

CircDir D01  # There are no spaces between the numbers.

This places D0 on circular moves in the clockwise direction and D1 on the counterclockwise moves.

Related Commands: CCW, CW

 Comment — Mill, Lathe, EDM 

Comment indicates the CNC style comment start and end characters that the machine uses to allow comments in the NC code. On some machines, comments must be enclosed in parentheses.

The post processor will automatically output several lines of end user comments after the StartCode sequence, providing additional shop floor documentation. These automatic comments list the NCC file, INC file, date, time, company name, and address. There are several methods to control the output of comments in the POSTFORM file including:

There should be a single space before the beginning and ending comment characters. Some machines do not need an end comment character; in this case, just indicate the comment start character:

UpperCaseComments? Y

# Comments are output in upper case

UpperCaseComments? N

# Comments are output in upper and lower case

Comment (

# Comments are preceded by an open parenthesis

Comment !(

# Comments are preceded by an open parenthesis and no N numbers

Comment ( )

# Comments are surrounded by parentheses

Comment !( )

# Comments are surrounded by parentheses and no N numbers

Comment ( )$

# Comments are surrounded by parentheses for Dynapath controls

Machines that use only a comment start character will ignore after the comment character.

Note   When the machine tool does not support comments, do not enter the Comment command in the POSTFORM file.

Notes:

# Beginning of Post notes

Lines between Notes: and EndNotes are treated as comments and are not posted to the NCC file.

EndNotes

# End of Post notes

Related Commands: UpperCaseComment?

 

The Comments command dictates exactly where comments will appear in the output. It can be used in any sequence, but it makes the most sense to put it in the 1stToolChange, ToolChange and RapidCode sequences as in the examples below. (When working with 4 axis mill formats, then you should also include one in your Index sequence.)

Note: The Comments command replaces the earlier [CommentDelay] variable. We highly recommend that you update any templates that you may have that use the [CommentDelay] variable so that they instead use the (much better) Comments command.

When the template includes a Comments command, PostHaste will 'store' all comments coming in from the CL file until a 'Comments' command is found while processing the output. (Before this command was available in PostHaste, the 'operation and/or tool change comments' would typically appear in the code before the ToolChange sequence started - which resulted in the comments appearing too early in the code. This means that on most machines, the comments would scroll off the top of the screen by the time the tool change [M6] was executed.)

NOTE: Because the post now 'stores' the comments coming in from the CL file until a Comments command is executed, it is very important that you include a Comments command in all applicable sequences (1stToolChange, ToolChange, RapidCode [and Index, when applicable]). If you do not do this, then the comments for several operations may appear 'stacked up' in the same place in the code!

Thus, when using the Comments command, make sure your format includes a valid RapidCode sequence with a Comments command in it!

Examples:

RapidCode          Rapid moves w/ NO rotary.

Comments

G0 X[H] Y[V] Z[D]

end

 

1stToolChange First tool change

G0 G[Work] G40 G80 G90 B0

T[Tool] M6

Comments

G90 G0 X[H] Y[V]

G43 Z[D] S[Speed] M[Direct] H[LComp]

End

 

ToolChange Secondary tool changes

M9

g28 g91 Z0

T[Tool] M6

Comments

G90 G0 G[Work] X[H] Y[V]

G43 Z[D] S[Speed] M[Direct] H[Lcomp]

End

 

Note: In the latest version of the post, you don't have to add a RapidCode command to prevent 'comment buildup': the post automatically executes a 'comment dump' before every rapid - even if there is no RapidCode.

 

Coolant — Mill, Lathe, EDM 

Note: Surfcam EPost (Wire EDM) users may use the Flush command in place of the Coolant command - they are exactly the same. Likewise, the [Flush] variable may be used in the sequences instead of [Cool].

In other words, the Flush and Coolant commands are completely interchangeable, and the [Flush] and [Cool] variables are interchangeable as well.

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

   For Surfcam Mill or lathe (MPost or LPost):

Coolant 8 9 7 61 62 88 89   Flood, Off, Mist*, Lo, Hi**, Thru Lo**, Thru Hi**   

   For Surfcam EDM (EPost - these correspond to the Flushing setting in the 'tool information' dialog):

Coolant 8 9 7 61  Low, None, Medium, High

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

** Since Surfcam supports the additional types of coolant, the OEM version of PostHaste that is packaged with Surfcam [a.k.a. Mpost or LPost] has these 3 additional modes available.)

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 - will be as shown in this table:

For APT-CL versions of PostHaste:

For Surfcam Mill or Lathe (Mpost or LPost) version:

For Surfcam EDM (EPost) version:

Flood = 1   (  If [Cool] = 1 ... )*
Off = 0       ( If [Cool] = 0 ... etc. )*
Mist = 2
THRU or HIGH = 3

Flood = 1   (  If [Cool] = 1 ... )    
*Off = 0       ( If [Cool] = 0 ... etc. ) *
Mist = 2
Flood Low = 3
Flood High = 4
Thru Low = 5
Thru High = 6

Low = 1
None = 0
Medium = 2
High = 3

 

 

* Note that the COOLANT line (the 'M code list' you see in the template) lists all of the values in ascending order from ZERO except for the first two:  FLOOD is first (1) and OFF is 2nd (0).

CtrCode — Mill, Lathe, EDM 

This command should be followed by one or two letters*, depending on which method of arc center point designation you want in the NC code. The two letters are usually I and J for milling; the first letter is the horizontal center designation and the second is the vertical. The one letter center configuration is used for radius designation. When only one letter is entered after CtrCode, then the radius value is coded.

* If ArcPlane is used, you will need the letter K after I J. See ArcPlane — Mill Only.

For the following examples, a 90 deg. arc of radius 2.5, center at X1. Y1., starting at X3.5 Y1. and ending at X1. Y3.5 is cut in the counterclockwise direction.

 

Mill, Lathe

 

 

CtrCode I J

# Outputs G3 X1. Y3.5 I-2.5 J0

 

CtrCode R

# Outputs G3 X1. Y3.5 R2.5

 

 

 

 

EDM

 

 

CtrCode I J K L

# Outputs K and L for 4 Axis Wire Aux. plane

 

 

# Circle center codes.

Note   The formats for the letters K, and L must be set in the letter format section of the POSTFORM.E file.

Note   The programming mode must be absolute for 4 Axis: “INCREMENTAL? Y” line is not allowed in the POSTFORM.E file.

Arc center codes for UV, typically K and L, are assumed to be incremental from the start of the UV plane arc. When the K and L values must be incremental from the I and J values of the XY plane enter another Y after the CtrIncremental? parameter.

Related Commands: 2ndCircleCode, ByDiameter?, ByQuadrant?, CtrIncremental?

CtrCode>180 — Mill, Lathe, EDM 

With this command you can use the R letter designation to code arc moves greater than 180 degrees and less than a full circle. This can be accomplished by coding the following letter address and command sequence. The letter format used is the same as the CtrCode command.

r ->3.>4 R Mult -1

This outputs a -R for the arc center to break arcs greater than 180 degrees.

CtrCode>180 R# Outputs G3 X1. Y3.5 R-3.5

Related Commands: CtrCode, CtrCode360

CtrCode360 — Mill, Lathe, EDM 

When the CtrCode>180 command is used, this command is used to code full circle arcs. This command also requires the Word Address format as described above. The letter format used is the same as the CtrCode command.

Related Commands: CrtCode, CtrCode>180

CtrIncremental? — Mill, Lathe, EDM 

The information after this command is only used if the two letter CtrCode is used to indicate the center point of the arc. Enter a Y or N after the CtrIncremental? command to define whether the machine measures the center of the arcs incrementally from the start point of the arc. The numerical values of the two Center addresses will be taken as absolute from the program origin when an N is entered.

This example uses a 90 deg. arc of radius 2.5, center at X1. Y1. starting at X3.5 Y1. and cutting to X1.0 Y3.5 in a counterclockwise direction.

 

Mill, Lathe

 

 

CtrIncremental? Y

# Outputs G3 X1. Y3.5 I-2.5 J0

 

CtrIncremental? N

# Outputs G3 X1. Y3.5 I1. J1.

 

 

 

 

EDM

 

 

CtrIncremental? Y N

# Y Y causes K & L to be incremental from I & J.

 

 

# Y N causes K & L to be incremental from the

 

 

# arc start.

Note   The formats for the letters K and L must be set in the letter format section of the POSTFORM.E file.

Note   The programming mode must be absolute; the “INCREMENTAL? Y” line is not allowed in the POSTFORM.E file. When incremental output is desired, use the individual Word address method instead. See Incremental Output.

Note   UV plane axis positioning values for Wire EDM are absolute values unless otherwise indicated in the letter format section of the POSTFORM.E file. When the U and V values for Wire EDM are to be incremental from the X and Y values on the same line, format the U and V letters as follows:

Note   U ->3.>4 IncFrom X

Note   V ->3.>4 IncFrom Y

Note   Arc center codes for UV, typically K and L, are assumed to be incremental from the start of the UV plane arc. When the K and L values must be incremental from the I and J values of the XY plane, enter another Y after the CtrIncremental? parameter.

CtrIncremental? Y Y

Related Commands: 2ndCircleCode, CtrCode, ByDiameter?, ByQuadrants?

CW — Mill, Lathe, EDM 

This command identifies the letter and number for clockwise arcs.

CW G2

Related Commands: CCW, CircDir

DCode — Mill, Lathe 

These are followed by the character that corresponds to their function. The DCode command corresponds to the depth moves of the INC file. This is typically the Z word.

DCode Z

Related Commands: DCode2, HCode, HCode2, VCode, VCode2, FeedCode

DCode2 — Lathe 

This word format specifies the letter address to use to move the second turret depth.

DCode2 W

Related Commands: DCode, HCode, HCode2, VCode, VCode2, FeedCode

DComp — Mill, Lathe 

The three 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

Related Commands: CDC, LComp

Drive — Mill, Lathe, EDM 

You can assign a path name (drive and folder name) that will determine where the finished NC program will be created. Simply add a line like the one below to route the code to the desired folder:

Drive \mill\

There must be a trailing back slash (\).

It is recommended that the Drive line be added after the Name line. Each different machine format can have a different Drive line, which enables you to automatically route NC programs for each machine into its own folder.

In addition to (or instead of) having a separate Drive line for each machine, you can place a Drive line at the very top of the POSTFORM file. All NC programs can be routed to this folder unless the machine chosen has its own Drive line, in which case the machine's drive designation will be used.

Dummy for Columnar Style — Mill 

The character input after Dummy is a character that will appear at the end of each line of a columnar style program to indicate the end of the line. The Dummy line is not used when the format is not columnar.

Note   The items Spaces and Dummy are used only in columnar style programs.

Related Commands: EOB, Each, Spaces

Each — Mill, Lathe, EDM 

Some machines require a particular word, a letter followed by a number, on each line. The machine may require a dollar sign ($) character at the end of each line, in addition to the standard CR/LF end of block characters.

Therefore, enter this line in the POSTFORM file for that machine:

Each $0

In this example, to output just the dollar sign without the 0 following it, format the dollar sign to output no digits by giving it the format:

$ 00

Note   This needs to be entered in the Word Address Formats section and the POSTFORM it gets output from is determined by the Word Address Format section.

Related Commands: Dummy, EOB

EOB — Mill, Lathe, EDM 

EOB stands for “End Of Block”. Some NC machines require a character other than a standard line feed / carriage return combination between each line of code. The EOB line can be used to change the End Of Block code to any ASCII character. For instance, if a machine requires a number sign character (#), then place the number 35 after EOB in the POSTFORM file. The number 35 is the ASCII value of the number sign character:

EOB 35# ASCII Value

This will cause the post to use the number sign instead of the standard carriage return / line feed combination at the end of each line of NC code.

You can enter as many as twenty numbers for EOB characters. These twenty characters are output for each line.

EOB 13 10

This outputs a carriage return and line feed at the end of each block.

Related Commands: Dummy, Each

Feed — Mill, Lathe, EDM 

The following lines indicate the linear Feed Rate movement codes:

Feed G1

Here a G1 indicates that a move at the specified feed rate is going to be programmed in this block.

Related Commands: FeedCode, FeedType, Rapid, SpeedType, VRapid

FeedCode — Mill, Lathe, EDM 

This function specifies the character to use for Feedrate output.

FeedCode F

Note   SURFCAM requires tool motion to be present before outputting a FeedCode.

Related Commands: Feed, FeedType, DCode, DCode2, HCode, HCode2, VCode, VCode2

FeedType — Mill, Lathe, EDM 

This command specifies the appropriate G codes for IPR and IPM output.

FeedType G 95 94

This entry will output a G95 for IPR and G94 for IPM codes.

Related Commands: Feed, FeedCode, SpeedType, VRapid

First#? — Mill, Lathe, EDM 

This switch determines whether the Block number is output on the first line of the program or omitted. Enter Y or N for the desired output. The example below will omit a number on the first line of the NC program.

First#? N

Related Commands: Last#?, Sequence#s

HCode — Mill, Lathe, EDM 

These commands are followed by the character that corresponds to their function (the H, V, and D in the first 3 stand for Horizontal, Vertical, and Depth, respectively). For standard milling, these characters are almost always X, Y, Z.

 

Mill, Lathe

 

HCode X

 

 

 

EDM

 

HCode X U

The letter U indicates the auxiliary horizontal plane movement for Wire EDM.

Note   The formats for the letter U must be set in the Letter Format section of the POSTFORM.E file.

Note   UV plane axis positioning values for Wire EDM are absolute values unless otherwise indicated in the letter format section of the POSTFORM.E file. When the U and V values are to be incremental from the X and Y values on the same line, format the U and V letters as follows:

U ->3.>4 IncFrom X

V ->3.>4 IncFrom Y

Related Commands: DCode, DCode2, HCode2, VCode, VCode2, FeedCode

HCode2 — Lathe 

This word format specifies the letter address to use to move the second turret horizontally.

HCode2 U

Related Commands: DCode, DCode2, HCode, VCode, VCode2, FeedCode

Helical? — Mill 

This switch defines whether or not the machine tool allows helical move. When the machine tool accepts helical moves this command should be entered as Y. The output code would then utilize the designated axis for the helical moves.

Helical? Y# Outputs Z axis helical moves.

Helical? N# Outputs point to point linear moves.

Linear moves are at a tolerance set by the MaxRad command.

Related Commands: CW, CCW, CtrCode, CtrIncremental?, MaxRad

Inc/Abs — Mill, Lathe, EDM 

The Inc/Abs line indicates the numerical values of the G code that set the incremental or absolute programming mode on the NC machine. The post processor issues a warning message when a mode change command is processed. For most machines it is G91 and G90:

Inc/Abs G 91 90

Note   Referto Incremental? — Mill, Lathe, EDM.

Related Commands: Incremental?

Inch/MM — Mill, Lathe, EDM 

The Inch/MM line indicates the numerical values of the G code that set inch or millimeter programming mode on the NC machine. For most machines it is G70 and G71. When this command is not used, the G70 or G71 code is the default. This command is not required when the G70 / G71 codes are used by the machine tool. The example below is entered in the POSTFORM file for a machine tool that uses G20 and G21 for inch and millimeter mode.

Inch/MM 20 21  # Inch Metric

Incremental? — Mill, Lathe, EDM 

This switch is used to set the machine output to the Incremental, or Absolute, mode.

Incremental? Y

This will cause the code to be output in Incremental. The machine may also require a G91. Ensure that a G91 code is placed in your StartCode or 1stToolChange sequence.

Note   The Y can easily be changed to an N to result in absolute programs. Remember to remove the G91 in your StartCode or 1stToolChange sequence. When absolute and incremental programs are both used regularly, create two appropriate posts within the POSTFORM file.

Note   See Inc/Abs — Mill, Lathe, EDM.

Related Commands: Inc/Abs

Last#? — Mill, Lathe, EDM 

This switch determines whether a Block number is output on the last lines of the program or omitted. Enter a Y or N for the desired output. The example below will output a block number on the last line of the program.

Last#? Y

Related Commands: First#?, Sequence#s

LComp — Mill, EDM 

Similar to DComp, the two values following the LComp command indicate the values used for the words that activate and deactivate the machine's tool length compensation function, respectively.

LComp 43 49# On, Off

Related Commands: CDC, DComp

Leading0s? — Mill, Lathe, EDM 

By default, the post puts a “leading zero” on any number whose absolute value is less than one. For instance: “X0.1” instead of “X.1” and “Z-0.5” instead of “Z-.5.” If your machine does not require the leading zeroes, then use this switch with a “Y” to eliminate them (thereby producing somewhat more compact code).

MaxRad — Mill, Lathe, EDM 

This command sets the limit size of the arcs the machine can perform. When an arc is larger than the limit size, the post breaks the arc into linear moves. The second parameter is the amount of chordal deviation from the original arc.

MaxRad 99 .001# Limit Tolerance

This command directs the post to process all arcs with a radius of 99 inches or less. Those arcs larger than the 99 inch radius are broken into linear moves with a chordal deviation of .001 from the original arc.

Related Commands: ArcWithLine, ArcWithSame, MinRad

MinRad — Mill, Lathe, EDM 

This command sets the minimum size of the arcs the machine can perform. When an arc is smaller than this value it is output as lines. The default value is .001.

MinRad .001  # Tolerance

Related Commands: MaxRad

MOD

This command is a MODULO function in that it returns the remainder when one number is divided by another. It is useful in working with rotary tables to insure that the code is never greater than 360 (or -360).

The format of the command is “number1 MOD number2”. Such an expression will always return a value “x” in the range of “-number2 < x < number2”. Some examples are:

 

45 mod 360 = 45

 

 

390 mod 360 = 30

30 is remainder when 390 is divided by 360

 

720 mod 360 = 0

360 divides evenly into 720

 

-370.2 mod 360 = -10.2

 

Modality 

   ModalGs — Mill, Lathe, EDM 

This is simply a list of all the G values that are modal. This means that any G code in the list will remain in effect, and not be repeated, until another G code from the list is called. 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.

ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85

Related Commands: ModalLetters

   ModalLetters — Mill, Lathe, EDM  

This line contains a list of all the letters that typically indicate modal values. On most machines this should be:

ModalLetters X Y Z F

If the ModalLetters line is not placed, then the above defaults are used. The letters used in conjunction with the RotAngle and VClear variables are also assumed to be modal when the ModalLetters line is not used.

ModalLetters

Related Commands: ModalGs

   Force? 

The “FORCE?” modifier can now be added to all sequences (except “Point to point” cycles [DRILL, REAM, BORE, BACK, TAP, LTAP, PECK]). You can use this option to tell the post to suppress unchanged values (by using “Force? N”) within the sequence, or to force all words to be output (“Force? Y”). For instance, if you want all arc letters to be output, use the “Force” modifier on the CWCode and CCWCode lines like this:

CwCode Force? Y

...

CCwCode Force? Y

...

Although this modifier cannot be added to the drilling cycles, it CAN be added to the CANCEL, INDEX, UPON and UPONREC sequences. If added to sequences that use other parameters, it must be placed AFTER the other parameters as in these examples:

Index X Z Force? Y

Upon [tool] Force? Y

Notes:

   1.   The default state of these sequences is “Forced”: StartCode, 1stToolChange, ToolChange, SubStart, SubEnd, SubCall, Index, Cancel, EndCode.

   2.   All canned cycles (Drill, etc.) “Force Y” the 1st hole, but then are “modal” for the subsequent holes (the equivalent of “Force? N”).

   3.   All other sequences are modal (the equivalent of “Force? N”)—Rapid, Linear moves, In/Outfeed, Arcs.

Rapid — Mill, Lathe, EDM 

The following lines indicate the Feed rate and Rapid movement codes:

Rapid G0

The G0 indicates that a rapid move is to be programmed in this block.

Related Commands: Feed, FeedType, SpeedType, VRapid

ReturnPlane — Lathe, Mill

The ReturnPlane command sets the value for the [RetPlane] variable. This controls the Z level Return Plane between holes when drilling. (Typically G98, G99)

ReturnPlane 98 99

Related Variables: RetPlane

Rename

The Rename command lets you to make up any name you want, for any variable.

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]      ( << Note: This is NOT recommended! See NOTES below. )

NOTE! Care must be taken to NOT use a variable that is one of the 'automatically prompted' variables ( [Work], [EndH], [EndV], [MaxRPM], [Program#], [ToolH], [ToolV], [ToolD], [WorkH], [WorkV] and [WorkD]), because if you Rename one of those, the post will still prompt you as if you were using the original variable. (See section 9.1.1.7 for more information on the prompted variables.)

2nd NOTE! Another thing you have to watch out for when renaming variables other than [Val1] to [Val20] is that the value of almost all of the other variables can be affected by data coming in from the CL file. This means that if you use a variable besides Val1 to Val20 like this...

   Rename [LComp] to [XMultiplier]   

...your [XMultiplier] variable will be set to the incoming tool length compensation number whenever a new tool is described in the CL file!  

With the above said, it is certainly OK to simply change the name of a variable that you don't like if you expect to continue using that variable for its original purpose. For example, this would make sense:

Rename [LComp] to [LengthCompensationNumber]

...however, most of the time, you will want to rename the user variables ([Val1] to [Val20]) instead - for the reasons stated above.

RenumSubs? — Mill 

You can reset the line numbers at the beginning of each Subprogram and the main program. When this command is not used, the line numbers are not reset at the beginning of each Subprogram and the main program.

RenumSubs? Y

Note   When this command is entered as Y, the Subline variable should not be used.

Related Commands: Subs1st?

Note   See Subprogram Output and Block Number Output.

Replace — Mill, Lathe, EDM 

Up to 50 Replace commands can be added to the POSTFORM file to search and replace certain phrases with others. The following are example lines within the POSTFORM file.

Replace “G2 ” with “DR- ”

Replace "G3 ” with "DR+ ”

Replace “T” with “TOOL DEF ”

Notice that both the phrase to be replaced and the new phrase are enclosed in quotes. This is necessary in order to be able to search and replace phrases with embedded spaces, such as TOOL DEF. Unlike all other areas of the POSTFORM file, phrases with quotes are always case sensitive. Do not use “g3” when you really want to search for “G3”. The commands Replace and With can be upper or lower case.

Each line of outgoing NC code will be scanned for each Replace line in the machine format. Only the first occurrence of the Replace phrase is replaced in each line. Using the example above, the line “G2 T1 G2 X0” would end up as “DR- TOOL DEF 1 G2 X0”. Notice that the second G2 is not replaced because it was found earlier in the line.

Note   Spaces within the search phrase can be used to prevent unwanted replacements. In the first example, if we had used a “G2” and “DR-”, without the trailing spaces, it would cause all “G28” words to end up as “DR-8”.

Also, if more than one Replace line are used in a format, they are performed in the order that you specify. This means that there is a possibility that code can be inadvertently replaced twice. In the following example, Replace lines are used in the following order:

Replace “T” with “TOOL DEF ”

Replace “D” with “DIAM. ”

The “D” in “TOOL DEF” will be replaced with “DIAM. ” like this:

“T1” will be changed to: “TOOL DIAM. EF 1" instead of “TOOL DEF 1"

To prevent this from happening, just reverse the order of the Replace lines so the D is replaced before the T.

Note   Limits are not checked on phrases that are the result of a Replace command. In other words, if code is inadvertently replaced with another phrase that is beyond a particular limit, then no warning will appear. The size of the search phrase in a Replace line is limited to 10 characters, and the replace phrase is limited to 40 characters.

The NoComment option

If you want to prevent a 'replacement' from occurring within program comments, then add the word NoComment  to the end of the Replace line like this:

Replace 'A' with 'A-' NoComments

 Notes

- You may use either NoComment or NoCommentS: the post will figure it out either way.

- Reminder: As always, the Replace command (still) only acts ONCE per line.

- The NoComment option will only prevent the FIRST comment on the line from having a 'replace' performed. In other words, if there is MORE THAN ONE COMMENT on the line, the second comment will not be 'protected' from the replace. (This shouldn't raise any problems; I can't remember the last time I saw a line of code with more than one comment on it...)

- The NoComment option may be used in conjunction with the All option below. (The options may be listed in either order.)

The ALL option

Unless you use the All option, a Replace command  is only performed once per line of output. This means that if you have more than one occurrence per line of something that needs to be replaced, just add the word ALL to the end of the Replace line like this:

Replace '_' with ' ' All

As mentioned above, the All option may be used in conjunction with the NoComment option like this:

Replace ',' with ', ' All NoComments

   Or:

Replace 'X' with 'X-' NoComments All

NOTE: Since the All option causes the replacement process to repeat until all occurrences are replaced, be careful not to create an 'infinite loop' with your Replace...All commands. This happens when your 'new' phrase contains the 'old' phrase like this...

   Replace '99' with '999' All

... 99 becomes 999, which gets 'replaced' again and becomes 9999, then 99999, then 999999, etc. ad infinitum.

If left unchecked, this would continue until all memory and disk space have been consumed, followed by a crash of your PC's operating system. (Suffice it to say that infinite loops are a bad thing...)

Fortunately, we limit the post's 'replace... all' to 100 repetitions – more than enough to get your job done, but far less than would ever cause any problems on your computer. PostHaste gives you a warning (and then aborts) if a Replace is repeated more than 100 times on any

RevSigns — Mill, Lathe, EDM 

This is a list of characters that need to have their signs reversed. Some machines require the Z+ direction to be toward the spindle. The example below reverses the sign of the letters Z and X.

RevSigns Z X

An indefinite number of letters can be placed on this line.

Related Commands: RevTurret2?

RevTurret2? — Lathe 

This word format globally reverses all X values when the second turret is active. You can enter a Y for yes or N for no to reverse the X values for the second turret.

RevTurret2? Y

Related Commands: RevSigns

Sequence#s — Mill, Lathe, EDM 

This line defines the Block numbers output in the NC program. There are four parameters required and placed in order on this line:

Character

The first character after the command is the 1st character of the block number. These examples show the code and output for the commands using the letter N and the : symbol.

Note   The letter or symbol used must be in the Word Address format.

Sequence#s N 1 1 1

The output

1stToolChange

 

M6 T[Tool]

N1 M6 T1

G0 G90 S[Speed] M[Direct]

N2 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N3 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N4 H1 M7 Z.1

End

 

The following example uses the letter C with the Replace command to output the : symbol for each block number.

: >2

Sequence#s : 1 1 1

The output

1stToolChange

 

M6 T[Tool]

:1 M6 T1

G0 G90 S[Speed] M[Direct]

:2 G0 G90 S2000 M3

E[Work] X[H] Y[V]

:3 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

:4 H1 M7 Z.1

End

 

Frequency

A number here indicates how often a block number is placed on a line. To output a number on every line, enter a 1. To output a number on every other line enter a 2. Entering the number 10 will output a block number every ten lines. The following examples show the code and output for the parameter.

Sequence#s N 1 1 1

The output

1stToolChange

 

M6 T[Tool]

N1 M6 T1

G0 G90 S[Speed] M[Direct]

N2 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N3 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N4 H1 M7 Z.1

End

 

The following example indicates a Frequency of 2 to output block numbers on every other line.

Sequence#s N 2 1 1

The output

1stToolChange

 

M6 T[Tool]

N1 M6 T1

G0 G90 S[Speed] M[Direct]

G0 G90 S2000 M3

E[Work] X[H] Y[V]

N2 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

H1 M7 Z.1

End

 

Note   Use a frequency of 0 not to output the block numbers on each line. The post will only put them where they are requested.

Increment

This is the value by which the block number is incremented before the next output. Using the value of 10 will create block numbers in the block address itself as 10 greater than the last block number.

Sequence#s N 1 10 10

The output

1stToolChange

 

M6 T[Tool]

N10 M6 T1

G0 G90 S[Speed] M[Direct]

N20 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N30 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N40 H1 M7 Z.1

End

 

Start value

This is simply the value of the very first block number that appears in the code; numbers after the first are determined by the start value plus a multiple of the Increment.

Sequence#s N 1 2 100

The output

1stToolChange

 

M6 T[Tool]

N100 M6 T1

G0 G90 S[Speed] M[Direct]

N102 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N104 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N106 H1 M7 Z.1

End

 

Note   See Block Number Output.

Spaces for Columnar Style — Mill, Lathe, EDM 

The number on the Spaces line is used only in columnar style programs and determines the length of every line of the program. This line must appear in the POSTFORM file before the letter formats for each format that uses this programming style, otherwise the words will not be placed correctly in the NC program.

Note   Do not confuse this setting with the Spaces? switch.

Related Commands: Dummy

Spaces? — Mill, Lathe, EDM 

This switch is used to suppress the insertion of space characters between each word of the NC program. When using communication software that does not strip out spaces automatically, use the following line to prevent the post from putting spaces between each word:

Spaces? N

The output

1stToolChange

 

M6 T[Tool]

M6T1

G0 G90 S[Speed] M[Direct]

G0G90S2000M3

E[Work] X[H] Y[V]

E1X0Y0

H[Lcomp] M[Cool] Z[D]

H1M7Z.1

End

 

Note   Do not confuse this line with the Spaces setting mentioned above in the Letter Formats section.

SpeedCode — Mill, Lathe, EDM 

This command specifies the character to use for Spindle Speed output.

SpeedCode M

Note   SURFCAM requires tool motion to be present before outputting a FeedCode.

Related Commands: SpeedType

SpeedType — Lathe 

This command specifies the appropriate G code for RPM and CSS output.

SpeedType 97 96  # RPM and CSS

This entry will output a G97 for RPM and G96 for CSS codes.

Related Commands: Feed, FeedType, Rapid, VRapid

Spindle — Mill, Lathe 

The Spindle command is followed by 3 numbers that correspond to clockwise, counterclockwise and spindle stop. Most machines use M3, M4, and M5 for these codes. The following line indicates these functions.

Spindle 3 4 5# CW CCW Stop

Subs1st? — Mill 

This command defines the location of the Subprograms in relation to the main program. Enter a Y for the Subprograms to be output before the main program. An N outputs the Subprograms after the main program. This command is only entered in the POSTFORM file when Subprograms are desired. When this command is not used, the Subprograms are automatically placed before the main program.

Subs1st? Y

Related Commands: RenumSubs?

Tolerance — Mill, Lathe, EDM 

This command is used to set the value to round off the output.

Tolerance .0002

The example above causes only even numbers to be output in the 1/10,000ths column.

Tools — Mill, Lathe 

This line is used only with tool indexers that require incremental T numbers. In other words, the value of the T number is the number of indexes required to reach the desired tool, not the tool number.

Note   Make sure there is no Tools line in any section of a POSTFORM that describes a machine not having this incremental tool change. This could cause the machine to work improperly.

UpperCaseComments? — Mill, Lathe, EDM 

You can output either all upper case letters or upper and lower case letters for comments. Enter the command with the letter Y to convert all comment letters to upper case letters.

UpperCaseComments? Y

Related Commands: Comment

VCode — Mill, Lathe, EDM 

These commands are followed by the character that corresponds to their function. The h, v, and d in the first 3 commands stand for Horizontal, Vertical, and Depth, respectively. For standard milling, these characters are almost always X, Y, Z, and F.

 

Mill, Lathe

EDM

 

VCode Y

VCode Y V

The letter V indicates the auxiliary vertical plane movement.

Note   The formats for the letter V must be set in the letter format section of the POSTFORM.E file.

Note   UV plane axis positioning values are absolute values unless otherwise indicated in the letter format section of the POSTFORM.E file. When the U and V values are to be incremental from the X and Y values on the same line, format the U and V letters as follows:

U ->3.>4 IncFrom X

V ->3.>4 IncFrom Y

Related Commands: DCode, DCode2, HCode, HCode2, VCode2, FeedCode

VCode2 — Lathe 

This word format specifies the letter address to use to move the second turret vertically.

VCode2 V

Related Commands: DCode, DCode2, HCode, HCode2, VCode, FeedCode

VRapid — Mill 

This command is used to output additional code before the VRapid letter output. This can be used for some Bandit controls.

VRapid /0

The example above outputs a slash before the letter for all rapid moves.

Related Commands: Feed, FeedType, Rapid, SpeedType

WindowSize

If your post window is too small (if any of the buttons are missing or only partially visible) then you can configure the width and height (in pixels) of the main PostHaste window.

Work — Mill, Lathe 

This line is used to identify the letter designation of work offsets. Typically the letter G is used for work offset designation. Machine tools may use different letters to identify the work offset. When this is the case change the Work command to indicate the proper work offset letter. The example below is for a FANUC style control.

Work G

This example can be used for a FADAL control.

Work E

Related Commands: WorkDefault

WorkDefault — Mill, Lathe 

This line is used to identify the number of the default work offset. The FANUC control begins with number 54 while the FADAL control begins with the number 1. When this command is not entered the default number used by the post processor is 54.

WorkDefault 1

Related Commands: Work

ZRestart? — Mil 

This switch allows for machine formats that do not require the canned cycles to be restarted for each change in the depth or clearance plane values. If this parameter is not used in the POSTFORM file, and the Z or R values change during a cycle, the cycles will be cancelled if necessary, then restarted. To prevent this from occurring, enter the following line in the POSTFORM file:

ZRestart? N# The N means No

Leaving this line out or using the line 'ZRestart? Y' will cause the following type of output on a sample where the holes are all the same incremental depth, but start at different levels.

Notice both the R and Z values change:

G81 X-1.834 Y0.4503 Z0.4079 R1.0079 F4.0

G80

G81 X-1.1283 Y0.6773 Z0.1177 R0.7177 F4.0

G80

Placing 'ZRestart? N' in the format will suppress the cancel and restart codes and result in this output:

G81 X-1.834 Y0.4503 Z0.4079 R1.0079 F4.0

X-1.1283 Y0.6773 Z0.1177 R0.7177

X0.4427 Y0.9409 Z-0.1445 R0.4555

G80

Note   Some machines can handle changing Z and R values when in incremental mode but not in absolute.

<