Mastercam X3 Parameter Reference

Post Parameter Reference
sample text
Mastercam X3 Post Parameter Reference
July 2008
Mastercam® X3 Post Parameter Reference
Date: July 2008 Copyright © 2008 CNC Software, Inc. — All rights reserved. First Printing: July 2008
Software: Mastercam X3 ISBN: 1-883310-88-1
IMPORTANT NOTICE!
Software License
Restrictions
PLEASE READ THIS STATEMENT AND THE SOFTWARE LICENSE AGREEMENT COMPLETELY BEFORE USING THIS SOFTWARE. YOU MUST ACCEPT THE
TERMS OF THIS LICENSE BEFORE YOU CAN OPERATE THE SOFTWARE PROGRAM.
BY CONTINUING TO USE THIS SOFTWARE, YOU (EITHER AN INDIVIDUAL OR A SINGLE ENTITY) INDICATE YOUR INTENTION TO BE BOUND BY AND ACCEPT THE TERMS AND CONDITIONS OF THIS SOFTWARE LICENSE. IF YOU
DO NOT AGREE TO THESE TERMS AND CONDITIONS, YOU MAY NOT ACCESS OR OTHERWISE USE THIS SOFTWARE AND WILL IN FACT BE PROHIBITED FROM DOING SO. THIS COMPUTER SOFTWARE MAY BE USED ONLY PURSUANT TO THE TERMS AND CONDITIONS SET FORTH BELOW, AND SOLELY IN CONJUNCTION WITH THE ACCOMPANYING SECURITY MECHANISM (UNLESS OTHERWISE SPECIFIED IN THE "EXCEPTIONS TO SECURITY MECHANISM REQUIREMENTS" SECTION OF SUCH TERMS AND CONDITIONS) WHICH MUST BE PRESENT ON YOUR COMPUTER (OR NETWORK AS APPLICABLE) AT ALL TIMES DURING SUCH USE.
Please Note:
place regarding the use of this Software that are in addition to those found within this Software License. If you have any questions or concerns as to the existence of any such additional restrictions or guidelines, you should consult with your supervisor or your IT Department before using this Software.
Read This If You Have Received This Software From A Third Party:
this Software from someone other than an authorized CNC Software, Inc. reseller, you do not have a legal software license. (For example, if you acquired this Software simply by buying a machine or Software from the former owner or from an auction, you do not have a valid license.) You should contact CNC Software, Inc. (860-875-5006) in order to obtain a new and valid license. Use of this Software
without a valid software license is unlawful, a violation of the Copyright Act and may expose you to criminal liability under 17 United States Code Sec. 506, including fines and damages.
If you have paid a license fee, CNC Software, Inc. ("CNC") a Connecticut corporation with its principal place of business at 671 Old Post Road, Tolland, Connecticut, 06084 hereby grants to you a non-exclusive, non-transferable license (the "License") to use this software program and its accompanying documentation (and, if applicable, to permit your authorized employees to use them), solely in accordance with the terms and conditions of this Software License Agreement. You may use the Software solely for your internal business purposes and solely in conjunction with the accompanying hardware or software device, method, scheme or other security measure provided by CNC which allows a user to access the Software and prevents unauthorized access to the Software (the "Security Mechanism"). The Software, any updates to the Software through purchase or due to enrollment in an authorized software Maintenance program (including any that you download through the Internet), and the Documentation in printed or electronic form shall hereinafter collectively be referred to as the "Software" and are all governed by this License.
You may not use the Software without a Security Mechanism provided by CNC or CNC's suppliers. When CNC or CNC's resellers provide you with a single-user Security Mechanism, the Software may only be used (in executable code form only) on a single computer to which the Security Mechanism is physically attached. In the event CNC or CNC's resellers provide you with a multiple-user Security Mechanism for use over an internal network (a "Network Security Mechanism"), the Software may be used: (a) in executable code form only; (b) only on end-user computers that are connected to the internal network to which the Network Security Mechanism is attached; and (c) only by the number of users and accessed by the number of end-user computers for which licenses were purchased and as further allowed by the Network Security Mechanism. You may physically transfer the Software from one computer equipped with a single-user Security
Your company may have additional restrictions and guidelines in
If you received
Copying Restrictions
Non Transferable
Intellectual Property Rights
Confidentiality
Enforcement Obligations
Limited Warranties
Mechanism to another only if the Security Mechanism is included in the transfer and is installed with the new computer.
You shall not: (a) copy (except as provided below), adapt, modify the Software; (b) publish, display, disclose or create a derivative work from the Software or any part thereof; (c) de-compile or translate, disassemble, create or attempt to create, by reverse engineering or otherwise, the source code form of the Software from the executable code of the Software; (d) remove any proprietary notices, labels or marks from the Software; (e) sell, rent, lease, distribute or otherwise transfer or provide all or any part of the Software to any person or entity without the prior written consent of CNC; (f) use the Software to provide outsourcing, service bureau, time sharing or other services to any third party; or (g) sublicense, assign, delegate or otherwise transfer your rights in the Software, under the Software License Agreement or any of the related rights or obligations for any reason without the prior written consent of CNC. You shall not circumvent, bypass, modify, reverse engineer, disassemble, disable, alter, enhance or replicate the function of the Security Mechanism in any manner whatsoever. Any attempt to do so shall result in automatic termination of this License without prejudice to all other legal rights and remedies of CNC.
You may make one (1) copy of the Software for backup or archival purposes, provided that you reproduce all proprietary notices of CNC on any such copy.
You may not transfer or assign the Software or this Software License Agreement or any rights or obligations hereunder. Any attempt to do so will automatically terminate this License without the need for notice. This termination is without prejudice to all other legal rights and remedies of CNC.
The Software is and includes intellectual property of CNC. All associated intellectual property rights, including, without limitation, worldwide patent, trademark, copyright and trade secret rights, are reserved by CNC. CNC retains all right, title and interest in and copyrights to the Software, regardless of the form or media in or on which the original or other copies may subsequently exist. This Software License Agreement shall not constitute a sale of the Software and no title or proprietary rights to the Software are transferred to you hereby. You acknowledge that the Software is a unique, confidential and valuable asset of CNC, and CNC shall have the right to seek all equitable and legal redress which may be available to it for the breach or threatened breach of this Software License Agreement including, without limitation, injunctive relief. Unauthorized copying of the Software or failure to comply with the above restrictions shall result in automatic termination of this License and this Software License Agreement without prejudice to all other legal rights and remedies of CNC.
You acknowledge that the Software contains proprietary trade secrets of CNC and you hereby agree to maintain the confidentiality of the Software using at least as great a degree of care as you use to maintain the confidentiality of your own most confidential information. You agree to promptly communicate the terms and conditions of this Software License Agreement to those persons employed by you who come into contact with the Software, and to use your best efforts to ensure their compliance with such terms and conditions, including, without limitation, absolutely preventing such persons to use any portion of the Software for the purpose of deriving the source code of the Software or defeating the Security Mechanism.
In the event you become aware that any person or entity in your employ or under your control is using the Software in a manner not authorized by this Software License Agreement, you shall immediately take all steps necessary to stop such unauthorized use of the Software. You shall promptly notify CNC in writing of any unauthorized use of the Software of which you become aware.
CNC WARRANTS THAT THE MEDIA ON WHICH THE SOFTWARE IS DISTRIBUTED WILL BE FREE OF DEFECTS IN MATERIAL OR WORKMANSHIP FOR A PERIOD OF THIRTY (30) DAYS AFTER PURCHASE. THE FOREGOING LIMITED WARRANTY EXCLUDES DEFECTS ARISING OUT OF ACCIDENT, NEGLECT, MISUSE, FAILURE OF ELECTRIC POWER AND CAUSES OTHER THAN ORDINARY AND AUTHORIZED USE. EXCEPT FOR THE FOREGOING LIMITED WARRANTY, THE SOFTWARE IS PROVIDED "AS IS, WITH ALL FAULTS." THIS LIMITED WARRANTY IS THE ONLY WARRANTY PROVIDED BY CNC REGARDING THE SOFTWARE. TO THE MAXIMUM EXTENT PERMITTED BY LAW, CNC DISCLAIMS ALL OTHER WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
Disclaimer of Consequential Damages and Limitation of Liability
Indemnification
Educational Pricing
Ter mi na ti on
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. CNC IS NOT OBLIGATED TO PROVIDE ANY UPDATES TO THE SOFTWARE.
Sole and Exclusive Remedy for Breach of Warranty: YOUR SOLE EXCLUSIVE REMEDY AND CNC'S SOLE OBLIGATION HEREUNDER SHALL BE, AT CNC'S SOLE OPTION (i) REPLACEMENT OF THE DEFECTIVE MEDIA; OR (ii) REFUND OF THE PURCHASE PRICE OF THE SOFTWARE. CNC SHALL HAVE NO OTHER OBLIGATION OR LIABILITY TO YOU ARISING FROM OR RELATED TO THIS LICENSE OR YOUR USE OF THE SOFTWARE. ANY USE BY YOU OF THE SOFTWARE IS AT YOUR OWN RISK.
Note on Documentation: While CNC makes every effort to ensure that its Documentation for the Software is accurate and up-to-date, it cannot guarantee the Documentation at all times represents the latest operation and functionality of the Software. The content of all documentation, in electronic or printed form, for the Software is provided for informational purposes only. The content of the Documentation may be changed without notice to you. CNC expressly disclaims
any warranty or representation that the Documentation is an accurate and/or current reflection of the Software's operation and performance.
IN NO EVENT WHATSOEVER WILL CNC, OR ITS EMPLOYEES, SHAREHOLDERS, DISTRIBUTORS OR RESELLERS BE LIABLE TO YOU FOR ANY INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR IN CONNECTION WITH THIS SOFTWARE LICENSE AGREEMENT OR THE USE OF THE SOFTWARE, EVEN IF CNC HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. WITHOUT LIMITING THE FOREGOING, CONSEQUENTIAL DAMAGES SHALL INCLUDE, WITHOUT LIMITATION, SPECIAL, PUNITIVE OR EXEMPLARY DAMAGES, DAMAGES FOR LOSS OF BUSINESS, LOSS OF PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, AND LOSS OF OR DAMAGE TO ANY PRODUCTS THAT THE SOFTWARE IS USED IN CONJUNCTION WITH.
CNC'S ENTIRE LIABILITY WITH RESPECT TO ITS OBLIGATIONS UNDER THIS SOFTWARE LICENSE AGREEMENT OR OTHERWISE SHALL NOT EXCEED THE AMOUNT OF THE LICENSE FEE PAID BY YOU FOR THE SOFTWARE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES OR LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATIONS OR EXCLUSIONS MAY NOT APPLY TO YOU.
You shall indemnify and hold harmless CNC, its officers, directors, employees, resellers and agents (the "Indemnified Parties") from and against all losses, settlements, claims, actions, suits, proceedings, judgments, awards, damages, liabilities, costs and expenses including, without limitation, reasonable attorneys' fees (collectively "Losses") which arise out of or are related to any breach of this Software License Agreement by you or your employees, agents, resellers, dealers or sub-dealers, and shall reimburse the Indemnified Parties for any and all legal, accounting and other fees, costs and expenses reasonably incurred by any of them in connection with investigating, mitigating or defending any such Losses.
If this Software was obtained through or in accordance with a CNC "Educational Pricing" plan, option, grant, schedule or program, it may not be used by anyone, including you, to conduct any computer aided design, computer aided drafting, computer aided machining, or training activities that, directly or indirectly, generate or otherwise result in monetary revenues for the benefit of any individual or any entity, other than the school that originally received this Software.
This Software License Agreement is effective until terminated. You may terminate this Software License Agreement at any time by returning to CNC all copies of the Software under your control and by returning the Security Mechanism to CNC. CNC may terminate this Software License Agreement if CNC determines, in its sole discretion, that you have violated the terms of this Software License Agreement. Upon termination of this Software License Agreement, you agree to immediately return to CNC all copies of the Software, return the Security Mechanism to CNC, and certify to CNC in writing that all known copies, including backup copies, have been returned. All provisions relating to confidentiality, proprietary rights, indemnification and non-disclosure shall survive the termination of this Software License Agreement. You may not transfer this Software to the purchaser of any
equipment on which the Software may be resident. You may not transfer this Software via liquidation, bankruptcy, auction, close of business, or any other method that does not involve an authorized Mastercam reseller. This License is for you alone. In the event you breach the provisions of this Section, CNC shall be
General
Attorneys Fees
U.S. Government Restricted Rights
Export Restrictions
Exceptions to Security Mechanism Requirements
Survival
Reservation of Rights
Trademarks
entitled to liquidated damages in the amount of Fifteen Thousand Dollars ($15,000), plus its reasonable attorney's fees and court costs.
This Software License Agreement shall be governed by and construed in accordance with the laws of the state of Connecticut, USA without regard for Connecticut's conflicts of law principles. The sole and exclusive jurisdiction and venue for any litigation arising from or related to this Software License Agreement or the subject matter hereof shall be in an appropriate state or federal court located in Hartford, Connecticut. You hereby submit to the personal jurisdiction of the US District Court for the District of Connecticut and the Superior Court of the State of Connecticut. This Software License Agreement shall constitute the entire agreement between you and CNC with respect to the subject matter hereof. Any waiver or modification of this Software License Agreement shall be valid only if it is in writing and signed by both parties hereto. If any part of this Agreement is found invalid or unenforceable by a court of competent jurisdiction, the remainder of this Agreement shall be interpreted so as to reasonably affect the intention of the parties.
In the event that CNC is required to take legal action to enforce its rights under this License Agreement and obtains a ruling or settlement in its favor, you shall be liable to CNC for its reasonable attorney's fee incurred in investigating and prosecuting its claim.
The Software provided hereunder is a "commercial item," as that term is defined in 48 C.F.R. 2.101, consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212. Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4, the Software made available to the United States of America, its agencies and/or instrumentalities, is provided with only those rights set forth in this Agreement. Use, duplication or disclosure of the Software by the government is subject to the restrictions as set forth in subparagraph (c) (1) and (2) of the Commercial Computer Software-Restricted Rights clause at 48 C.F.R. 52.227-19, as amended, or any successor regulations thereto.
You represent and warrant that you will not, without obtaining prior written authorization from CNC and, if required, of the Bureau of Export Administration of the United States Department of Commerce or other relevant agency of the United States Government, export or re-export, directly or indirectly, the Software from the United States to (i) any country destination or entity to which export is restricted by the Export Administration Regulations of the United States Department of Commerce; (ii) any country or entity subject to sanctions administered by the Office of Foreign Assets Control, United States Department of the Treasury; or (iii) such other countries or entities to which export is restricted by any other United States government agency. You further agree that you are solely responsible for compliance with any import laws and regulations of the country of destination of a permitted export or re-export, and any other import requirement related to a permitted export or re-export.
CNC software programs Mastercam Design LT and Mastercam Demo as well as printed and electronic documentation do not require the use of Security Mechanisms, and the provisions in this Software License Agreement relating to Security Mechanisms do not apply to your use of such programs, provided, however, that such provisions shall apply to your use of all other Software and documentation provided hereunder.
All provisions of this Software License Agreement relating to confidentiality, non­disclosure, CNC's proprietary rights, disclaimers, and limits of liability, or indemnification by Customer shall survive termination of this License for any reason.
All rights not expressly granted are reserved by CNC.
Mastercam® is a registered trademark of CNC.
Windows, Windows 2000, Windows XP, and Windows Vista are registered trademarks of Microsoft Corporation. Mastercam Verify is created in conjunction with MachineWorks Ltd. Mastercam Backplot includes Copyrighted intellectual property rights owned by NWD.
Printed in the United States of America.
Printed on recycled paper.

Contents

vii
1. Introduction......................................................................................................... 1
Contacting CNC Software ....................................................................... 1
2. Working with Parameters ........................................................................... 3
X How does an MP post work?..........................................................................4
Reading the NCI file ...........................................................................................6
Operation (10000s) parameters ........................................................................ 6
Tool information (20000s) parameters..............................................................6
X Reading operation and tool parameters.........................................................8
Extracting string and numeric data ................................................................... 8
Mastercam X2 and earlier .......................................................................... 8
Extracting a common string variable ..................................................... 8
Extracting a numeric variable................................................................. 8
Extracting numeric values from 20000s parameters ............................ 9
Mastercam X3 parameter read functions ................................................10
Techniques for reading operation parameters................................................11
Example: Capturing operation parameters .............................................11
NC parameters with the pre-read routine ...............................................12
Determining the prmcode$ for a specific parameter ..............................12
Accessing parameter information with C-Hooks ....................................14
Other useful variables ..............................................................................15
Using the strtool_v7$ variable ..............................................................15
X Machine definition, control definition, and machine group parameters... 16
Reading the parameters................................................................................... 16
Capturing machine definition parameters .............................................. 17
Capturing control definition parameters .................................................18
Capturing machine group parameters ....................................................18
Machine definition pages ................................................................................ 19
Machine Definition Manager ...................................................................19
General machine parameters ...................................................................20
Op. feed rate limits /axis motion/orientation tab............................... 20
Axis feed rate limits tab .........................................................................21
CPlane, WCS, HTC/VTL tab.................................................................. 22
Coolant/Flushing/Options tab............................................................. 23
Tool/material libraries tab.................................................................... 24
Machine dynamics tab .......................................................................... 25
Component geometry (common) ............................................................26
Solid geometry .......................................................................................26
Block geometry ......................................................................................27
Cylinder geometry .................................................................................28
Extruded geometry ................................................................................ 29
Revolved geometry ................................................................................30
Position/Orientation tab.......................................................................31
viii • MASTERCAM X3 / Post Parameter Reference
Control definition pages ..................................................................................53
Component properties (individual) .........................................................32
Automatic tool changer parameters .................................................... 32
Chuck parameters..................................................................................33
Chuck geometry (parametric) dialog box ............................................ 34
Chuck jaws parameters ......................................................................... 35
Bar stock parameters............................................................................. 36
Turret parameters.................................................................................. 37
Turret geometry (parametric) dialog box ............................................38
Gang tool parameters............................................................................ 39
Tailstock parameters ............................................................................. 40
Tailstock geometry ................................................................................41
Tailstock center parameters .................................................................42
Steady rest parameters.......................................................................... 43
Linear axis parameters .......................................................................... 44
Linear axis parameters (programmed motion)................................... 45
Rotary axis parameters.......................................................................... 46
Tool spindle parameters .......................................................................47
Tool component parameters ................................................................ 48
Router spindle parameters ................................................................... 49
Router spindle position.........................................................................50
Router piggyback spindle parameters .................................................51
Router piggyback spindle position....................................................... 52
Wire guide parameters .......................................................................... 53
Overall parameters ...................................................................................54
Tolerance page .........................................................................................54
Communications page .............................................................................55
Files page .................................................................................................. 56
NC Dialog page (Mill–Lathe–Router) .......................................................57
NC Output page ........................................................................................ 57
Misc. Int/Real Values page .......................................................................58
Work System page ....................................................................................59
Tool page (Mill–Router) ...........................................................................60
Tool page (Lathe) ..................................................................................... 61
Linear page (Mill–Router) ........................................................................ 62
Linear page (Lathe–Mill/Turn–Wire) .......................................................63
Arc page (Mill–Router–Wire) .................................................................... 64
Arc page (Lathe) .......................................................................................65
Rotary page (Mill–Router–Lathe) .............................................................66
Feed page (Mill–Router) ...........................................................................67
Feed page (Lathe) .....................................................................................67
Feed page (Wire) ......................................................................................68
Cutter Compensation page ......................................................................68
Machine Cycles page (Mill–Router–Lathe) ..............................................69
Drill Cycles page (Mill–Router–Lathe) ..................................................... 70
Lathe Canned Cycles page (Lathe) ...........................................................71
Subprograms page ...................................................................................72
Start/Leads page (Wire) ............................................................................73
Cuts page (Wire) .......................................................................................74
Corner page (Wire)
................................................................................... 75
Corner page (Wire) ...................................................................................76
Reverse Cuts Contour page (Wire) ...........................................................77
Reverse Cuts Auxiliary page (Wire) ..........................................................78
4-Axis Paths page (Wire) ...........................................................................79
Nocore page (Wire) .................................................................................. 80
Machine group property pages........................................................................81
Files tab (Machine Group Properties) ......................................................81
Tool Settings tab (Machine Group Properties) ........................................ 82
Stock Setup tab—Mill/Router (Machine Group Properties) ...................83
Stock Setup tab—Lathe (Machine Group Properties) .............................83
Safety Zone tab (Machine Group Properties) .......................................... 85
3. Parameter Reference...................................................................................87
X Operation & toolpath parameters..................................................................88
X Machine definition parameters ...................................................................210
X Control definition parameters......................................................................250
X Machine group parameters .........................................................................279
4. NCI Reference ............................................................................................... 297
X NCI Gcodes ...................................................................................................298
Control Flags Parameters...............................................................................387
X Tool Information (20000s Parameters) ......................................................391
Mill/Router/Generic ......................................................................................392
Lathe...............................................................................................................397
Wire ................................................................................................................402
• ix
x • MASTERCAM X3 / Post Parameter Reference
chapter 1

Introduction

Welc ome to the Mastercam X3 Post Parameter Reference. This guide documents the NCI Gcodes and operation parameters that together encapsulate Mastercam operations and toolpaths. It serves two main purposes:
A reference to all the parameters and NCI Gcodes.
Guidelines and examples for reading operation parameters,
including parameters for machine definitions, control definitions, and machine groups.
This edition incorporates new features for Mastercam X3, introduced in July 2008. It includes the additional parameters used by new toolpaths, as well as new parameter read functions.
IMPORTANT: This book does not include information about event-based posts (EMP). It is intended to be used in connection with Mastercam’s regular Mill, Lathe, Router, and Wire toolpaths, not Mastercam MultiTasking.

Contacting CNC Software

Use the following Web sites to find information on Mastercam X3:
www.emastercam.com Mastercam global user forum
www.mastercam.com CNC Software, Inc. corporate Web
site
www.mastercamedu.com CNC Software, Inc. Educational
Division Web site
For assistance with installing Mastercam X3, its SIM or NetHASP, or to obtain more information on using Mastercam X3, contact your local Mastercam X3 Reseller. If your Reseller is unavailable, you can call CNC Technical Support Services Monday through Friday, 8:00 a.m.–5:30 p.m., USA Eastern Standard Time.
When calling CNC Software for technical support, please follow these guidelines:
Be sure you have already tried to contact your Mastercam X3
Reseller.
Provide the serial number of your SIM HASP or NetHASP.
Be ready to describe the problem in detail. Write down what
happened, particularly if you cannot call immediately after the problem occurs.
Be in front of your computer when you call.
2 • MASTERCAM X3 / Post Parameter Reference
If possible, try to duplicate the problem before calling. Our Support Services
technician may require you to duplicate the problem while you are on the phone.
When you call, have ready a complete description of your hardware, including
your operating system (OS), central processing unit (CPU), graphics card and settings, and memory.
You can also leave a message for CNC Support Services twenty-four hours a day, seven days a week via our e-mail or Web site addresses. When sending e-mail, please include:
The serial number of your SIM HASP or NetHASP
Telephone number and contact information where you can be reached
Files required to reproduce an issue, such as .MCX and post files
TIP: Use Mastercam’s Zip2Go utility to gather Mastercam part data into a compressed .Z2G file. This utility makes it easy to provide your Reseller or CNC Support Services with a file attachment that contains the information they need. Zip2Go scans the machine groups in your current part file and captures information such as your Mastercam configuration, machine definition, and post files. For more information on using Zip2Go, please refer to the Mastercam Help.
Important Contact Information
Address CNC Software, Inc.
671 Old Post Road Tolland, Connecticut, 06084-9970 USA
Phone (860) 875-5006
Fax (860) 872-1565
FTP Address ftp://ftp.mastercam.com
Internet Address http://www.mastercam.com
E-mail support@mastercam.com
chapter 2

Working with Parameters

Post parameters provide a way for the post writer to have direct access to settings and values from Mastercam dialog boxes, tool definitions, and other toolpath/operation settings. These parameters can be read by the post processor and stored in a user-defined variable, and then used like any other post variable.
Operation parameters supplement the information that is read from the NCI file. Operation parameters are provided to MP by MPParamX.dll. The following types of data are available:
toolpath and operation settings, as entered in toolpath
parameter dialog boxes (numbers 10000–16999)
machine definition settings (numbers 17000–17999)
control definition settings (numbers 18000–18999)
machine group properties (numbers 19000–19999)
Tool parameters are written directly to the NCI file. They provide information about the selected tool, from the tool definition (numbers 20000–29999).
This chapter also discusses the regular NCI data and Gcodes, so you can get a complete picture of your toolpath data and the different methods for accessing it.
This chapter contains the following sections:
An introduction to the different types of parameters and NCI
data and how their values are passed to the post.
Descriptions and examples of how to access operation
parameters in your post.
Descriptions and examples of how to access machine
definition, control definition, and machine group parameters in your post.
A visual reference which maps the dialog box controls to
parameter numbers for machine definition, control definition, and machine group parameters.
The “Parameter Reference” on page 87 contains a complete list of all the parameters and NCI codes used in Mastercam X3.
4 • MASTERCAM X3 / Post Parameter Reference

How does an MP post work?

MP posts get information about your part in two ways:
Toolpath data. This consists of individual tool motions, feeds and speeds, and
other commands, such as spindle on/off and coolant on/off.
Operation parameters. These are the original values entered in your toolpath
dialog boxes and machine group property dialog boxes.
The toolpath data is by far the most important. This information is stored in a format called NCI (NC Intermediate). NCI format is a generic machine-neutral format. When you create toolpaths in your part file, Mastercam generates NCI data for each toolpath or other operation and stores it in your MCX file as binary NCI data. When you post your operations, Mastercam writes this data to a separate ASCII file with a .NCI extension. It is read from here by the post executable.
Typically, you do not need to see the NCI file, so Mastercam automatically deletes it after your NC file is created, but if you wish, you can view the file by selecting the NCI file option when you post. (Choose Edit to have the NCI file open up in your default editor.) This can be useful when you are debugging a post problem and want to see the raw numbers that are being read by the post.
Operation parameters are read by the MPParamX.DLL and the information is made available to MP.DLL. This happens behind the scenes and is typically invisible to you.
The post executable then creates an NC file with Gocde from the NCI data. It uses the instructions in the .PST file to customize the output for your specific machine. on page 5 illustrates this process.
Figure 2-1
Figure 2-1: From part file to NC file
Mastercam p art file
WORKING WITH PARAMETERS / How does an MP post work? • 5
Program part in Mastercam
1
• Machine group parameter s
• Tool parameters
• Toolpa t h pa rameters
MPParam X.dll
MP.dll
Binary NCI data for each toolpath
ASCII .NCI file
.PST file
Post operations
2
MP processes data
3
.NC file
Your part program stores two kinds of data: binary NCI data describes the toolpath movements, and operation parameters capture your machine group and toolpath settings. MP reads this data and uses the instructions in the .PST file to customize the NC output for your machine. The NCI data is first saved to an ASCII file so you can review it, if desired, for troubleshooting.
4
Part program is created
6 • MASTERCAM X3 / Post Parameter Reference

Reading the NCI file

The NCI file is organized in two-line groups.
The first line contains a single value. This is the NCI Gcode. It tells Mastercam what
type of command this is and how to interpret the second line.“NCI Gcodes” on page 298 lists all of the possible NCI Gcodes.
The second line contains parameters for the NCI Gcode—for example, the X, Y, Z
position and feed rate for a motion command.
This example shows an actual NCI line set for a linear move at rapid feed rate:
0
0 2.375 2.375 2.5 –2. 0
Definition:
g (NCI Gcode)
1 2 3 4 5 6 (six parameters)
Where:
g 0: Linear Move at Rapid Feed Rate (NCI Gcode)
1 Cutter Compensation
2 Final X position
3 Final Y position
4 Final Z position
5 Feed rate settings
6 Contour flag
The post executable stores these parameter values in the appropriate predefined MP variables, performs additional calculations to generate values for other predefined variables that are commonly used for the NCI Gcode type being processed, and performs any routines enabled by the post customization file for the NCI Gcode type—for example, breaking an arc at its quadrants.

Operation (10000s) parameters

Operation parameters are numbered from 10000–19999. In addition to toolpath settings, they include machine definition, control definition, and machine group settings. Operation parameter values can be integers, real values, or strings. “Parameter Reference” on page 87 lists all the possible parameters.
The MPPARAMX.DLL makes the operation parameters directly available to MP. This is a change in Mastercam X3 from earlier versions of Mastercam, in which parameters needed to be written to an .OPS file before they could be read by the post. MP includes a number of functions that you can use to query the value of the parameters that you are interested in. These are described in “Reading operation and tool parameters” on page 8.

Tool information (20000s) parameters

The 20000s parameters are written in the tool change series of NCI lines. Beginning with Mastercam X, these are also written for null tool changes; in previous versions, these were only written for actual tool changes. The information is written just prior to the actual tool change NCI Gcodes (1000, 1001 and 1002) as a “two line sets” of NCI lines. The first line gives the parameter number, and the second line gives the value of the parameter. For example:
20001
1/4 FLAT ENDMILL
20002
WORKING WITH PARAMETERS / How does an MP post work? • 7
20003
20004
1 10 1 0 0.25 0. 0. 180. 1 1 6.4176 6.4176 6.4176 2139 1 4
20006
0 50. 50. 25. 25. 0. 0. 0.
20007
0. 2. 3. 2.5 0.25 2. 1. 0 100. 25. 0
20008
0. 0. 1. 0 0. 0. 0 0. 0.
Like operation parameters, tool parameter values can be either integers, real values, or strings. One difference between operations and tool parameters is that tool parameters might be defined to contain an entire series of values, whereas operations parameters typically only contain a single value. In the example above, the 20001 parameter contains only a single value, a string that is the tool name. However, the 20004 parameter, which encodes the tool definition, contains a series of 16 values. Each value represents a different tool definition parameter. The Parameter Reference in the next chapter describes the data structure for each parameter as well as the type of value it can contain.
Note: Strings are always passed as a single parameter.
Another change introduced with Mastercam X is how Mastercam Wire uses these parameters. In previous versions of Mastercam, 20000 parameters were not output for Wire operations.
8 • MASTERCAM X3 / Post Parameter Reference

Reading operation and tool parameters

The following sections describe how to access parameter values for tool and operation parameters using the pparameter$ postblock. These sections apply to operation parameters in the 10000–16999 range, and the 20000s tool parameters. See “Machine definition, control definition, and machine group parameters” on page 16 to learn about accessing the 17000–19990 parameters.

Extracting string and numeric data

Since most parameters do not have predefined variables associated with them, your post needs to have a routine to extract the parameter values from the .ops file or NCI file before you can use them. Mastercam provides the following building blocks that you can use to construct these routines:
a single common postblock pparameter$
a numeric variable prmcode$ that holds the NCI Gcode or parameter number, as
described in “Parameter Reference” on page 87
a string variable sparameter$ that holds the parameter(s) as a single string
In addition, you need to create a user-defined variable to store the value of each parameter. This should be either numeric or string to match the parameter.
The postblock pparameter$ is called repeatedly for each set of prmcode$ and sparameter$ that is read from the NCI file or the .ops file. The parameter value is then copied from sparameter$ to the user-defined variable. If the data type of the desired parameter is numeric, the string returned from sparameter$ will need to be conveted to a number. The following sections show numerous techniques of accessing parameter values.
IMPORTANT: Beginning with Mastercam X3, operation parameters are no longer output in a fixed sequential order. This means that routines in your PST file that depend on parameter output order can no longer be relied upon. Such routines need to be modified so that they do not rely on this logic. Use the new post func­tions described in “Mastercam X3 parameter read functions” on page 10 to directly query parameter values.
Mastercam X2 and earlier
The techniques in this section use the parameter tools from Mastercam X2. They all work in Mastercam X3, and generally apply to older versions of Mastercam as well.
Extracting a common string variable
This example shows how to get a string value from a parameter — in this case, from parameter number 10000, which is the name of the operation type.
string_user # Define a string
pparameter$ # Predefined parameter postblock
if prmcode$ = 10000, string_user = sparameter$
# Capture the parameter string
Extracting a numeric variable
To extract a numeric value from the parameter, first get the string from sparameter$, then use the rpar function to convert it to a number. The target of rpar is the numeric
WORKING WITH PARAMETERS / Reading operation and tool parameters • 9
variable that will store the parameter value. This can be either a user-defined variable or a predefined variable.
This example shows how to get the value of parameter 10042, which is the program number.
# Define a numeric variable to store the parameter value
my_prog_num : 0
pparameter$ # Predefined parameter postblock
if prmcode$ = 10042, my_prog_num = rpar(sparameter$, 1)
# Capture the 1st numeric value in the parameter string
Unfortunately, common NC parameters might have different numbers —and therefore, different prmcode$ identifier values—depending on the operation type. Therefore, it is necessary to select the prmcode$ based on the operation type. Typically, the numeric variable opcode$ is used to accomplish this.
In the following example, a lookup table function fprmtbl and the formula fprm are used to extract the parameters. The lookup table consists of two columns:
The first column contains the prmcode$ identifier value that is to be captured.
The second column contains the numeric or string variable that the parameter
value will be stored in. You must create the user-defined numeric or string variables, or use predefined variables.
The lookup table function fprmtbl consists of the label fprmtb, a unique table number (usually this is the opcode$ that contains the prmcode$ identifier values you are looking for) and the number of entries in the table. For example:
string1 : 0 # User-defined string variables
string2 : 0
var1 : 0 # User-defined numeric variables
var2 : 0
var3 : 0
result : 0
fprmtbl 2 5 # Table Number, Size
10000 string1 # Toolpath ID (string)
10001 string2 # Tool String
10002 var1 # Tool Number
10003 var2 # Tool Dia. Offset Number
10004 var3 # Tool Length Number
The lookup table call is performed by the formula function fprm. It returns a value of 1 if the table is found or 0 if the table was not found. The parameter in the function is keyed to the table number. In this example, if the opcode$ value is 2, then the table is called. If any prmcode$ value matches a value in the table, Mastercam will copy the parameter value to the associated variable.
pparameter$ # Predefined parameter postblock
result = fprm(opcode$)
Extracting numeric values from 20000s parameters
Recall that tool (20000s) parameters can contain a series of values, which can be either integer or real values. In this case, the value of sparameter$ will be a string that containes a series of values delimited by spaces. Use the rpar function to extract the individual values from the string so they can be stored in separate variables.
The following example shows how to parse a parameter string which contains 5 separate values. First, create a series of unique, user-defined numeric variables to store the results. When you call rpar, set the target variable to the first variable in the list. The second parameter in the rpar function call indicates the number of entries in the list—in this case,
10 • MASTERCAM X3 / Post Parameter Reference
5. Mastercam then automatically populates the five variables with the first five values from the parameter string.
# User-defined numeric variables (defined in order for an implied array)
var1 : 0
var2 : 0
var3 : 0
var4 : 0
var5 : 0
pparameter$ # Predefined parameter postblock
# Capture the numeric values in the parameter string
if prmcode$ = 20004, var1 = rpar(sparameter$, 5)
An example of an actual NCI line for this parameter might be
20004
1.1 2.2 3.3 4.4 5.5
So in this example, var1 = 1.1, var2 = 2.2, var3 = 3.3, var4 = 4.4, and var5 =
5.5.
Mastercam X3 parameter read functions
Mastercam X3 post developers have two additional parameter read functions at their disposal: rparsngl and rparsprm. These are versions of the rpar function discussed in the previous sections.
Use rparsngl to retrieve a single parameter value. It works similar to rpar,
except that you do not need to reserve an entire implied array of variables.
Use rparsprm to retrieve a specific range of parameters.
IMPORTANT: These functions will not work with Mastercam X2 or earlier versions.
Here are some examples that compare the new functions to rpar. Example 1 is an example from a current X2 MR2 post. It uses rpar to retrieve the ninth value from the 20008 line. You need to create a predefined implied array to store all nine values.
Example 1: Parameter read example—legacy functions
# Numeric variables to hold '20008' tool parameters
# Do NOT change the order of these (9) variable definitions !
agg_val1 : 0 #Head axis in X
agg_val2 : 0 #Head axis in Y
agg_val3 : 0 #Head axis in Z
agg_val4 : 0 #Head body type
agg_val5 : 0 #Head body diameter
agg_val6 : 0 #Head body length
agg_val7 : 0 #Station body type
agg_val8 : 0 #Station body diameter
gauge_length : 0 #Station body length
pparameter$ #Read operation parameters
if prmcode$ = 20008, #Aggregate head parameters
[
#Reinitialize Var before parameter read
gauge_length = 0 #"Tool Axis Length"
#Get shift value, pivot to collet face
agg_val1 = rpar(sparameter$, 9)
]
WORKING WITH PARAMETERS / Reading operation and tool parameters • 11
Example 2 uses the rparsngl to get the same parameter. Since it gets the desired value
directly, there is no need for the predefined array. You only need to define a single variable for the value you are retrieving.
Example 2: Parameter read example—rparsngl function
gauge_length : 0 #Station body length
pparameter$ #Read operation parameters
if prmcode$ = 20008, gauge_length = rparsngl(sparameter$, 9)
The general form of the function is
return = rparsngl(string, val)
where
return is the variable that will store the desired parameter value.
string is the string to get the parameter value from.
val is the index number of the parameter to read.
Example 3 uses the rparsprm to get the fourth through seventh values from the 20007 line.
Using rpar, you would have needed to define seven variables to store all seven values. Using rparsprm, you only need to define variables for just the four values that you want to retrieve.
Example 3: Parameter read example—rparsngl function
tl_shoulder_length : #Shoulder length
tl_arbor_diam : #Arbor diameter
tl_holder_diam : #Holder diameter
tl_holder_length : #Holder length
pparameter$ #Read operation parameters
if prmcode$ = 20007, tl_shoulder_length = rparsprm(4, 4)
The general form of the function is
return = rparsprm(val1, val2)
where
return is the first variable in the implied array that will store the desired
parameter values.
val1 is the index position of the first parameter in sparameter$ that you want to
retrieve.
val2 is the total number of parameters to retrieve.
Those of you who attended the Reseller Conference will recognize these new functions from the Posts Department presentations. These functions should be working in the current Mastercam X3 Beta 2 software.

Techniques for reading operation parameters

This section discusses several specialized topics and techniques related to reading parameters. It also shows a more complete example of capturing operation parameters.
The examples in this section can be used in both Mastercam X3 and earlier versions of Mastercam.
Example: Capturing operation parameters
This example captures both string and numeric parameters. The operation type is a string value; the number of roughing cuts and their spacing are numeric values. See “Operation &
12 • MASTERCAM X3 / Post Parameter Reference
toolpath parameters” on page 88 for a comprehensive reference of all the operation parameters.
sop_type_name # Define string variable for the operation type
num_rough_cuts : 0 # Define numeric variable for the
spcng_rough_cuts : 0 # Define numeric variable for
psof$ # Start of file postblock rd_prm_op_no$ = 0 # The number of the operation whose # parameters you want to retrieve rd_params$ # Get the parameters - call pparameter$
pparameter$ # Parameter capture postblock
# Get operation type string if prmcode$ = 10000, sop_type_name = sparameter$
# Capture numeric data for component ID and type if prmcode$ = 10106, num_rough_cuts = rpar(sparameter$, 1) if prmcode$ = 10107, spcng_rough_cuts = rpar(sparameter$, 1)
NC parameters with the pre-read routine
number of rough cuts
# the spacing between the rough cuts
The preparatory or pre-read routine used in the post executable file can read NC parameter information. This capability is enabled when the post customization file has the predefined numeric variable tooltable$ set to 1 or 3 to activate the pre-read routine for calls to the pwrtt$ and pwrttparam$ postblocks. The postblocks must both be declared in the post customization file. The procedure is the same as in “Extracting string and numeric data” on page 8 except that the postblock pwrttparam$ is called during the pre­read routine instead of pparameter$. During the pre-read routine, the comment NCI Gcodes (1005, 1006, 1007 and 1008) are read and passed through the numeric variable prmcode$ and the string variable sparameter$.
Determining the prmcode$ for a specific parameter
Sometimes it can be difficult to determine exactly which parameter code contains the parameter that you need for a specific application. Use the techniques described in this section as a “brute force” approach to isolating the parameter code.
Add the pparameter$ postblock to the post customization file (.PST), if it does not already exist.
pparameter$ #Information from parameters
# This is the line that “dumps” the data
~prmcode$, " = ", sparameter$, e$
Make sure that options to create the .OPS file are set in the control definition.
Create a toolpath of the type that has the parameter you are looking for. This example will demonstrate finding the prmcode$ values for the XY Stock to leave and Z stock to leave parameters on a contour toolpath. For this example, create a 2D contour toolpath with the following settings:
WORKING WITH PARAMETERS / Reading operation and tool parameters • 13
For the two fields that you are interested in, enter distinctive values that are not likely to be used anywhere else.
The following line in the post processor:
# This is the line that “dumps” the data
~prmcode$, " = ", sparameter$, e$
will cause all the parameters for this 2D contour toolpath to be “dumped” into the NC output file. This can be a very long list of numbers. The distinctive values that were entered for the two fields should make them easier to locate in the NC file.
Open the NC output file into a text editor and do a search for the “unique” values for XY Stock to leave and Z stock to leave.
The search for 0.01234 finds this line in the NC file:
prmcode$ 10010. = 0.01234
The search for 0.00987 finds this line in the NC file:
prmcode$ 10068. = 0.00987
These are most likely the desired prmcode$ values.
To verify that these are the correct prmcode$ values, go back to the Contour parameters tab in Mastercam and change one of them to a new value. Re-post the operation and search the NC file for the new value. If you find the new value with the same prmcode$, you can be confident that you have found the prmcode$ value that you can use to retrieve this specific parameter.
Following is the altered postblock and some user-defined numeric variables that these parameter values will be saved into.
xy_stock : 0 # Declare a numeric variable to hold
# the "XY stock to leave" setting
z_stock : 0 # Declare a numeric variable to hold
# the "Z stock to leave" setting
fmt "XY stock= " 2 xy_stock # Assign an output format
fmt "Z stock= " 2 z_stock # Assign an output format
14 • MASTERCAM X3 / Post Parameter Reference
pparameter$ # Information from parameters
# Capture parameter values if prmcode$ = 10010, xy_stock = rpar(sparameter$, 1)
if prmcode$ = 10068, z_stock = rpar(sparameter$, 1)
Now you can use the values from the user-defined variables xy_stock and z_stock however you wish in your post processor.
For example, if you add the postline shown below to a
ptoolcomment$ #Comment for tool
tnote = t$
toffnote = tloffno$
tlngnote = tlngno$
"(", pstrtool, *tnote, *toffnote, *tlngnote, *tldia$, ")",e$
# ADDED THIS LINE
"(", "Stock: ", ~xy_stock, " , ", ~z_stock, ")", e$
ptoolcomment$ postblock:
The NC output will look like the following example:
O0001
(PROGRAM NAME – OPS_PARAMETERS_EXAMPLE)
(DATE, Day-Month-Year - 08-06-03 TIME, Hr:Min - 11:30)
N10G20
N12G0G17G40G49G80G90
(3/8 FLAT ENDMILL TOOL - 1 DIA. OFF. - 1 LEN. - 1 DIA. - .375)
(Stock: XY stock= .0123 , Z stock= .0099)
N14T1M6
Accessing parameter information with C-Hooks
C-Hook developers who want to read the parameters from the operation parameter file can include the mpparam.dll as an implicit DLL. The developer must create a while loop and process each operation that was written to the parameter file. The DLL generates a Gcode and string as though NCI data were being presented from the NCI file.
The .ops file contains all the data in the actual operation structures associated with each toolpath operation in Mastercam. It contains an operation-by-operation record of the toolpath and operation settings as they are entered in the various toolpath parameter dialog boxes. The data in the .ops file is organized according to the definition of the structure operation, as found in the header file m_vars.h . (This file is part of the C­Hook Developer’s Kit).
See the file header
mpparam.h and the C-Hook operations header m_vars.h for the
structures contained in the operation parameter file.
Example 4: Using C to read parameter information inside a C-Hook
if (bDoParamRead)
{
while (!opsTerminate)
{
fnMpparam(szFnam, &psGcode, szString, 80, &nOpsReset,
&nOpsTerminate, nOpsRead);
//Your code here
}
nOpsTerminate = 0;
}
This is the interface from mpparam.h:
//Remove extern "C" in C files
WORKING WITH PARAMETERS / Reading operation and tool parameters • 15
extern "C" MPPARAM_API int fnMpparam // 0 for normal termination
char* sopername, // I: The .ops file path and name to be read
short* gcode, // O: 10000's gcode
char* sparameter, // O: String conversion of data
int str_length, // I: Maximum string length
int* reset, // I: Reset the input file
int* terminate, // O: Terminate the current read section
int view_all); // I: Write all parameters from database
Note: Beginning with Mastercam X3, Mastercam includes a block of parameter numbers that are reserved for C-Hook developers; see page 162. These include parame­ters number 30000–31999.
Other useful variables
Using the strtool_v7$ variable
The numeric variable strtool_v7$ 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. This variable was added to allow the tool description to appear as in Mastercam Version 6.
strtool_v7$ is used to capture the description from the tool definition (NCI Gcode 20001 in the NCI file) to replace the tool name that is on the NCI Gcode 1013 line. This description is entered in the Define Tool dialog box, in the Tool name field on the Parameters tab. The tool name is replaced if strtool_v7$ is 1. The string is copied into the predefined string variables strtool$, strtoolpath$, and strtoolext$.
16 • MASTERCAM X3 / Post Parameter Reference

Machine definition, control definition, and machine group parameters

Mastercam X introduced a number of new data structures to expose the new parameters from the machine definition, control definition, and machine group. These three sets of parameters are in addition to the sets of tool and operation parameters used in earlier versions of Mastercam. The new parameters have NCI Gcodes in the 17000–19999 range. In this section you can learn about:
Postblocks and variables introduced with Mastercam X to read these new groups
of parameters.
Sample code that illustrates how to access the new parameters.
A catalog of screen captures from the Machine Definition Manager, Control
Definition Manager, and machine group properties pages showing which parameters store the value of each field.

Reading the parameters

Unlike the operation and tool parameters, use the pmachineinfo$ postblock to access all the parameters from the machine group, machine definition, and control definition. There are no pre-defined variables for most of this data; the post writer needs to create and define numeric and string variables to hold the data from the desired parameters, and then rely on calls to pmachineinfo$ to read the parameter values to be stored in them.
Use the following commands:
rd_cd$ is used to call pmachineinfo$ and read the parameters for the active
control definition. See “Capturing control definition parameters” on page 18.
rd_tlpathgrp$ is used to call pmachineinfo$ and read the parameters for the
active machine group. See “Capturing machine group parameters” on page 18.
rd_md$ is used to call pmachineinfo$ and read the parameters for the active
machine definition. It uses the rd_mch_ent_no$ variable. This is an integer that represents a specific entity in the machine definition. rd_md$ returns the parameters for the machine entity specified by the current value of rd_mch_ent_no$. Therefore, to get all the parameters for the entire machine definition, rd_md$ needs to be called multiple times, once for each distinct entity in the machine definition. Each entity corresponds to an individual component in the machine definition tree, such as a single axis, spindle, chuck, etc. “Capturing machine definition parameters” on page 17.
A similar function can be used for reading operation parameters:
rd_params$ is used to call the pparameter$ postblock to read operation
parameters. It uses another variable called rd_param_op_no$, which is an integer that specifies the operation whose parameters will be read.
The following sections show examples of how to capture each of the parameter types. In general, this is done in three stages:
See
Create and initialize the variables you will use to store the parameter values.
Use rd_cd$, rd_md$, rd_tlpathgrp$, or rd_params$ to call the proper
postblock
Use prmcode$ to find the desired parameter, and sparameter/rpar$ to read its value and store it in your variable
.
.
WORKING WITH PARAMETERS / Machine definition, control definition, and machine group parameters • 17
Each of these sections also includes a series of pictures showing which parameters are set by each machine definition, control definition, and machine group field.
Every control and machine definition field referenced in these pages is available as a post parameter. In cases where the value of the field is available as a pre-defined variable in addition to a parameter, MP automatically sets the value of the variable to the value stored in the control or machine definition, and the post writer has the choice of reading either the parameter value or the variable value.
Capturing machine definition parameters
This example finds the name of a machine component (a string value), and its ID and component type (numeric values). See “Machine definition parameters” on page 210 for a comprehensive reference of all the machine definition parameters.
Example 5: Capturing machine definition parameters
scomp_name # Define string variable for the component name mch_comp_idno : 0 # Define numeric variable for component ID mch_comp_type : 0 # Define numeric var for component type
psof$ # Start of file postblock rd_mch_ent_no$ = 0 # The number of the machine entity to retrieve rd_md$ # Get the machine entity parameters - call pmachineinfo$
pmachineinfo$ # Parameter capture postblock
# Get component name string if prmcode$ = 17201, scomp_name = sparameter$
# Capture numeric data for component ID and type if prmcode$ = 19959, mch_comp_idno = rpar(sparameter$, 1) if prmcode$ = 19958, mch_comp_type = rpar(sparameter$, 1)
Note that rd_mch_ent_no$ can be used to reference either an axis combination or a specific component. Since machine definitions can have redundant components among different axis combinations, this lets you know precisely which component is being referred to. The value of rd_mch_ent_no$ is interpreted according to the following table:
Valu e Interpretation
–2 Uses the value of sparameter$ to find the axis combination.
For example, sparameter$ might equal “Upper Left.” (The value of sparameter$ needs to be set before this call.)
–1 Reads the entire machine definition file. The order is base
parameters, axis combinations, and then components.
0 Reads only the machine base.
any positive
number
Represents the entity ID of the component. First the axis combinations are checked for a match and then the components.
The value of the axis combination ID is written to the G950 line and is available via the syncaxis$ variable. You can use the expression rd_mch_ent_no$ = syncaxis$ to get the ID of the current axis combination. The following example uses syncaxis$ to get the name of the current axis combination.
Example 6: Getting the axis combination
my_axis_combo # Define string variable for axis combo name
18 • MASTERCAM X3 / Post Parameter Reference
psof$ # Start of file postblock
rd_mch_ent_no$ = syncaxis$
rd_md$ # Get the machine entity parameters - call pmachineinfo$
pmachineinfo$ # Parameter capture postblock
# Get axis combo name string if prmcode$ = 17201, my_axis_combo = sparameter$
Capturing control definition parameters
This example finds the name of the setup sheet (a string value), and the inch and metric machine tolerances (numeric values). See “Control definition parameters” on page 250 for a complete list of all the control definition parameters. and “Control definition pages” on page 53 for a visual catalog of the pages in the Control Definition Manager.
Example 7: Capturing control definition parameters
ssetup_sheet # Define string variable for setup sheet string cd_mtol_in : 0 # Define numeric variable for mtol – inches cd_mtol_mm : 0 # Define numeric variable for mtol – metric
psof$ # Start of file postblock rd_cd$ # Get the control parameters - call pmachineinfo$
pmachineinfo$ # Parameter capture postblock
# Capture string data for the name of the setup sheet if prmcode$ = 18160, ssetup_sheet = sparameter$
# Capture numeric data for mtol, inch and metric if prmcode$ = 18055, cd_mtol_in = rpar(sparameter$, 1) if prmcode$ = 10856, cd_mtol_mm = rpar(sparameter$, 1)
Capturing machine group parameters
This example finds the file name of the machine definition associated with the machine group of the operations being posted, together with the name of the machine group and its number. See “Machine group parameters” on page 279 for a comprehensive reference of all the machine group parameters.
Example 8: Capturing machine group parameters
smd_file_name # Define string variable for name of
stp_grp_name # Define string variable for name of
tp_grp_number : 0 # Define numeric variable for the
psof$ # Start of file postblock rd_tlpathgrp$ # Get the toolpath group parameters -
pmachineinfo$ # Parameter capture postblock
# the machine definition file
# the machine group
# machine group number
# call pmachineinfo
# Capture numeric data for toolpath group number if prmcode$ = 18500, tp_grp_number = rpar(sparameter$, 1)
# Capture string data for machine filename and group name if prmcode$ = 18501, stp_grp_name = sparameter$ if prmcode$ = 18601, smd_file_name = sparameter$
Loading...
+ 386 hidden pages