Create and call tool break macros.
To create a format macro
Start CAMplete TruePath.
In the ribbon, go to Manage > Resources > NC Formats.
Expand the NC Format.
Click the Format Macros block.
Click Edit.
Click Add to add a macro.
Give the macro a name, for example TOOL_BREAKAGE. The macro name can’t contain any spaces. This example uses an underscore instead of a space.
Click OK.
The new macro appears in the Format Tree in the NC Format Editor window.
Select the macro in the Format Tree.
Click Insert New Line.
Click New Codes Window.
In the New Command Code window, scroll down to the Custom code.
Drag the Custom code into the Code Layout column of line 1 in the NC Format Editor window.
In the Default Settings column of line 1, add the text for the tool breakage cycle to the Custom Code text box, for example, G65P1234. G65P1234 is used for the purpose of this example and the code for your machine may differ.
Important: Custom codes aren’t simulated and therefore aren’t checked for collisions. The status view shows a message to this effect when you simulate the program.
Add command codes as needed. This example adds the height offset (H) and d5iameter offset (D) to the cycle output.
To add the height offset, click the New Codes Window.
Drag the H
code to the right of the Custom code. Before closing the New Codes Window, add a Custom code to the right of the H code you just added.
In the text for the Custom code added in the previous step, enter D. Notice the space before the D.
Drag the
code to the right of the Custom code you added in the previous step. Click Finish.
Add a revision note to the Comments text box.
Click OK.
At this point, the macro has been created but not called. Therefore, it isn’t output in the posted code. The next section shows how to call a format macro.
Note: Don’t close the Resource Manager. It’s used in the next section.
To call a macro for each operation
You can call a macro from any block in the NC format. In this example, the macro is called in the tool change block. To call your tool breakage macro for every operation, find the block you want to call the macro in and follow these steps:
Expand the NC format to make the Tool Change Block visible.
Click Tool Change Block.
Click Edit.
Click the Index column in the line after the line where you want to call the tool breakage macro.
Click Insert New Line.
Click New Codes Window.
Scroll down to the Insert Macro code.
Drag the Insert Macro code into the Code Layout column of the newly added line.
In the Default Settings column, click the Code Text Edit button.
The Code Text Edit window appears. At the bottom of the Code Text Edit window, you see a description of the syntax available for this command code. Syntax is available for all codes that have the Code Text Edit icon.
Type the following text into the text box: [INSERT:MACRO=TOOL_BREAKAGE].
Click OK.
Click Finish.
Add a revision note to the Comments text box.
Click OK.
Click Close to close the Resource Manager.
Change the NC format in the CAM Wizard.
When the program regenerates after you close the CAM Wizard, enter G65 in the Find text box.
The code in the Format Macro is output with each tool change.
To call a macro based on a parameter
You can set up a parameter that controls when to output the tool breakage macro.
Select the root of the NC format.
Click Edit.
Click Parameters.
Click Add Parameter.
Double-click in the Identifier column to set the identifier. This is the internal name (for example TOOL_BREAK) of the parameter referenced in the NC format.
Note: The identifier should be in capital letters and can contain only letters and numbers.
Double-click in the Description column to specify the description (for example, Output Tool Breakage?) users see when they set the parameter.
Set the parameter type to Boolean.
Set Default Value to on or off.
In the Apply To column, set the scope of the parameter as Machining Operation.
The parameter settings should look as follows.
Click OK.
Click Finish.
Click OK when prompted.
To call the macro based on the value of the parameter setting, follow the steps in “Call a macro for each operation.” Then add the condition to check the parameter as shown here.
[INSERT:MACRO=TOOL_BREAKAGE]
[IF_MACH_OP_PARAM:TOOL_BREAK=1]
To set a parameter
After you add the parameter check to the NC format, you can control the output of the tool breakage macro by setting parameter values for each operation.
With your project loaded in TruePath, in the ribbon go to Programs > Settings > Parameters.
Select Operations.
Expand an operation to set the parameter for that operation.
Set the parameter value.
Click OK.