How to add the program ID to the output file

2019-09-04T13:01:28Z

Summary


Details

--------------- 
The program will need a Program ID or it will not run on the machine. The 
program ID starts with the letter "O" then a 4 digit number like 1234. A valid 
program ID would be O1234.



Solution

 Generally the program will have a % in the first line then the next line has 
the program ID.



O1234 <------------- Program ID 
N0010 G40 G17 G90 G70; 
N0020 G91 G28 Z0.0; 
N0030 T03 M06; 
N0040 G00 G90 X-1.1128 Y-1.5501 S6112 M03;


To output this requires two steps. One in NX and one in Postbuilder.


In Postbuilder 
-------------- 
In the post goto Program and Tool Path-Custom Command-Import. 
Select pb_cmd_program_header.tcl and Open then OK. 
This will import this custom command into the post. 
Follow the instructions defined in the custom command. 
This completes the Postbuilder step.



# This procedure will output a program header with the following format: 

# Attribute assigned to program (Name of program group) 

# Example: O0001 (NC_PROGRAM) 


# Place this custom command in the start of program event marker. 
# This custom command must be placed after any initial codes (such as #). 
# The custom command MOM_set_seq_off must precede this custom command to 
# prevent sequence numbers from being output with the program number. 

# If you are adding this custom command to a linked post, this custom 
# command must be added to the main post only. It will not be output by 
# any subordinate posts. 

# If there is no attribute assigned to the program group, the string "O0001" 
# will be used. In any case the name of the program in Program View will 
# be output as a comment. 

# To assign an attribute to the program, right click on the program. Under 
# properties, select attribute. Use the string "PROGRAM_NUMBER" (upper case) 
# as the title of the attribute. Enter the string you need for the program 
# name, "O0010" for example, as the value of the attribute. Use type string 
# for the attribute. Each program group can have a unique program number. 
#


 global mom_attr_PROGRAMVIEW_PROGRAM_NUMBER 
 global mom_group_name


 if { ![info exists mom_group_name] } { set mom_group_name "" }


 if { ![info exists mom_attr_PROGRAMVIEW_PROGRAM_NUMBER] } { 
 set mom_attr_PROGRAMVIEW_PROGRAM_NUMBER "O0001" 
 }


 MOM_output_literal "$mom_attr_PROGRAMVIEW_PROGRAM_NUMBER ($mom_group_name)"


In NX 
----- 
While in Manufacturing. Note the following are the instruction defined in 
custom command to be done in NX.


# If there is no attribute assigned to the program group, the string "O0001" 
# will be used. In any case the name of the program in Program View will 
# be output as a comment. 


# To assign an attribute to the program, right click on the program. Under 
# properties, select attribute. Use the string "PROGRAM_NUMBER" (upper case) 
# as the title of the attribute. Enter the string you need for the program 
# name, "O0010" for example, as the value of the attribute. Use type string 
# for the attribute. Each program group can have a unique program number.



Notes and References


Hardware/Software Configuration

Platform: all
OS: n/a
OS Version: n/a
Product: NX
Application: CAM
Version: V10.0.3
Function: POSTBUILDER

Ref: 001-7682093

KB Article ID# PL8011041

Contents

SummaryDetails

Associated Components