Sie sind auf Seite 1von 12

Volume 1

Chapter 3 Changes to the MP Post

Changes to the MP Post


This chapter describes new post writing techniques appropriate for use with modern posts, and also
lists changes made to recent releases.

Tool change after technique


The tool change after routine is a modified NCI file reading method that reads past the tool change
NCI Gcode 1000, 1001 and 1002 and into the first rapid or linear NCI Gcode before calling the
standard output postblocks for a tool change. The reasons for developing the technique are:
!

The rapid position on the tool change NCI Gcodes sets the values for the variables x, y and z. This
would cause a modal condition and the rapid move after the tool change was skipped. Often
critical data such as feed rate and contour flags were not read.

The post customization file had to delay the call to the tool change output postblock to handle drill
and thread toolpaths.

5-axis toolpaths could not set the rotation angles in the tool change block because no vector data is
present on the tool change NCI Gcodes.

Starting in Mastercam Version 8, all tool change NCI blocks must repeat the rapid position after the
tool change NCI Gcode 1000, 1001 and 1002 line. This resolves a problem with earlier NCI forms for
drill cycle and lathe threading toolpaths where no rapid appeared after the tool change NCI Gcode
1000, 1001 and 1002. These formerly were handled as special cases in the post customization file,
with the rapids being generated from within the postblocks called by the drill cycle or lathe threading
toolpath.

Enabling the tool change after technique


Setting the post switch variable tlchng_aft to 2 for all modern posts enables this technique. When
enabled, the post executable calls the postblock ptlchg1002 where the standard tool change postblocks
were formerly called (NCI Gcode 1000, 1001 and 1002). At the next NCI Gcode read, the standard
tool change postblock is called if it is a valid motion postblock. Otherwise, the post executable
processes based on the NCI Gcode as usual. If the next NCI Gcode read is not a valid motion
postblock, the process continues until a valid motion postblock is read. After the standard tool change
postblock is called, the original valid motion postblock is also called if it is marked as a recall
postblock; otherwise it is skipped.

June 2002

Mastercam Version 9 MP Post Processor Reference Guide 3-1

Chapter 3 Changes to the MP Post

Volume 1

The table that follows lists the recall status of each valid motion postblock.

Postblock recall status


Mill/Lathe

Recall?

Wire

pmx

no

pedm

pmx1

no

pedm1

no

pmx2

no

pedm2

no

prapid

no

pedm3

no

pzrapid

no

prapid

no

plin

no

pzrapid

no

plin1

no

plin

no

plin2

no

plin1

no

pz

no

plin2

no

pz1

no

plin3

no

pcir

no

pz

no

pcir1

no

pz1

no

pcir2

no

pcir

no

mrapid

no

pcir1

no

mlin

no

pcir2

no

mcir

no

pcir3

no

lrapid

no

pcan1

yes

llin

no

pcan2

yes

lcir

no

pcan3

yes

pg32

yes

pcan4

yes

pg76

yes

pcan5

yes

pg92

yes

pcan6

yes

pthrg32_1

yes

pcan7

yes

pthrg32_2

yes

pcan8

yes

pthrg32_3

yes

pthrg32_4

yes

pthrg92_1

yes

pthrg92_2

yes

pthrg92_3

yes

3-2 Mastercam Version 9 MP Post Processor Reference Guide

Recall?

June 2002

Volume 1

June 2002

Chapter 3 Changes to the MP Post

Mill/Lathe

Recall?

pthrg92_4

yes

pthdface

yes

pdrill3

yes

pdrill5

yes

pdrill

yes

ppeck

yes

pchpbrk

yes

ptap

yes

pbore1

yes

pbore2

yes

pmisc1

yes

pmisc2

yes

mdrill

yes

mpeck

yes

mchpbrk

yes

mtap

yes

mbore1

yes

mbore2

yes

mmisc1

yes

mmisc2

yes

ldrill

yes

lpeck

yes

lchpbrk

yes

ltap

yes

lbore1

yes

lbore2

yes

lmisc1

yes

lmisc2

yes

Wire

Recall?

Mastercam Version 9 MP Post Processor Reference Guide 3-3

Chapter 3 Changes to the MP Post

Volume 1

If the postblock valid motion postblock is skipped, it is assumed that you are generating the NC output
from the tool change postblock. Dont forget to do this with the null tool change postblock call.
Caution: Do not add this feature to an older post that was not written or modified for the tool change
after technique. In addition, if the rpd_typ_v7 numeric variable is set to 1 in the post customization
file, the technique should not be enabled until the post customization file logic to call back to tool
changes and output positions for rapid with drill and thread has been modified to work with tlchng_aft
set to 2 and rpd_typ_v7 set to 0. See rpd_typ_v7 in Volume 3, Numeric Variables.
Note: It is generally easier to modify a modern post than to alter an existing post processor.

Do not use the rapid position variables (xr, yr, zr)


Use of the output line variables xr, yr, zr in a modern post is not recommended. These same values are
used with x, y, z output line variable at the tool change postblock call. Using them causes modality
problems with x, y, z. In any version post customization file, they should never be used as rapid
motion output in the postblocks prapid and pzrapid. The values are only assigned at the tool change
when the NCI file is read. The best practice is to use the x, y, z variables as the source for rapid and
linear feed motion.

Absolute / incremental support


In many of the modern released post processors, support for absolute and incremental output as been
added. We recommend doing the incremental calculation internally in the post customization file. Use
of Format Statements (fs with the incremental option active) for incremental output support is not
recommended.
In modern post customization files, separate user-defined output variables have been created (xabs, xinc,
etc.) for both the absolute output and the incremental output. This allows the post writer to keep the
absolute values intact while calculating the incremental values.
Incremental values can be calculated by subtracting the current value from the previous value. This is
done in a modern post by first copying the formatted absolute value for each X, Y, Z position into a
new user-defined variable (xia, yia, zia). Next, using the vector math function vsub, the previous X, Y
and Z are subtracted from the current X, Y, Z .
In MPFAN, there is a start calculations and an end calculations postblock. This allows you to make a
start and end call for incremental calculations from different locations in the post customization file.
The postblocks used in MPFAN are shown below.
#Incremental calculations
ps_inc_calc # Incremental calculations, start
xia = fmtrnd(xabs)
yia = fmtrnd(yabs)
zia = fmtrnd(zabs)
xinc = vsub (xia, prv_xia)
ps_cinc_calc

3-4 Mastercam Version 9 MP Post Processor Reference Guide

June 2002

Volume 1

Chapter 3 Changes to the MP Post

ps_cinc_calc # Incremental calculations, start rotary


cia = fmtrnd(cabs)
cinc = cia - prv_cia
pe_inc_calc # Incremental calculations, end
prvcabs = fmtrnd(cabs) #Avoid updating until called explicitly
!xia, !yia, !zia, !cia
!x, !y, !z

To allow the Mastercam user to select between absolute and incremental programming, a
miscellaneous integer is used. The miscellaneous integer is stored in the pre-defined variable absinc.
The absinc variable is now pre-defined and set automatically during subprograms, based on the
absolute/incremental setting. However, the absinc variable must be set for all output other than
subprograms, which is why the miscellaneous integer continues to be used.

X, Y and Z output
In a modern post, the method for outputting of the X, Y and Z values has changed. We no longer use
the x, y and z pre-defined variables for output. Modern posts create a common set of output variables,
which allows us to simplify the output routines, calculations, and helps with modality issues.
In MPFAN, the user-defined variables xabs, yabs and zabs are used for absolute output. The userdefined variables xinc, yinc and zinc are used for incremental output. All motion output is done from the
pxout, pyout and pzout postblocks. This allows a common call to a set of postblocks for X, Y and Z
motion output for all output lines. In these postblocks the motion output will occur based on the absinc
setting. Samples of these postblocks are shown below.
pxout
# X output
if absinc = zero, xabs, !xinc
else, xinc, !xabs
pyout
# Y output
if absinc = zero, yabs, !yinc
else, yinc, !yabs

Forcing output
When you use this method, you must force output at a specific time. To do this you would normally
add the asterisk forced output character (*) to the variable, causing output to occur regardless of
modality. With the postblock method above, this would force output every time the pxout postblock
was called. To prevent this, a new set of output postblocks forces output when called, leaving the
original modal postblocks intact. Samples of these postblocks are shown below.
pfxout
# Force X axis output
if absinc = zero, *xabs, !xinc # Output absolute X
else, *xinc, !xabs
# Output incremental X
pfyout
# Force Y axis output
if absinc = zero, *yabs, !yinc # Output absolute Y
else, *yinc, !yabs
# Output incremental Y

June 2002

Mastercam Version 9 MP Post Processor Reference Guide 3-5

Chapter 3 Changes to the MP Post

Volume 1

When making calls to the motion output postblocks, the pfxout postblock forces output and the pxout
postblock outputs based on modality. For example, you may want to force out the X, Y and Z rapid
position from a tool change while allowing modality to control output during the toolpath motion.
In the tool change postblocks, you can force output of X, Y and Z by calling the pfxout, pfyout and pfzout
postblocks as shown below.
pcan1, pbld, n, *sgcode, *sgabsinc, pwcs, pfxout, pfyout,
pfcout, *speed, *spindle, pgear, strcantext, e
pbld, n, "G43", *tlngno, pfzout, scoolant, next_tool, e

In the toolpath motion postblocks, you can allow modality to control output by calling the pxout, pyout
and pzout postblocks as shown below in plinout.
plinout
#Output to NC of linear movement - feed
pcan1, pbld, n, sgfeed, sgplane, `sgcode, sgabsinc, pccdia,
pxout, pyout, pzout, pcout, feed, strcantext, scoolant, e

The use of Whatno


The use of whatno and whatline is not recommended in modern posts. In older posts, Whatno and
whatline allowed the use of the post customization files internal counter to access different linear and
circular motion postblocks.

Posts transition from Version 7 to Version 8


A new Mastercam version often creates problems for the post supporting the new features added to the
product and changes made to the NCI format. Every attempt is made to support posts from the previous
version. However, posts from prior Mastercam versions cannot support new system functionality
without adding code to the post file. This requires writing code in the post file and is a chargeable
item. Contact your dealer for cost and additional information. An existing post will support those
features that were written into it.
To provide a transition from a Mastercam Version 7 to Mastercam Version 8, the following items were
implemented.

NCI Header Gcode 1050


NCI Header Gcode 1050 was added to the NCI file to indicate that Mastercam Version 8 produced it.
The first parameter holds the major version number vers_no. It is used by the post executable to select
internal procedures while processing. If vers_no is 8, the following occurs:
! 5-axis motion (Mill) Gcode 11 The next contour flag variable nextcflg is taken from the
new contour flag (parameter 9).
! Drill NCI line processing follows Version 8 standards where the drill data is converted to
absolute and calls are generated to emulate those used when processing the Mastercam
Version 7 NCI files. The new long output drill cycle are generated.
See Working with Drill Cycles.
! Read additional contour flags (Mill).
! Read additional contour flags (Lathe).
3-6 Mastercam Version 9 MP Post Processor Reference Guide

June 2002

Volume 1

Chapter 3 Changes to the MP Post


!
!

Read additional contour flags (Wire).


Read maximum spindle speed in Lathe from Stock Parameters Gcode 1020.

Updating posts for Version 9 (UPDATEPST9)


All posts from prior Mastercam versions should be upgraded using the C-Hook UPDATEPST9.
UPDATEPST9 does more than update the text file. It also adds numbered questions to your post file
and, if it is an MP style post, adds variables that control posting behavior in the MP executable. For
step by step instructions on updating your post processors for use with Mastercam v9 using the
UPDATPST9 utility, see UpDatePST9.pdf
Variables added and/of manipulated during post update are:
strtool_v7
The strtool_v7 variable was introduced in Mastercam Version 7 when the tool name in Mill became
generic based on the tool type, and the tool definition index became the tool identifier. To allow the
tool description to appear as in Mastercam Version 6, this variable was added to capture the description
from the tool definition. The description is captured from the Tool Parameters Gcode 20001.
get_1004
Also introduced in Mastercam Version 7, get_1004 is required in older MP posts that used the Cancel
Cutter Compensation to indicate the end of a toolpath before the introduction of the ptoolend postblock.
The ptoolend postblock that exists in these posts is called by the internal function and the post code
testing for the nextop of 1004. This produces two calls where a single call is desired.
rpd_typ_v7
rpd_typ_v7 is a new variable for Version 8 that controls the following actions when it is set to 1 and

processing a Version 8 NCI file:


! 5-axis motion (Mill) Gcode 11 The next contour flag variable nextcflg is taken from the old
contour flag (parameter 8).
! Contour flags (Mill) the rev5 is NOT read.
! Contour Flags (Lathe) for rpd_typ are converted to Version 7 settings shown below. This is
important to add to a V7 Lathe post that used the lathe canned turning cycles generated in the post
file.
rpd_typ value

June 2002

Meaning

50000 to 20000 Entry/exit.


40000 to 10000 Rapid between points.
60000 Mark end and start of lathe rough in turning cycles; new flag has no
conversion.
The variable for the next drill cycle with 5-axis drilling is increased by 100. In Mastercam V7, 5axis drill cycles were in the range of 100 to 107. Mastercam V8 sets the drillcycle parameter the
same for all drilling toolpaths.

Mastercam Version 9 MP Post Processor Reference Guide 3-7

Chapter 3 Changes to the MP Post

Volume 1

Note: drillcyc has 100 added internally with 5-axis drilling so it always appears in the 100s range.
!

In Mastercam V7 drilling, there was no move after the tool change. Mastercam V8 NCI
specifications require a rapid move after all tool changes. Some posts do not expect the rapid
motion and rpd_typ_v7 skips the rapid move.
rpd_typ_v7 skips the enhanced long code drilling calls if rotaxtyp is less than 6.

Version 8 canned text


In Mastercam Version 8, canned text changed to allow multiple events on a single move. MP posts
from prior versions must be modified to take advantage of this new feature. When selecting canned
text and processing with an older MP style post, the first canned text entry from the canned text Gcode
1025 line is placed in the variable cantext and is processed as in prior versions. All other entries are
ignored.

V8 Lathe canned turning cycles


Mastercam Version 8-style Lathe canned turning cycles are only supported in posts that are written for
them. Mastercam V7 posts do not support this feature. The documentation provided at the head of
these posts describes the way to produce the cycles as you did in Version 7, as well as in later versions
of Mastercam. Do not enable the menu selections unless your post can support the new features.

V9 changes
For information on changes specific to Version 9, pleased see Post Processors - What's New in v9.pdf

Troubleshooting upgrading
If you have trouble running a post from a prior Mastercam version:
1) Run the C-Hook UPDATEPST9 to update the post file flags.
2) Use the C-Hook RUNOLD, which allows you to produce an NCI file compatible with the
Mastercam version the post was written for. Use this C-Hook if you have a third party product that
is using the NCI file and was written prior to Mastercam V8. This can be made to appear seamless
by creating the surrogate post in the C-Hook RUNOLD.

Common problems
!

When you attempt to run MP, if you get the error saying that the DLL could not be found, the DLL
named MPPARAM.DLL is missing or is not in the directory with the Mastercam executable.
Mastercam V8 and V9 produce an external operation file (.OPS). MPPARAM.DLL must be
present for MP to execute. Be aware that the 10000 series parameter information in the NCI file is
being phased out.

String select errors in an MP post are almost always generated because of added options to the
selector variable. The post must be modified to accommodate the new functionality. Contact your
dealer for cost and additional information.

3-8 Mastercam Version 9 MP Post Processor Reference Guide

June 2002

Volume 1

Chapter 3 Changes to the MP Post

Changes to the MP post executable


This section lists changes made to the post executables in recent versions.
Note: The version listed is post executable (.DLL) version and NOT the Mastercam version.

V8.10r
!
!
!
!
!

Break smcname (1050) into components smcname (MC8 name), smcext (MC8 Extension),
smcpath (MC8 path)
Modified for fatal error reporting. Better error reporting.
Added option for sub_level = -2 to ignore all subprogram NCI data.
Added up_st_vecx, up_st_vecy, up_st_vecz and up_st_mode variables to Wire.
See Volume 3, Numeric Variables for more information.
Updated for alternating thread.

V8.20r
!
!
!
!

Modified for fatal error reporting.


Modifications for network HASP (SIM module)
Fixed bug: When bug2 was negative, NC output was written to the debug section.
Allow the use of a suffix with a format statement (for example, fmt P 1 var1 S where P is
prefix, S is suffix).

V8.21
!

Fixed problem with next_tool being 0.

Added DLL versions for initial V9.0 release CD.


Added error_msg variable for new .ERR file (error logging).
This is documented in the Post Processors - What's New in v9.pdf
and Volume 3, Numeric Variables

V9.00r
!

V9.02
!

Added err_file variable to control when .ERR file is kept after processing.
This is documented in the Post Processors - What's New in v9.pdf
and Volume 3, Numeric Variables

A very important fix in this version DLL files corrects arc outputs in the
XZ and YZ planes. When posting toolpaths with arcs in the XZ and YZ planes
that were created by the filter, some of these arcs in rare cases would output as
a straight line move.

V9.03

June 2002

Mastercam Version 9 MP Post Processor Reference Guide 3-9

Chapter 3 Changes to the MP Post

Volume 1

Changes to released posts


This section lists any changes, modifications or additions to released post processors found on the
installation media from version to version.

V8.0
Mill
Post
MPFAN
MP_EZ
MPHAAS
MPFADAL2
MPMAZAK
MPMELDAS
MPVICKRS
MPOKUMA
MPHEID_I

Description of modifications

4-axis generic Fanuc post. Rewritten for V8 to support functions added in V8


(canned text, subprograms, etc.).
3-axis simplified Fanuc post. Rewritten for V8. No subprogram support.
4-axis generic Haas post. Rewritten for V8 to support functions added in V8
(canned text, subprograms, etc.).
4-axis Fadal post. New for version 8. Supports functions added in V8
(canned text, subprograms, etc.).
4-axis Mazak post. Rewritten for V8 to support functions added in V8
(canned text, subprograms, etc.).
4-axis Mitsubishi Meldas post. Rewritten for V8 to support functions added in V8
(canned text, subprograms, etc.).
4-axis Cincinnati Acramatic / Vickers post. New for version 8. Supports functions
added in V8 (canned text, subprograms, etc.).
4-axis Okuma post. Rewritten for V8 to support functions added in V8
(canned text, subprograms, etc.).
4-axis Heidenhain ISO post. New for V8. Supports functions added in V8
(canned text, subprograms, etc.).

Lathe
Post

Description of modifications

MPLFAN

Generic Fanuc Mill/Turn post. Rewritten for V8 to support functions added in V8


(canned text, subprograms, canned turning cycles, etc.).
MPL_GEN Generic 2 axis Fanuc post. Rewritten for V8 to support functions added in V8
(canned text, subprograms, canned turning cycles, etc.). No milling support.
MPL_EZ Generic 2 Axis Simplified Fanuc post. Rewritten for V8. No subprogram support.
No canned turning cycles support.
Note: All other posts on installation media were updated for V8 to support V8 canned text and other
miscellaneous issues.

3-10 Mastercam Version 9 MP Post Processor Reference Guide

June 2002

Volume 1

Chapter 3 Changes to the MP Post

V8.1
All posts were updated for V8.1 based on changes made to Mastercam and MP.

V8.1.1
Mill
Post

Description of modifications

MP_EZ

Modifications made to fix incremental calculations and to force Gcode after G80.
MPA2100E 4 axis Cincinnati 2100 E post. New for V8.1 Supports functions added in V8
(canned text, subprograms, etc.).
MPEZTRAK Major changes and additions.
MPOSP Rewritten for V8.1.

Lathe
Post

Description of modifications

MPL_EZ

Fixed problem with usecandrill variables not being set.


MPL_GEN Fixed problem with usecandrill variables not being set.
MPLHT42R Hardinge Conquest T42 w/ Ram Turret (Fanuc 18). New post added for V8.1.1
MPLHT42SP Hardinge T42 w Sub Spindle (Fanuc 0T-c). New post added for V8.1.1.
Wire
Post

Description of modifications

MPWAGIE

Correct post added to installation. This post overrides V8 post.


MPWAGEVO Added support for MODEL to Tech.
MPWSDMK30 New post added for Sodick Mark 30.

June 2002

Mastercam Version 9 MP Post Processor Reference Guide 3-11

Chapter 3 Changes to the MP Post

Volume 1

V9.0
Mill
Post
MPFAN

Description of Modifications

Set usecandrill , usecanpeck, and force_wcs settings to YES.


Now forces output of I,J,K arc centers (arcoutput :0 setting).

MPAN112X

Correct circular output in G18 plane.

MPAN113X

Correct circular output in G18 plane.

MPBOSS9

Added fmt assignment for variable I (arc center in X axis).

MPDECKH

Correct missing N sequence number in ptlchg0.

MILL.SET
MILLM.SET

New .SET style setup sheet generator.


New .SET style setup sheet generator (metric).

Lathe
Post
MPLFAN

Description of Modifications

Added example skeleton code for Lathe MiscOps functions.

Wire
Post
MPWFANUC

MPW-FA10

Description of modifications

Add plin_end, pcir_end to reset brk_cc_pos to 1 for logic in pcntr.


Altered logic on end of contour (cend) flag checks.
Added rapid_off option switch (yes/no) to force linear lead-off move to be G0 rapid
motions.
Added flast_UV option switch (yes/no) to force both U and V to output on final
position on 4-axis paths.
Added new post for Mitsubishi Wire EDMs.

Note: Not all Version 9 updated/new posts listed here are on the Version 9 installation CD. Your
Mastercam dealer can obtain copies for you.

3-12 Mastercam Version 9 MP Post Processor Reference Guide

June 2002

Das könnte Ihnen auch gefallen