Modify a CAMplete TruePath NC format to use miscellaneous Int and Real values from Mastercam NCI files. Each variable is mapped to a Machine Operation Parameter called NCI_MISC_REAL_# and NCI_MISC_INT_# (where # is an integer from 1 to 10).
To read misc values from the NCI
Start CAMplete TruePath.
In the ribbon, go to Manage > Tools > Options.
Click File Types.
In the drop-down, change the filter to Mastercam.
In Additional Options, apply the following settings:
Enable NCI - Cache Misc Variables Items
Enable Map Misc Ints to Operation Parameters
Enable NCI – Map Misc Reals To Operation Parameters
Disable NCI – NCI 1053 records delimit Tool Paths
In this example, green preferences are enabled and red preferences are disabled.
Close the User Preferences dialog.
Close CAMplete TruePath.
To use misc values
You can now apply the values from Miscellaneous Variables to your NC format. Use Path Parameter Output Code. For example, if in Mastercam you use Misc Real #4 as the DL value in a Heidenhain program, you see a path parameter called NCI_MISC_REAL_4 in the tool path. So, if you use Misc Real 4 = 0.25 in Mastercam, you want to output DL0.25 in the G-code.
Important: This code works exactly like custom code. So, any resulting code is output in the G-code but not simulated.
To output a code, type the custom code in the edit. Use this format:
[INSERT:PARAM=<param>,FORMAT=INT|REAL]
- <param> is the name of the NCI parameter, NCI_MISC_REAL_1 to NCI_MISC_REAL_10 and NCI_MISC_INT_1 to NCI_MISC_INT_10.
- FORMAT=INT or REAL. INT has no decimal point. REAL has a decimal point and is formatted like a regular XYZ linear tool position.
Example 1: NCI misc real 4 is set to 0.25 in Mastercam.
DL[INSERT:PARAM=NCI_MISC_REAL_4,FORMAT=REAL]
Output:
DL0.25
Example 2: NCI misc int 3 is set to 10 in Mastercam.
Q100=[INSERT:PARAM=NCI_MISC_INT_3,FORMAT=INT]
Output:
Q100=10
To add the code to the NC format
Start CAMplete TruePath.
In the ribbon, go to Manage > Resources > NC Formats.
Open the Tool Change Block.
Click New Codes Window.
Find the Custom Code (With Parameters).
Drag the code to the TOOL CALL line. For the text, enter the following.
DL[INSERT:PARAM=NCI_MISC_REAL_4,FORMAT=REAL]
Click Finish.
Click OK.
Click Close to close the Resource Manager.
Here is the posted code:
27 TOOL CALL 4 Z S13400 DL0.25
To insert a macro
You can use the values from Miscellaneous Variables to insert a macro using the normal Insert Macro code. Use this syntax:
[INSERT:MACRO=<macro>][IF_PATH_PARAM:<parameter>=<value>]
- <macro> is the name of the format macro.
- <parameter> is the misc INT from Mastercam, NCI_MISC_INT_1 to NCI_MISC_INT_10.
- <value> is the value you are checking.
For example, suppose you set Misc Int 9 to 1 in Mastercam. In that case, the format would be:
[INSERT:MACRO=TOOL_BREAK][IF_PATH_PARAM:NCI_MISC_INT_9=1]
This inserts the macro called TOOL_BREAK check whenever the misc int #4 is set to 1.
To add a macro to the NC format
Macros are user defined blocks that must be created in the N CFormat. To create a macro, follow these steps:
Start CAMplete TruePath.
In the ribbon, go to Manage > Resources > NC Format Manager.
Select the Format Macros section and click Edit.
Click Add.
Enter the name TOOL_BREAK.
Selec the macro in the Format Tree.
Use Insert New Line to add lines. In the New Codes window, add the codes that you need. For example, you can add an M0 code and comment.
Close the Format Macros editor.
Insert the code
In the NC Format, open Tool Change Block.
Select the line with the T-Code.
Click Insert New Line.
Click New Codes Window.
Find the Insert Macro code.
Drag it to the new line.
For that code, add this text:
[INSERT:MACRO=TOOL_BREAK][IF_PATH_PARAM:NCI_MISC_INT_9=1]
Click Finish.
Click OK.
Click Close to close the Resource Manager.
If you now use this format and set NCI Int 9 to 1, it inserts the macro.