Professional Documents
Culture Documents
This identifies all the post text entries that are used for that control definition. Mastercam
writes a new header each time you configure the post for a new control definition, and
appends it to the .PST file followed by set of values. Within each section, Mastercam uses
the same category headers as earlier versions.
In the sample post, the text header reads
[CTRL_MILL|V9_POST]
2
The first part of the header comes from the Control type field in the Control Definition
Manager:
The second part of the header matches the name of the .control file in which the control
definition is stored:
The post text defaults are stored under a similar header with DEFAULT as the control name:
[CTRL_MILL|DEFAULT]
This lets you store a set of default text values for each control type.
When you convert a post with UpdatePost, Mastercam creates the control definition
header and copies the information from your original .TXT file to it. Your .TXT file is no
longer used and will not be copied to the destination folder. Mastercam also creates a
DEFAULT header populated with your original post text entries, so that they will be the
defaults for any new control definitions you create with the post.
To edit the post text, use the Text page in the Control Definition Manager.
Example 1: Typical post text sections created by UpdatePost
[CTRL_MILL|DEFAULT]
[misc integers]
1. "Work Coordinates [0=G50,1=HOME,2=G54's]"//2
2. "Can Cycle G101 - G103 [0=OFF, 1 and -1=ON]"
3. "Reference Return [0=G28, 1=G30]"
10. "Y axis, over center [0=OFF, 1=ON]"
[simple drill]
1. "Drill/Counterbore"
...
8. "Bld on"
9. "bLd off"
10. "Text10"
[CTRL_MILL|V9_POST]
[misc integers]
1. "Work Coordinates [0=G50,1=HOME,2=G54's]"//2
2. "Can Cycle G101 - G103 [0=OFF, 1 and -1=ON]"
3. "Reference Return [0=G28, 1=G30]"
10. "Y axis, over center [0=OFF, 1=ON]"
[simple drill]
1. "Drill/Counterbore"
7. ""
8. ""
Whats New in Mastercam X posts 3
Note: In the Work coordinates lines, the //2 at the end of the line is a default value.
See the online help for the Misc Int/Real Values page in the Control Definition Manager
to learn more.
The following sample shows two variables with illegal characters. UpdatePost was able to
process sg54.1, converting it to sg54_1, but was unable to process G54.1P1, so it wrote
?? and reported an error.
Original line from Version 9.1 post:
sg54.1 G54.1P1
# Work coordinate system G code #7
Numeric constants
Use the := operator to initialize a variable to a fixed value. Variables initialized with := will
not be allowed to be modified during run time. Typically, this is used to create numeric
constants like pi that can be more easily referred to by their names.
The following example creates constants for inch/metric conversion factors, as well as pi
and the diameter of a rotary table:
pi := 3.141592654 # pi constant value
me := .03937 # Metric to English conversion
em := 2.54 # English to Metric conversion
rot_dia := 1243.34978674 # Rotary Table
Diameter.
pcalculate
cir = pi * dia
mcir = me * cir #Convert to English
ecir = em * mcir #Convert back to Metric
Formulas
Formulas can now be embedded in a postline with output. For example:
n$, x = 10, y=20, x, y, e$
Line Continuation
There have been many modifications to allow line continuation for formulas in postlines.
However, some restrictions still apply.
Functions
New parameters for fstrsel tables
String select tables now include two additional parameters.
The first new parameter is an integer which tells MP how many of the values in the
table are to be used. This lets you use only a portion of the values in the table if you
wish.
The second is a -1, 0, 1 code which tells MP how to handle underflow or overflow
values. Previously, these would have resulted in an error condition.
UpdatePost will automatically set the first parameter to the number of values in the table,
and the second parameter to -1.
# -----------------------------------------
# General G and M Code String select tables
# -----------------------------------------
# Motion G code selection
sg00 G0 #Rapid
sg01 G1 #Linear feed
sg02 G2 #Circular interpolation CW
sg03 G3 #Circular interpolation CCW
sg04 G4 #Dwell
sgcode #Target for string
fstrsel sg00 gcode$ sgcode 5 -1
Arc variables
Mastercam X includes two sets of variables for supporting arcs. These provide support for
plane-specific values, and for dedicated variables for lathe use:
Plane-specific arc output variables are in addition to the current arc output
variables, which should now be used only for arc output in the XY plane.
Lathe arc type variables are in addition to the current arc type variables, which
should now be used only for Mill and Router operations.
Possible arctype values now include 5 (radius) and 6 (signed radius), which allow you to not
use arcoutput$. These are converted to arcoutput(s) for backward compatibility.
The arc output variables use the same values that are defined in mpfan.pst:
0 = I-J-K
1=Radius
2=Signed Radius
If arctype$ is 4 or less, arcoutput$ is set to zero.
Use linkplnvar$ to link these new arc variables to existing variables.
Link variables
For each expanded set of new variables, Mastercam provides a linking variable that you can
use to propagate the value of the original variable to each new variable in its set. Because
MP uses all the new variables, and these were not present in posts before Mastercam X, the
8
linking variables ensure that the new variables have correct settings and allow for
backward compatability with earlier posts. The new variables will have whatever value was
assigned to the original variables with a = statement.
For example, if the assignment arctype$ = 1 is found in the post, and linkplnvar$ is
active (linkplnvar$ : 1), then the arctypexz$ and arctypeyz$ variables are also
assigned the value 1the same value that was assigned in the arctype$ = 1 assignment.
Other variables
The following variables have also been added or modified:
Router posts will output .rmd files instead of .mmd. Lathe posts will output
.lmd files.
Running UpdatePost
After you run UpdatePost, the Mastercam X post will retain the original file
name, and the original post will be renamed with a backup extension (for
example, Postname.pst_v9). You may wish to copy your original posts to a
temporary folder or to your Mastercam X posts folder before running
UpdatePost.
10
Make sure you include any .TXT files used by the original post.
UpdatePost can convert several posts at once, but only if they are the same
machine type (e.g. Mill, Lathe, Router, Mill/Turn). If you have many posts to
convert, you may wish to sort them by machine type.
Consider whether you will need to create a machine and/or control definition
for each post, or whether you will use the new posts with existing definitions.
UpdatePost will work with posts from Mastercam Version 4 or later, including
binary posts.
2 Start the UpdatePost utility.
From the menu, choose Settings, Run User Application, and select
UpdatePost.dll.
3 Enter your conversion settings:
If UpdatePost encounters any errors, it will not stop the conversion process,
and will create a finished post. All errors will be noted in the log file and flagged
in the converted post. It is important that you review these and make the
appropriate corrections to ensure that the converted post contains no critical
errors.
If you think you will need to refer to the log later, make sure that you print it out
or save a copy to a different file. Mastercam overwrites the log each time you
run UpdatePost.
Mastercam will use system default values. Typically, most of the values read from the post
will be written to the control definition, while most of the values in the machine definition
will be default values.
The control and machine definitions will each have the same name as the post. For
example, if you convert a mill post called HAAS_VR8.PST, Mastercam will create
HAAS_VR8.CONTROL and HAAS_VR8.MMD in addition to the post file itself. The machine
definition will be automatically configured with the HAAS_VR8.CONTROL and
HAAS_VR8.PST.
Mastercam will convert all of the post numbered questions into control definition settings.
However, you will still see the numbered questions in the converted post. This is for your
information only Mastercam will ignore them and use the control definition settings.
The new machine and control definitions will be automatically saved to your
CNC_MACHINES folder.
If you wish, you can use the CD_Compare utility to examine the new control
definition and see exactly which control definition settings have been read from
the post and which are system defaults. From the Settings menu, choose Run
User Application, open the CD_Compare folder, and choose CD_Compare.
Mastercam writes this to the file UPDATEPOSTX.LOG in the destination directory where
you are saving the converted posts. (Each time you run the UpdatePost utility and save
posts to the same directory, the log is overwritten.)
In the log file, an error looks like this:
22 - 20 Apr 2005 01:12:59 PM - PST LINE (1200,1200) - Label has
not been defined[*30]
The LINE (x, y) block tells you the location of the error in the original and converted
post; in this case, line 1200 in each.
When you open the converted post, Mastercam displays the affected code as a block of
three lines:
The first line is the actual line of code created by UpdatePost.
The second line is the original line, commented out, and preceded by the phrase
CNC<<CONVERT>>.
The third line reproduces the error message from the log, formatted as a comment,
and preceded by the phrase CNC<<MSG ... >>.
The following code shows a typical conversion error. In this example, Mastercam knows
that the line is supposed to be an else command, but it cannot convert the other word
because it has not been properly defined:
else, #'nobrk' emulation option
#CNC<<CONVERT>> else, p_nobrk_emul #'nobrk' emulation option
#CNC<<MSG-ERROR(1200,1200)>> Label has not been defined[*30]
Note: After clicking the Select Post(s) button, select All files (*.*) from the Files of type
list so that you can select the .set files.
Setup sheets in Mastercam X still use the .set extension, so your new setup sheet will have
exactly the same name as the old one. Mastercam will create a backup copy of your original
file with a different extension.
14