-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 1
CHUYN : CAM Post Builder
Sinumerik controller support
View a topic
Sinumerik template posts
Events and cycles for Sinumerik
controllers in NX
Procedures and settings
Cycle832
Cycle95
Add the Sinumerik 840D events in NX
Modify the mill method to support
CYCLE832
Set _camtolerance for Cycle832
Define the machines home position coordinates
ORIRESET and TRAORI
Match the swivel data record of
CYCLE800
Machine home position
Sinumerik template posts
The following template posts support Sinumerik controllers for
mills:
Sinumerik_802D_3axis
Sinumerik_828D
Sinumerik_840D
Sinumerik_840D_millturn
The Sinumerik_840D_lathe template post supports lathes:
Where do I find it?
Post Builder template posts
Application Post Builder
Menu FileNew
Location in dialog box Controller groupLibrary list
Events and cycles for Sinumerik controllers in NX
Supported Sinumerik cycles are documented in Chapter 10 of the
file
Working_with_OOTB_MACH_Simulation_Examples.pdf in your
...\MACH\samples\nc_simulation_samples folder.
Sinumerik
840D
Sets default settings including tolerance, high speed machining
parameters,
five axis orientation parameters, and whether the feed rate is
defined in a
variable.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 2
You can add the Sinumerik 840D start event for:
A single milling operation
The lowest level program group in the Program view of the
Operation Navigator.
The Compressor option works only with linear motion. If the
Compressor
option is set to On, the post will disable circular output, and
output only
linear motion.
If you choose Swiveling in the Transformation option of the
Sinumerik_840D user-defined event, CYCLE800 is output and
transformation is turned off (TRAFOOF), otherwise TRANS/AROT
is
output for coordinate translation and rotation.
You can set the number of significant digits for the output
format, and the
appropriate rounding resolutions, with the custom commands
PB_CMD_reset_output_digits and PB_CMD_set_resolution.
DNC Header Makes the NC output file accessible to the Siemens
Motion Control
Information System (MCIS) by appending the following comments
and
values to the file before the % (start of tape) symbol:
;HEADER-START
;NODENAME=$mom_dnc_machine_name
;NCDATANAME=$mom_dnc_program_name
;NCDATATYPE=$mom_dnc_data_type
;VERSION=$mom_dnc_version_number
;RELEASEID=$mom_dnc_release_number
;DEVELNAME=$mom_dnc_user_name
;HEADER-END
;NC-START
%
Add the user-defined event to the top working program group
under
NC_PROGRAM in your milling program.
Sinumerik
Program
Control
Lets you call external subroutines. Used by
MOM_program_control,
PB_CMD_MOM_program_control,
PB_CMD_start_of_extcall_operation,
PB_CMD_end_of_extcall_operation,
PB_CMD_end_of_extcall_program,
and other procedures.
Add the event to a program group for the Sinumerik_840D and
Sinumerik_828D template posts. Do not add it to operations.
Where do I find it?
Application Manufacturing
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 3
Menu InsertOperation
Location in dialog
box Operation dialog boxMachine Control groupEdit (Start of Path
Events)
Procedures and settings
PB_CMD_set_Sinumerik_default_setting
Set the post default settings (mills only) according to the
Sinumerik version. If the
sinumerik_version is not set, the procedure returns without
making any settings.
Interprets the On and Off parameters from the event dialog box
and the controller version
to sets the appropriate values for variables.
PB_CMD_set_Sinumerik_V7_default_setting
Set the post default settings (802D_3axis) for Sinumerik version
7.
PB_CMD_set_Sinumerik_Version
Sets the Sinumerik version. The default is value is V7.
Sinumerik version 6 and later support CYCLE832 high speed
machining G code output.
Cycle832
To output CYCLE832 parameters, set PB_CMD_set_Sinumerik_version
to V6 or V7.
V6 and V7 have different CYCLE832 codes, as shown in the
following examples.
Sinumerik
version Output example differences
V5
FGREF[C]=10
FGREF[A]=10
$MA_COMPRESS-POS_TOL[X]= _camtolerance*1.2
$MA_COMPRESS-POS_TOL[Y]= _camtolerance*1.2
$MA_COMPRESS-POS_TOL[Z]= _camtolerance*1.2
$MA_COMPRESS-POS_TOL[C]= _camtolerance*12
$MA_COMPRESS-POS_TOL[A]= _camtolerance*12
NEWCONF
FFWON
UPATH
SOFT
COMPCURV
G642
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 4
V6
FGREF[C]=10
FGREF[A]=10
CYCLE832(_camtolerance,112100)
The Compressor, Smoothing, Feed Forward, and Transformation
options set the corresponding bit of the second parameter of
CYCLE832.
The last bit of the second parameter of CYCLE832 defines the
machining
method.
V7
CYCLE832(_camtolerance,0,1)
The Compressor, Smoothing, Feed Forward, and Transformation
options do not affect the CYCLE832 output code.
The second parameter of CYCLE 832 defines the machining
method.
Note The machining method is set in the Mill Method dialog box.
To open the Mill Method
dialog box, in an operation dialog box, in the Path Settings
group, beside Method, click
Edit .
Cycle95
The NX turning processor supports output for the Siemens
Sinumeric 840ds CYCLE95 stock removing cycle in the following
operation types:
FACING
ROUGH_TURN_OD
ROUGH_BACK_TURN
ROUGH_BORE_ID
ROUGH_BACK_BORE
FINISH_TURN_OD
FINISH_BORE_ID
FINISH_BACK_BORE
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 5
Cycle parameters are automatically mapped from NX CAM turning
parameters. Knowledge of
specific output parameters is not required.
Note The IPW that is created by existing operations which are
capable of CYCLE95 output is
used by subsequent operations. This IPW will be only an
approximation of the actual
CYCLE95 results.
The Post Builder template post for the Siemens Sinumerik 840D
Controller has been updated to
include support for CYCLE95.
The contour definition for CYCLE95 is output in the form of a
subprogram. You can output the
subprogram in one of these ways:
In-line with the main program
At the end of main program
In a separate SPF file
On the shop floor, the machine operator can adjust a single line
of code, for example to change
the cut depth per pass. To make the same change with
conventional output, many lines of code
must be recalculated.
Where do I find it?
Application NX
Prerequisite
Create or edit a turning operation of a type listed in the
preceding
article.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 6
Location in dialog
box Machine ControlMotion OutputMachine Cycle
Application Post Builder
Prerequisite Create or edit a SIEMENS SinumeriK_840D_lathe
post.
Location dialog
box
Program & Tool PathCustom
CommandPB_CMD_init_cycle95_output
Add the Sinumerik 840D events in NX
1. In the ...\MACH\resource\user_def_event folder, remove the #
from # INCLUDE
{$UGII_CAM_USER_DEF_EVENT_DIR/Siemens_Cycles.cdl}
This also makes additional parameters, such as Top Dwell and
Final Dwell, available in
the Cycle Parameters dialog box for Hole Making operations.
2. In an operation dialog box, in the Machine Control group,
beside Start of Path Events,
click Edit .
3. In the User Defined Events dialog box, from the Events
Available list, select Sinumerik 840D.
4. Click Add new event . 5. In the Sinumerik 840D dialog box,
specify the options you need, and click OK.
Consult your current Sinumerik manuals for explanations of the
purpose and usage of
each option.
6. Click OK to close the User Defined Events dialog box. 7.
Click OK to save the operation.
Modify the mill method to support CYCLE832
This procedure is for Sinumerik 840D version 6 or later
1. In an operation dialog box, in the Path Settings group, from
the Method list, select the appropriate method.
2. Next to Method, click Edit .
3. In the Mill Method dialog box, in the Path Settings group,
click Edit .
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 7
4. In the Search Result dialog box, from the Matching Items
list, select one of the following options to support CYCLE832:
o OPD0_00021, roughing
Sample code output: CYCLE832 ( _camtolerance, 1112103)
o OPD0_00022, semi-finishing
Sample code output: CYCLE832 ( _camtolerance, 1112102)
o OPD0_00023, finishing
Sample code output: CYCLE832 ( _camtolerance, 1112101)
o OTHERS, prismatic
Sample code output: CYCLE832 ( _camtolerance, 1112100)
5. Click OK to close the Search Result dialog box. 6. Click OK
to close the Mill Method dialog box. 7. Click OK to save the
operation.
Set _camtolerance for Cycle832
For all versions, the default value of _camtolerance is the
average of the Intol and Outtol values
defined in the operation. To output a different value for
_camtolerance:
1. In NX, add the Sinumerik 840D UDE start event. 2. In the
Sinumerik 840D dialog box, in the Tolerance group, select the User
Defined
Tolerance Status checkbox.
3. In the User Defined Tolerance box, type the tolerance value
that you want to use. 4. Click OK until the operation is saved.
Define the machines home position coordinates
To output the safe home position for your machine:
1. In the Post Builder application, click the Machine Tool tab.
2. Under Display Machine Tool, click General Parameters. 3. In the
Home Position group, enter the appropriate X, Y, and Z values. 4.
ORIRESET and TRAORI 5. To change the output order of TRAORI and
rotary angles, ORIRESET must output after
TRAORI. ORIRESET is available in Sinumerik software version
V7.
6. In the template post, ORIRESET is output by the command
PB_CMD_preset_angle. 7. Match the swivel data record of
CYCLE800
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 8
8. The _TC parameter in CYCLE800 is the name of the swivel data
record, and must exactly match the swivel data record name for your
machine.
9. To change the output, modify _TC in the CYCLE800 macro as
shown.
Parameter Expression
_TC \R_DATA\
10. The output would be similar to the following example. 11.
CYCLE800(1,R_DATA,0,57,0.40,0,-45.0,0,0,0,0,-1) 12. If there is
only one swivel data record, it could be blank as shown in the
following
example.
13. CYCLE800(1,"",0,57,0.40,0,45.0,0,0,0,0,-1) Machine home
position
The template post outputs a return motion to the machine home
position before a tool change,
after a tool change, and at the end of an operation. For
example:
SUPA G0 Z=_Z_HOME D0
SUPA G0 X=_X_HOME Y=_Y_HOME C=_C_HOME A=_A_HOME D1
Note D is the Tool Adjust Register value set in the
operation.
The default X, Y, and Z values for safe home position are:
_X_HOME=999999.9
_Y_HOME=999999.9
_Z_HOME=999999.9
Legacy postprocessor conversion
View a topic
Pre V3.4 Mill posts
Pre V3.3 Lathe Posts
Pre V3.1 multi-axis posts
Pre V3.0 XZC Simple Mill-Turn Posts
Pre V3.0 Linked Posts
Correct pre V2.0.2 XZC Mill and Simple
Mill-Turn Posts
Pre V3.4 Mill posts
Preserving New IKS Parameters
In Post Builder 3.3 or earlier, custom commands such as
PB_CMD_init_new_iks were used to
enable the new IKS functionality. Parameters specified in any of
these custom commands are
extracted and preserved with the posts when saved in this
version of Post Builder. Interactively,
these parameters are presented in the appropriate dialog boxes
when a post is open. However, the
parameters are not preserved if the new IKS service was not
enabled (mom_kin_iks_usage = 0)
in the custom command. Default values for the new IKS parameters
are presented instead.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 9
These legacy custom commands are no longer needed but are
retained with the posts for your
reference. You can delete them manually.
Swapping Rotary Axes of Dual-Head Posts
The assignments of rotary axes in all dual-head 5-axis mill
posts created before this version of
Post Builder were intentionally switched to accommodate certain
short comings with the legacy
inverse kinematics solver. The rotary axes assignments are
corrected when a post is saved with
this version of Post Builder.
Kinematic parameters for the 4th rotary axis are swapped with
that of the 5th axis.
The custom command PB_CMD_revert_dual_head_kin_vars is provided
for all 5-axis mill
posts and is used to swap the kinematic parameters of the dual
rotary heads. Use this custom
command whenever the new IKS is disabled.
VNC of Dual Rotary Heads
Prior to NX 4, the NC axes assignment in a VNC file required a
custom command. To convert
the file, manually edit the custom command.
Legacy Posts using ugpadvkins.dll
The new IKS service is disabled for dual-head mill posts using
the ugpadvkins.dll shared library.
The kinematic parameters assigned for the dual rotary heads are
swapped as described above.
Pre V3.3 Lathe Posts
The custom command PB_CMD_output_spindle used by any legacy
lathe posts to output a
block for setting the maximum spindle speed requires the
following entry:
if {$mom_spindle_maximum_rpm > 0} {
MOM_do_template spindle_max_rpm
}
Example
#=============================================================
proc PB_CMD_output_spindle { } {
#=============================================================
global mom_spindle_mode
global spindle_is_out
global mom_spindle_maximum_rpm
if {![info exists spindle_is_out]} {
if {$mom_spindle_mode == "RPM"} {
MOM_force once M_spindle S G_spin
MOM_do_template spindle_rpm
} elseif {$mom_spindle_mode == "SFM" || $mom_spindle_mode ==
"SMM"} {
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 10
MOM_force once M_spindle S G G_spin
# The following line has been changed.
if {$mom_spindle_maximum_rpm > 0} {
MOM_do_template spindle_max_rpm
}
MOM_do_template spindle_css
}
set spindle_is_out 1
}
}
Pre V3.1 multi-axis posts
Axis Limit Violation Handling for a rotary axis specifies how
the postprocessor behaves when
the system reaches a rotary axis limit. The options are:
Warning outputs a message to the warning file, but takes no
action to correct the axis
limit violation.
Retract/Re-engage generates N/C codes that enable the
machine-tool to:
o Retract to clearance geometry (plane, cylinder or sphere) at
the retract feed rate.
o Reposition the rotary axis to a valid position if
possible.
o Re-engage to a specified distance above the part at the
approach feed rate.
o Feed to the previous position where it retracted from at the
engage feed rate.
o Continue moving to the programmed destination.
Parameters for this control are specified in the custom command
PB_CMD_init_rotary
under Program & Tool PathCustom Command. You can modify the
variables mom_kin_retract_type, mom_kin_retract_distance and
mom_kin_reengage_distance to configure how this functionality
behaves.
The parameter mom_kin_retract_plane has been replaced by
mom_kin_retract_distance. The
parameter PLANE used as one of the options of
mom_kin_retract_type in some pre-release
versions of v3.1 has been replaced by SURFACE. After you save
your legacy posts in Post
Builder v3.1, unless you make changes in the custom command
PB_CMD_init_rotary, the
value of mom_kin_retract_plane is transferred to
mom_kin_retract_distance and PLANE is
automatically interpreted as SURFACE.
Pre V3.0 XZC Simple Mill-Turn Posts
The information in the custom commands PB_CMD_init_mill_turn
and
PB_CMD_init_mill_xzc have been converted to dialog box options
on the Machine Tool pages
and removed.
The custom commands PB_CMD_start_of_mill,
PB_CMD_end_of_mill,
PB_CMD_start_of_turn and PB_CMD_end_of_turn have been converted
into event handlers.
You can now edit these event handlers on the Linked Posts
page.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 11
Pre V3.0 Linked Posts
The custom command PB_CMD_init_multiple_post of all legacy posts
has been converted to
dialog box options on the Linked Posts page and removed. The
custom commands used to start
and end each head are converted into event handlers. You can now
edit these event handlers on
the Linked Posts page.
Correct pre V2.0.2 XZC Mill and Simple Mill-Turn Posts
To correct existing XZC mill posts created in Post Builder
version 2.0:
1. Create a new XZC mill post using the existing post as the
controller post. Make sure the new post has the same output units
as the existing post.
2. Transfer your changes of the variables, if any, from the
custom commands PB_CMD_kin_mill_turn_initialize and
PB_CMD_kin_mill_xzc_init to
PB_CMD_init_mill_turn and PB_CMD_init_mill_xzc respectively.
3. Add a line of code containing the return statement at the
beginning of both PB_CMD_kin_mill_turn_initialize and
PB_CMD_kin_mill_xzc_init commands.
4. Examine and save the post.
Postprocessing your tool paths
Postprocessing overview
The NX Manufacturing application generates tool paths that are
used to manufacture parts. A
tool path consists of the following:
Information about tool motion, such as GOTO points, feed rates,
and tool axis
orientation.
Instructions to the controller that are called events, for
example, coolant conditions,
spindle control, and tool changes.
Each machine tool and controller combination has different
requirements, for example, specific
M-codes and G-codes, and the sequence of G-codes that is
permitted in a program line. This
information is not in the initial NX tool path.
Output files
The NX Post output file can be :
Verified in NX with the Simulation Control Panel, which
simulates machine tool motions
and material removal.
Loaded to the controller and run on the shop floor.
Fully simulated with the VNCK application, which uses the
Siemens 840D controllers logic to generate motions, alarms, and so
on. The machine tool must be equipped with the
Siemens Sinumerik 840D controller and VNCK must be configured by
the machine tool
manufacturer
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 12
NX/Post Builder dialog box overview
Use the NX/Post Builder dialog box to do the following:
Define a new post processor in the Create New Post Processor
dialog box.
Edit an existing post processor.
Manage the available forms of help for the other dialog
boxes.
The dialog box contains only a menu bar, toolbar, and a cue
line. Other dialog boxes appear as
you perform tasks related to post processor definition.
Suggestions for your current task appear in the cue line in the
NX/Post Builder dialog box.
Where do I find it?
Menu StartAll ProgramsSiemens NX 8.0Manufacturing ToolsPost
Builder
Defining a new postprocessor
Use the New command in the Post Builder application to define
the following:
The name and description of your new post processor.
The type of post to be created: Main Post or Units Only
Subpost
The default output units
The type of machine tool for which the post is intended
The controller information
You can also choose to enable the user defined event editor and
user cycle editing by default
anytime the post is opened for edit.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 13
Where do I find it?
Application Post Builder
Shortcut button New
Menu FileNew
Defining and editing main post processors
The dialog box to define and edit a post processor shows the
name of the currently open post
processor in its title bar.
The following main tabs are available:
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 14
Machine Tool Lets you display a generic view of the machine
tool, set basic kinematic
parameters of the machine tool, and set or modify some basic
controller
capabilities, such as whether to output circular records.
Program &
Tool Path
Lets you add code blocks and words, set the format and
sequencing for
controller words, managed linked posts, and more.
N/C Data
Definitions
Lets you modify blocks, words, formats, and word formats; attach
user
defined event files; and inherit user defined events from other
posts.
Output
settings
Lets you manage listing file output and listing file content,
attach units-
only subposts, and more.
Virtual N/C
Controller
Lets you configure a virtual numeric controller. Output is
compatible only
with the Tcl-based machine tool driver, or MTD.
Where do I find it?
Application Post Builder
Toolbar NX/Post BuilderOpen
Menu
NX/Post BuilderFileOpen
NX/Post BuilderFileRecently Opened Posts
Create New Post Processor dialog box OK
Defining and editing units-only subposts
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 15
The dialog box to define and edit a post processor shows the
name of the currently open post
processor in its title bar.
Values from the main post are shown in blue boxes that cannot be
changed in this dialog box.
Values for the units of the subpost appear in white boxes that
you can modify.
The following main tabs are available:
Units
Parameters
Values default to standard conversions of values in the main
post.
If your machine and controller manuals specify different values
from the
automatically converted values, you can set them on this
tab.
WORD Values for word formats are defaulted to the same number of
digits, with a
shift in the decimal point.
For example, if the format is 4.4 in Inches, it is represented
in this dialog
box as 9999.9999.
The metric format is automatically converted to 9999.999.
If your controller recognizes a different format for alternate
units, you can
set it on this tab.
FORMAT Values for word formats are defaulted to the same number
of digits, with a
shift in the decimal point.
This tab has formats for absolute coordinates, coordinates, and
feed rates.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 16
Where do I find it?
Application Post Builder
Prerequisite
You must have a main post from NX 8 or later on which to
base the subpost.
Toolbar NX/Post BuilderOpen
Menu
NX/Post BuilderFileOpen
NX/Post BuilderFileRecently Opened Posts
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 17
Create New Post Processor dialog box OK
Create a mill-turn post
1. Create a new 2-axis lathe post. 2. Save the 2-axis lathe post
using one of the following options:
o Save it as lathe_tool_tip in the folder where you intend to
create your mill-turn
post.
o Save it in your postprocessor folder, using a name of your
choice.
3. Create a new mill post and select 3-Axis Mill-Turn (XZC). 4.
In the mill post, on the Machine Tool tab, on the General
Parameters page, under
Machine Mode, do one of the following:
o If you saved the 2-axis lathe post as lathe_tool_tip in the
folder where you intend
to save your mill-turn post, select XZC Mill to automatically
use the
lathe_tool_tip post.
o If you saved your lathe post in your postprocessor folder
using a name of your
choice, select Simple Mill-Turn and click Select Name to
navigate to your lathe
post.
5. Complete your mill post and save it to the folder where you
saved your lathe post. 6. In NX, on the Navigator toolbar, click
Geometry 7. Make sure that all the lathe tool paths are in the
MCS_SPINDLE group object. 8. Make sure that all the mill tool paths
are in the MCS_MILL group object. 9. Postprocess your tool paths.
10. Customizing Post Builder 11. Post Builder allows you to
customize the appearance of the dialogs. Work with the
following two files to make your customization changes.
12. ui_pb_resource.tcl 13. You can modify this file to change
the default font sets, labels, messages and text strings
that appear throughout Post Builder. Only the system
administrator should change this
file. This file resides in the POSTBUILD/app/ui directory.
14. ui_pb_user_resource.tcl 15. You can modify this file to
overwrite the ui_pb_resource.tcl file. This file also resides
in
the POSTBUILD/app/ui directory. You should copy this file to
your home directory in
order to personally customize the appearance and behavior of
Post Builder.
16. On Unix this directory is /users/log_name. 17. On Windows
this directory is found by typing echo %homedrive%%homepath% from
a
DOS command prompt.
18. The following example allows you to change the font
appearance on your display, either increase or decrease the size of
the numbers in the file. Only change the value of the
numbers or the name of the browser.
19. You can change other features as well. 20.
########################################################################
######
21. # UI_PB_USER_RESOURCE.TCL
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 18
22.
##############################################################################
23. # Description 24. # This file defines personalized resources
for the Post Builder. 25. # 26.
########################################################################
######
27. global gPB env Tcl_platform tixOption 28.
#======================== 29. # Font set specification 30.
#======================== 31. if {$tcl_platform(platform) ==
"windows"} \ 32. { 33. set gPB(font) {ansi 8} 34. set gPB(font_sm)
{ansi 6} 35. set gPB(bold_font) {ansi 8 bold} 36. set
gPB(bold_font_lg) {ansi 10 bold} 37. set gPB(italic_font) {ansi 8
italic bold} 38. set gPB(fixed_font) {courier 8} 39. set
gPB(fixed_font_sm) {courier 6} 40. }
Install your own language translation file
You can translate Post Builder into a language that is not
installed with the software if you have
a language translation file. To install a new language:
1. In the POSTBUILD/msgs folder, copy one of the installed
language files and rename it. This example uses
pb_msg_english.tcl.
Note Edit and save the file with unicode utf-8 encoding.
2. Define the label for your language. Add the following lines
just below the language test: 3.
#+++++++++++++++++++++++++++++++++++++++++++ 4. # Define label in
Unicode for this language 5.
#+++++++++++++++++++++++++++++++++++++++++++ 6. set
gPB(my_language,LABEL) "my_label"
a. Replace my_language with the name of your language
translation file. Use your language file name as the locale name
throughout the translation file.
b. Replace my_label with the label for your new language
selection.
This label appears in the language list when you choose
OptionsLanguage.
7. To prevent Post Builder from using an incomplete translation
file, replace return 1 with return 0.
8. Replace every instance of mcset pb_msg_english with the name
of your language translation file.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 19
9. Replace every English label with your translation. 10.
Replace return 0 with return 1 when the file is ready to use. 11.
Save the file with unicode utf-8 encoding.
Example of custom translation file modifications
################## DO NOT CHANGE ANYTHING ABOVE THIS LINE
###################
if { [info exists gPB(LANG_TEST)] } {
#+++++++++++++++++++++++++++++++++++++++++++
# Define label in Unicode for this language
#+++++++++++++++++++++++++++++++++++++++++++
set gPB(my_language,LABEL) "My_label"
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Return "1" when this language file is ready to be
deployed,
# otherwise return "0".
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
return 1
}
##------
## Title
##
::msgcat::mcset my_language "MC(main,title,Unigraphics)"
"Unigraphics"
::msgcat::mcset my_language "MC(main,title,UG)" "UG"
::msgcat::mcset my_language "MC(main,title,Post_Builder)"
"My_title"
Modal Word Groups and mom Variables
Modal
Group MOM Variable Default Value Description
G_cutc
om
$mom_sys_cutcom_code(LEFT) 41 Cutcom Left
$mom_sys_cutcom_code(RIGHT) 42 Cutcom Right
$mom_sys_cutcom_code(OFF) 40 Cutcom Off
$mom_sys_cutcom_code($mom_cutcom
_status)
$mom_sys_cutcom_code(L
EFT)
Cutcom
(LEFT/RIGHT
/OFF)
G_plan
e
$mom_sys_cutcom_plane_code(XY) 17
XY Plane
Code
$mom_sys_cutcom_plane_code(ZX) 18 ZX Plane Code
$mom_sys_cutcom_plane_code(YZ) 19 YZ Plane Code
$mom_sys_cutcom_plane_code($mom_p
os_arc_plane)
$mom_sys_cutcom_plane_c
ode(XY)
Arc Plane
Code
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 20
(XY/ZX/YZ)
$mom_sys_cutcom_plane_code($mom_c
utcom_plane)
$mom_sys_cutcom_plane_c
ode(XY)
Cutcom Plane
Code
(XY/ZX/YZ)
G_adju
st
$mom_sys_adjust_code 43
Tool Len
Adjust Plus
$mom_sys_adjust_code_minus 44
Tool Len
Adjust Minus
$mom_sys_adjust_cancel_code 49
Cancel Tool
Len Adjust
G_feed
$mom_sys_feed_rate_mode_code(IPM) 94
IPM Feed Rate
Mode
$mom_sys_feed_rate_mode_code(IPR) 95
IPR Feed Rate
Mode
$mom_sys_feed_rate_mode_code(FRN) 93
FRN Feed
Rate Mode
$mom_sys_feed_rate_mode_code(DPM) 94
DPM Feed
Rate Mode
$mom_sys_feed_rate_mode_code($feed_
mode)
$mom_sys_feed_rate_mode
_code(IPM)
Feed Rate
Mode
(IPM/IPR/FRN
)
G_spin
$mom_sys_spindle_mode_code(SFM) 96
Spindle output
(CSS)
$mom_sys_spindle_mode_code(RPM) 97
Spindle output
(RPM)
$mom_sys_spindle_mode_code($mom_s
pindle_status)
$mom_sys_spindle_mode_c
ode(RPM)
Spindle output
Mode
(RPM/SFM)
G_retur
n
$mom_sys_cycle_ret_code(AUTO) 99
Cycle Retract
(Auto)
$mom_sys_cycle_ret_code(MANUAL) 98
Cycle Retract
(MANUAL)
$mom_sys_cycle_ret_code($mom_cycle_
retract_mode)
$mom_sys_cycle_ret_code(
MANUAL)
Cycle Retract
(AUTO/MAN
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 21
UAL)
G_moti
on
$mom_sys_linear_code 1 Linear Move
$mom_sys_rapid_code 0 Rapid Move
$mom_sys_circle_code(CLW) 2
Circular
Interpolation
CLW
$mom_sys_circle_code(CCLW) 3
Circular
Interpolation
CCLW
$mom_sys_circle_code($mom_arc_direct
ion)
$mom_sys_circle_code(CL
W)
Circular
Interpolation
(CLW/CCLW)
$mom_sys_cycle_breakchip_code 73 Break Chip
$mom_sys_cycle_off 80 Cycle Off
$mom_sys_cycle_drill_code 81 Drill
$mom_sys_cycle_drill_dwell_code 82 Drill Dwell
$mom_sys_cycle_drill_deep_code 83 Drill Deep
$mom_sys_cycle_tap_code 84 Tap
$mom_sys_cycle_bore_code 85 Bore
$mom_sys_cycle_bore_drag_code 86 Bore Drag
$mom_sys_cycle_bore_dwell_code 89 Bore Dwell
$mom_sys_cycle_bore_no_drag_code 76 No Drag
$mom_sys_cycle_bore_back_code 87 Bore Back
$mom_sys_cycle_bore_manual_code 88 Bore Manual
$mom_sys_cycle_start_code 79
Cycle Start
Code
$mom_sys_cycle_reps_code x
Cycle Code
Representative
G_mod
e
$mom_sys_output_code(ABSOLUTE) 90 Absolute Mode
$mom_sys_output_code(INCREMENTA
L) 91
Incremental
Mode
$mom_sys_output_code($mom_output_
mode)
$mom_sys_output_code(AB
SOLUTE)
Absolute/Incre
mental Mode
G
$mom_prefun
Pre Function
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 22
$mom_sys_delay_code(SECONDS) 4
Delay in
Seconds
$mom_sys_delay_code(REVOLUTIONS
) 4
Delay in
Revloutions
$mom_sys_delay_code($mom_delay_mo
de)
$mom_sys_delay_code(SEC
ONDS)
Delay
(Seconds/Revo
lutions)
$mom_sys_spindle_max_rpm_code 54
Spindle Max
RPM
$mom_sys_reset_code 92
Absolute
Position Reset
$mom_sys_unit_code(IN) 70
Output Unit
(Inch)
$mom_sys_unit_code(MM) 71
Output Unit
(Metric)
$mom_sys_unit_code($mom_output_unit
) $mom_sys_unit_code(IN)
Output Unit
(Inch/Metric)
$mom_sys_return_code 28 Return Home
X
$mom_pos(0)
Coordinate
$mom_cycle_feed_to_pos(0)
Cycle Feed X
$mom_cycle_rapid_to_pos(0)
Rapid X
Position in
Cycle
$mom_cycle_retract_to_pos(0)
Retract X
Position in
Cycle
$mom_cycle_clearance_to_pos(0)
Clearance X
Position in
Cycle
$mom_tool_x_offset
Tool X Offset
$mom_sys_home_pos(0) 0
Return Home
X
Y
$mom_pos(1)
Coordinate
$mom_cycle_feed_to_pos(1)
Cycle Feed Y
$mom_cycle_rapid_to_pos(1)
Rapid Y
Position in
Cycle
$mom_cycle_retract_to_pos(1)
Retract Y
Position in
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 23
Cycle
$mom_cycle_clearance_to_pos(1)
Clearance Y
Position in
Cycle
$mom_tool_y_offset
Tool Y Offset
$mom_sys_home_pos(1) 0
Return Home
Y
Z
$mom_pos(2)
Coordinate
$mom_cycle_feed_to_pos(2)
Cycle Feed Z
$mom_cycle_rapid_to(2)
Rapid Z
Position in
Cycle
$mom_cycle_retract_to_pos(2)
Retract
Position in
Cycle
$mom_cycle_clearance_to_pos(2)
Clearance Z
Position in
Cycle
$mom_tool_z_offset
Tool Z Offset
$mom_sys_home_pos(2) 0
Return Home
Z
fourth_
axis
$mom_pos(3)
4th Axis
$mom_pos(4)
5th Axis
$mom_out_angle_pos(0)
4th Axis Angle
$mom_out_angle_pos(1)
5th Axis Angle
fifth_ax
is
$mom_pos(3)
4th Axis
$mom_pos(4)
5th Axis
$mom_out_angle_pos(0)
4th Axis Angle
$mom_out_angle_pos(1)
5th Axis Angle
I
$mom_pos_arc_center(0)-
$mom_prev_pos(0)
Start of Arc to
Center X-Axis
J
$mom_pos_arc_center(1)-
Start of Arc to
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 24
$mom_prev_pos(1) Center Y-Axis
K
$mom_pos_arc_center(2)-
$mom_prev_pos(2)
Start of Arc to
Center Z-Axis
R
$mom_cycle_rapid_to_pos($mom_cycle_
spindle_axis)
Rapid Position
in Cycle
$mom_arc_radius
Arc Radius
F
$feed
Feed Rate
$mom_cycle_feed_rate
Cycle Feed
Rate
S
$mom_spindle_speed
Spindle Speed
$mom_spindle_maximum_rpm
Spindle Max
RPM
T
$mom_tool_number
Tool Select
$mom_next_tool_number
Tool Pre-
Select
D
$mom_cutcom_adjust_register 1
Tool Radius
Compensation
H
$mom_tool_adjust_register 1
Tool Adjust
Register
$mom_sys_zero 0
Cancel Tool
Adjust
dwell
$mom_delay_value
Programmed
Dwell
cycle_d
well
$mom_cycle_delay
Delay For
Cycle Dwell
P_cutco
m
$mom_p_cutcom_code
Cutcom
K_cycl
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 25
e
$mom_cycle_retract_to_pos($mom_cycle
_spindle_axis)
Retract
Position in
Cycle
cycle_st
ep1
$mom_cycle_step2
Step Incr
Modifier
cycle_st
ep
$mom_cycle_step1
Step Incr
Value
Q_cutc
om
$mom_q_cutcom_code
Cutcom
E
$mom_thread_increment
Thread
Increment
M_spin
dle
$mom_sys_spindle_direction_code(CLW
) 3
CLW Spindle
Direction
$mom_sys_spindle_direction_code(CCL
W) 4
CCLW Spindle
Direction
$mom_sys_spindle_direction_code($mo
m_spindle_direction)
$mom_sys_spindle_directio
n_code(CLW)
Spindle
Direction
(CLW/CCLW)
$mom_sys_spindle_direction_code(OFF) 5 Spindle Off
$mom_sys_spindle_range_code($mom_s
pindle_range) Spindle Range
M_cool
ant
$mom_sys_coolant_code(MIST) 7 Coolant Mist
$mom_sys_coolant_code(ON) 8 Coolant On
$mom_sys_coolant_code(FLOOD) 8 Coolant Flood
$mom_sys_coolant_code(TAP) 8 Coolant Tap
$mom_sys_coolant_code($mom_coolant
_status)
$mom_sys_coolant_code(F
LOOD)
Coolant Code
(FLOOD/MIS
T/ON..)
$mom_sys_coolant_code(OFF) 9 Coolant Off
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 26
M
$mom_sys_optional_stop_code 1 Optional Stop
$mom_auxfun
Aux Function
$mom_sys_program_stop_code 0 Stop Program
$mom_sys_end_of_program_code 2
End Of
program
$mom_sys_rewind_code 30
Rewind
Program
$mom_sys_tool_change_code 6 Tool Change
N
$mom_seqnum
Sequence
Number
Improve postprocessing performance of Fanuc style posts
This example shows how to improve postprocessing performance of
Fanuc style posts for four-
axis and five-axis machines.
1. Open a 4-axis or 5-axis post. 2. On the Program & Tool
Path tab, click the Custom Command tab. 3. Click Import. 4. Select
the POSTBUILD/pblib/custom_command/pb_cmd_activate_turbo_mode.tcl
file
and click Open.
5. In the Import Custom commands from dialog box, click OK to
import the command. 6. Click the Program tab. 7. In the Program
Sequence Tree, select Program Start Sequence. 8. From the block
list, select PB_CMD_activate_Fanuc_turbo_mode. 9. Click Add Block
and drag the command to the Start of Program marker.
When you activate turbo mode, the turbo variables ^POS4 and
^POS5 represent the fourth and
fifth axis positions.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 27
The machining cycle type maps the Sinumerik option VARI to the
MOM variable
mom_turn_cycle97_machining_type.
Programming Notes
ROP and APP are always zero in the template.
The MOM procedure MOM_load_lathe_thread_cycle_params supports
cycle97 events in your
postprocessor when the Machine Cycle option is specified.
This procedure:
Returns 1 if the Machine Cycle option is specified and all
variables are set successfully.
Returns 0 otherwise.
Call the procedure MOM_skip_handler_to_event to skip event
handling until an event or motion
type that you specify is encountered during processing.
The following variables are available if you create similar
user-defined threading cycles:
mom_lathe_thread_clearance_start
mom_lathe_thread_clearance_end
mom_lathe_thread_root_line_start
mom_lathe_thread_root_line_end
Why should I use it?
The post created by Post Builder using the Siemens 840D option
has increased support for
Siemens controllers.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 28
On the shop floor, the machine operator can adjust a single line
of code, for example to change
the correct finishing allowance for the contour. To make the
same change with conventional
output, you must recalculate many lines of code using NX
Post.
Where do I find it?
Application Manufacturing
Prerequisite Create or edit a turning operation of a type listed
in the preceding
article.
Location in dialog
box Machine ControlMotion OutputMachine Cycle
Application Post Builder
Prerequisite Create or edit a SIEMENS SinumeriK_840D_lathe
post.
Location in dialog
box
Program & Tool PathCustom
CommandPB_CMD_map_cycle97_param
Adding CAM attributes for shop documentation in the post
What is it?
You can now use a Tcl command to set an attribute on a CAM
program or operation. You can
read these attributes in a shop documentation template file.
In Post Builder, the Tcl syntax for the command is
MOM_set_attribute .
The attribute information array has predefined indices, VALUE,
TYPE, and CATEGORY. You
must set the value (VALUE) to the value of the attribute, and
the type (TYPE) to the NX
attribute type, typically "String". Optionally, you can set an
attribute category (CATEGORY).
The shop documentation template format has not changed. To read
an attribute, the format is
${mom_attr_[]}, where
is PROGRAMVIEW or OPER
is the same as the attribute name that you assign in Tcl
[] is an optional attribute category
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 29
In the shop documentation template file, use program attributes
in the title section or in the table
section. Use operation attributes only in the table section.
A post created the attribute category POSTPROCESSOR_ADDED, two
attributes, and values
for the two attributes.
Why should I use it?
You no longer have to create attributes for shop documentation
manually. Your post processor
can add any values that it can obtain from MOM variables or
calculate in Tcl.
Where do I find it?
Tcl code
Application Post Builder
Shop Documentation Templates
Application Excel
Post Builder Custom Commands
In this NX A to Z article, we are going to talk about writing
custom commands in Post Builder.
Custom commands allow you to get just about whatever you want in
your machine code file. We
all know that the graphical tools within Post Builder provide a
great way to configure the
standard components of a postprocessor, but what about the
non-standard stuff that is what custom commands are for. For an
introduction to Post Builder, click here.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 30
TCL
Postprocessors written for NX are written in a language called
TCL (Tool Command Language).
TCL is a scripting language, meaning that it is not compiled,
and its syntax resembles C. TCL is a fairly straightforward
language; however, its syntax can be troublesome. The link below is
a very good resource for learning TCL; however, the best method for
writing TCL is to copy it
from an existing custom command that implements the same
function you are trying to
implement and then change the variables and expressions as
required. For example, if you are
trying to write and ifelse loop, just find one in an existing
custom command and change it as required to suit your desired
functionality. This will help to eliminate a lot of the headaches
due
to syntax errors.
http://tmml.sourceforge.net/doc/tcl/index.html
Manufacturing Output Manager (MOM)
Before you write custom commands, you first need to understand
how NX communicates with
your postprocessor. When you postprocess a program from with NX,
NX starts a program called
NX Post. The primary component of NX Post is the Manufacturing
Output Manager (MOM).
MOM is described in the NX Help Documentation as follows:
The Manufacturing Output Manager (MOM) is the central core of
the NX Post postprocessor
module. MOM converts tool paths from model files into
manufacturing output (machine code) by
adding the required functions and data as described below:
The Event Generator reads through the tool path data, extracts
events and their
associated variable information, then passes the events to MOM
for processing.
MOM applies kinematics to the output then passes the event with
its associated data to
the Event Handler.
The Event Handler creates the event, processes it to determine
the actions required, then
returns the data to MOM.
MOM reads the Definition File to determine how to format the
output for the machine
tool control.
MOM writes the formatted output to the specified Output File as
machine code.
So, essentially, MOM reads the tool path in NX and then feeds
the tool path through the
postprocessor to generate the machine code.
In order to write custom commands, you have to intercept the
information that MOM is sending
to the postprocessor and then manipulate it however you want and
then send it to the machine
code file.
All of the information that MOM sends is in the form of MOM
variables; furthermore, there are
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 31
built-in commands available for you to use in your custom
command and these are called MOM
commands. You can see all of these variables and built-in
commands and their descriptions by
clicking on the Utilities menu in Post Builder and select Browse
MOM Variables. You will see
the window shown below.
The built-in commands start with an uppercase MOM and the
variables with lowercase mom.
There are way too many built-in commands and variables to go
through them. The approach that
we will use is to set out to do something specific with our
postprocessor and then used the MOM
Variables browser to find the variables and built-in commands we
need.
So the next step is to open our postprocessor and select the
Custom Commands tab as shown
below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 32
This is a postprocessor that comes with NX for a 5-axis table
table mill. Most of the custom
commands that you see in the list are created by default when
you create a new postprocessor.
Some are used by default in certain parts of the program and the
rest are available should you
need them.
For example, the custom command shown below,
PB_CMD_tool_change_force_addresses is put
into the tool change event by default when a new post is
created. It uses the MOM_force built-in
command to force the output of the tool length compensation
data.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 33
Custom commands like PB_CMD_clamp_fourth_axis are driven by
machine control events
in NX and do not appear in any tool path events. Custom commands
like
PB_CMD_nurbs_initialize are not used by default and must be
placed in an event marker after
the post has been created if they are to be used.
There is also a library of custom commands available to be
imported into a postprocessor. If you
click Import you will see the list shown below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 34
There a lot of custom commands available and they are described
in the Documentation under
Manufacturing->Post Builder->Program and Tool
Path->Custom Command->Custom
Command Library.
So enough about all the custom commands that are already done,
lets write one of our own. It is
just a simple custom command to put name of the program at the
start of the machine code file.
In Post Builder, click Create on the Custom Command tab and Post
Builder will create a copy of
whatever custom command you have selected as shown below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 35
So delete all the code and rename the custom command
PB_CMD_program_name. Now we
need a variable that comes from NX with the name of the program
and a built in command that
will output the name to the machine code file. If you open the
MOM Variables Brower and
search program name, you will see that mom_group_name is the
variable that we want and if you
set the search category to MOM Command and search for output,
you will see that
MOM_output_literal is the build in command that we want.
So in our Custom command, we type
global mom_group_name
MOM_output_literal Program Name: $mom_group_name
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 36
The first line is a variable declaration. We are declaring the
variable mom_group_name and the
global statement indicates the scope of the variable. The global
scope is the entire MOM process,
meaning that if there is already a variable with the name
mom_group_name that exists anywhere
in the MOM process, we will be accessing that variable. It also
means that if we change the
variable, it will be changed for the entire MOM process until it
is changed again by MOM. So
essentially we are grabbing the mom_group_name variable from MOM
and writing it out the
machine code file. The $ in the second line is a syntax
character it indicates that the word that
follows is a variable name and substitutes the variables value
into the output.
This is shown below
Then we place this custom command in the Program Start Sequence
as shown below
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 37
Then post a program and this is what you get
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 38
Thats it. Remember, your best bet is to find an existing custom
command that does something
similar to what you want and start changing it to get what you
want. Well talk about debugging
custom commands in a future article.
Introduction to Post Builder
Continuing with the CAM theme, I am going to introduce Post
Builder in this NX A to Z article.
A postprocessor is probably the first customization that
everyone does when they get NX CAM,
simply because without a good postprocessor, your CAM programs
are useless. Fortunately, NX
comes with a graphical postprocessor editing tool called Post
Builder. Furthermore, there are
hundreds of postprocessors available between those that come
with NX and those that are
available for download from GTAC.
The Post Builder Interface
If you go to the folder in the Start->All Programs->UGS NX
7.5->Manufacturing Tools and
click on Post Builder, you will see a command prompt pop up and
go through some licensing
stuff and then if you have a valid license, you will see the
window below come up after
PostBuilder has loaded.
From here you can create a new postprocessor or open an existing
one for editing. A
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 39
postprocessor is a combination of three files, the tcl file that
contains the logic for the post, the
def file that contains the format definitions and the pui file
that contains the information used by
Post Builder to display the postprocessor through the graphical
interface. The pui file is the one
you select when opening a postprocessor. Shown below are the
files for some of the
postprocessors that come with NX.
As you can see, there are some generic posts as well as some
machine/controller specific posts.
Since we are not going to be getting into any specific type of
postprocessor, I will choose to
create a new 3 axis mill postprocessor and use that to introduce
Post Builder. So, click New and
you will see the dialog below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 40
Give your post a name and a description and click OK and Post
Builder will start as shown
below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 41
The Post Builder interface is set up using tabs. As you can see,
the main tabs are Machine Tool,
Program & Tool Path, NC Data Definitions, Output Settings,
and Virtual NC Controller. I will
go through each of them briefly.
The Machine Tool tab is used for specifying the parameters and
configuration of your machine.
Axis limits, feed rates, home position and for 4 and 5 axis
mills, you specify the rotary axis
labels and configuration on this tab.
The Program & Tool Path tab is where the meat of the
postprocessor is. This is where you
specify the NC blocks that make up each section of your program.
As you can see, there is a
subset of tabs for the Program & Tool Path tab. The first is
the Program tab and is shown below.
The Program tab is where you arrange the blocks for each section
of your program. In the figure
below, you would select a block from the drop-down that says New
Block and then you would
drag it where you want in the list of blocks that make up the
Start of Program section. Each item
in the tree view on the left presents more sections of the
program where you can add blocks.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 42
The G Codes and M Codes tabs allow you to specify which codes
control which functions on
your machine. The G Codes tab is shown below and the M Codes tab
is the same.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 43
The Word Summary tab shows the definitions and the formatting
for each word in the
postprocessor. It provides a means for quickly reviewing all of
the words in the postprocessor. It
isnt a good idea to make changes to the formatting on this tab
because the format of each word is determined by its format
definition, which you define on the N/C Data Definitions tab. If
you
start changing to format for a word on the Word Summary tab, you
will see other words change
as well because they have the same format definition, but the
only way to know what format
definition is assigned to each word is through the N/C Data
Definitions tab.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 44
You use the Word Sequencing tab to specify the order in which
words are arranged in the blocks.
Most machines require the words to be in a specific order and
you control this through the Word
Sequencing tab. The Word Sequencing tab is shown below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 45
The Custom Command tab is used for writing code to do things
that are not typically part of a
post processor. Post Builder is built on a scripting language
called TCL and you can write TCL
scripts to do just about anything with Post Builder. There are
quite a few custom commands that
come with Post Builder that you can import into a postpocessor
for things like a tool list or
enabling helical outputs, etc.
The linked posts tab is used for selecting other posts that you
need to link to the post you are
working on. This is primarily when you have a mill turn machine
so that you can link a mill post
with a lathe post this is how you create the postprocessor for a
mill turn machine. Because the machine has different sets of
kinematics, it requires multiple postprocessors.
The Macro tab is used for creating and storing expressions that
can be used throughout the
postprocessor.
The N/C Data Definitions tab is where you define the blocks and
words and their formats. The
Block tab is shown below. You create blocks by putting dragging
words from the Add Word drop
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 46
down. You can assign a name to the block in the tree view on the
left and then you can add the
block to different sections of your program from the Program
& Tool Path tab.
The Word tab is where you assign the format, the limiting values
and the modality to the words.
The Word tab is shown below
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 47
The Format tab is where you define the formats for the words.
Things like the number of digits
and whether or not to include leading or trailing zeros for
numeric formats. The Format tab is
shown below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 48
The Other Data Elements tab is used to define things like the
sequence numbering, the operator
message start and end characters and you can also specify a
custom user defined events file you
have one. The Other Data Elements tab is shown below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 49
The Output Settings tab has two sub-tabs. The Listing File tab
allows you to specify whether or
not you want a listing file generated with the NC program and
set some options for the listing
file. The Other Options tab allows you to specify the file
extension for the postprocessor and a
few other things. One thing of note is the Review Tool.
Activating the Review Tool is a very
good way to debug your postprocessor when you are not getting
the output you need. The Post
Files Preview tab allows you to see your postprocessor files
before and after the changes you
have made. The Other Options tab is shown below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 50
The Virtial N/C Controller thab is used for creating files that
are used for running a
postprocessor driven machine tool simulation. You first select
to Create the Virtual N/C
Controller and the you specify the paramters and options needed
to simulate how your machine
functions. The Virtual N/C Controller Configuration tab is shown
below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 51
That is Post Builder in a nutshell. Stay tuned for more articles
on how to actually write
postprocessors.
Dave Holland
Creating a 5-Axis Mill Postprocessor
In this NX A to Z article, we are essentially going to talk
about what the differences are between
a typical 3 axis mill postprocessor and a 5 axis mill
postprocessor. We are going to use the
generic 5-axis table-table postprocessor that comes with NX.
Machine Configuration
So, fire up Post Builder and open m5actt.ui. This is one of the
postprocessors that comes with
NX and if you installed NX in the default directory, it will be
in C:\Program Files\UGS\NX
7.5\MACH\resource\postprocessor. The m5actt stands for mill,
5-axis, A and C are the rotational
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 52
axes and it is a table-table machine.
The General Parameters page doesnt have anything specific to a
5-axis machine, so we will start with the Fourth Axis page. By the
way, you decide the type of machine (table-table, head-table,
etc.) when you create the postprocessor.
On the Fourth Axis page, other than the standard rotary axis
settings, the important setting is the
Machine Zero To 4th Axis Center. Typically, this is set to 0, 0,
0 and the G54 (or whatever offset
youre using) on the machine is located where the rotational axes
intersect (keep in mind the Home Position on the General Parameters
page will not be zero in this case). So if you have an
A, C table-table machine, then G54 correlates to the point where
the A and C axes of rotation
intersect. The axes of rotation will not intersect perfectly,
and most machines specify the distance
between the axes of rotation and you put this number in the 4th
Axis Center to 5th Axis Center
setting on the Fifth Axis page as shown below. You will only
have one value, so if your 4th axis
rotates about X and your 5th axis rotates about Z, then you
would put the 4th axis to 5th axis
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 53
distance in Y.
The last thing that you have to do configuration wise is specify
the axis leaders and the planes of
rotation. You do this by clicking Configure on the Fourth Axis
or Fifth Axis page (both buttons
bring up the same dialog) and setting the configuration options
as shown below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 54
One thing to note, if one of your axes does not rotate in one of
the principal planes, you would
select Other in the Plane of Rotation menu and then punch in the
IJK components for the plane
normal.
Program Settings
For the most part, all you have to change in the program is add
the 4th and 5th axis leaders to the
blocks where you want them to move. So if you have a block in
the Program Start Sequence that
homes everything, makes sure the A and C axes are in the block.
Obviously, you also need the
rotary axes in the Linear Move and Rapid Move blocks as shown
below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 55
In the Machine Control section of the Program, you need to set
up the Feedrates. So click on
Feedrates and youll see the dialog below. Typically, youll use
IPM for the Linear Only moves and FRN for everything else. You use
FRN (inverse time federate) because if you use IPM or
DPM and the move contains both linear and rotary movement, then
the speed will be tied to
either the rotary or linear axes and you will not get the
desired surface speed not only that, but the surface speed could
potentially change during the ratio of linear movement to
rotary
movement changes. Using FRN ensures a constant surface
speed.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 56
One last thing unique to a 4 or 5 axis post is the clamp/unclamp
commands. These are not
included in the list of standard M codes and therefore are
Custom Commands. So if you look at
the Custom Commands, youll see Clamp Unclamp for each rotary
axis. Often times, the Unclamp command is required by the machine
in order to move a rotary axis while cutting. You
just need to check the Custom Commands to make sure the M codes
are right.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 57
That's it. Have fun.
Creating a Mill-Turn Postprocessor Part 1
This is the first in a series of articles on creating a Mill
Turn postprocessor. In this article, I will
go through creating the postprocessors and configuring the Mill
Turn NX CAM template file. In
future articles, I will address customizing the
postprocessor.
Mill-Turn CAM Template
The first thing that we need to do is set up the NX CAM
Configuration file and the NX CAM
template part. Refer to Creating a Custom NX Cam Configuration
File and Creating a Custom
CAM Template for instructions on how to do this. The only
additional thing you need to do in
you NX CAM Template part is assign the different postprocessors
to the different methods in
your NX CAM file. So for our example, we are going to have 3
postprocessors, one lathe and
two mills. Therefore, at the very least, we need three methods
in or NX CAM file; however, you
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 58
would probably have more because you have would rough,
semi-finish and finish methods for
both milling and turning as well as methods for Polar
coordinates and XYZC coordinates
potentially.
As always, the easiest way to customize NX CAM is to copy the
default file into the appropriate
directory in your custom CAM directory and then change it. So,
copy MillTurn_Exp.prt from the
default template_part directory and put in your custom
template_part directory, rename it to
whatever you want and add it to your custom CAM configuration
file. Then open it and select
the Method view for the Operation Navigator it should look like
what you see below.
As you can see, there are both Mill methods (which include the
drill methods) and lathe methods.
These methods include settings such as tolerances, stock and
feedrates just like any other
methods; however, they also include Start Events that alert the
postprocessor as to which
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 59
postprocessor each operation needs to use. So you create all
your CAM operations and assign
them to the appropriate method groups and then before each
operation, NX alerts the
postprocessor as to what type of operation is coming next and
which postprocessor is needed.
Right click on one of the methods and go to Object and then
Click Start Events and you should
see a screen like the one below. I chose a Lathe method, so the
head name passed with the event
is TURN. This tells the postprocessor that it needs to be using
the postprocessor associated with
TURN. For the milling methods, the head names that we need are
xhead and zhead (these
correspond with the default postprocessor that we will be
looking at). This particular CAM
template is intended for a machine that only has milling
capabilities in the Z axis; therefore, we
are going to need to add/edit the milling methods.
So, copy all of the milling methods and then rename them so that
half of them have ZHEAD on
the end and the other half have XHEAD on the end. Then you need
to edit the start event for
each of them and put in the appropriate head name. You can also
delete the Live Tooling Mode
event because we are looking at a machine with only one turret.
The Start Events for one of the
ZHEAD method is shown.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 60
Thats it for the CAM template. Now you can create a CAM file
with your template and start putting in turning and milling ops and
all you have to do is make sure they are in the right
method and the right MCS (depending on how you set up the
coordinate systems on the
machine).
Mill-Turn Postprocessor
Now lets look at the postprocessor. Again, we will start with a
postprocessor that is supplied with NX and take a look at how it
works with the CAM template. If you take a look in default
postprocessor directory, you will see a few mill turn
postprocessors. Some are generic (they just
say millturn) and some are machine specific (like the Mori
NL1500Y). We are going to look at
millturn_4axis_mill, so open up Postprocessor Builder and select
Open and then browse to the
default postprocessor directory and select the
millturn_4axis_mill postprocessor and you should
see the screen below.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 61
So, essentially, this is a 4 axis mill postprocessor. The only
difference is on this screen, you have
the option of specifying whether this is a Simple Mill-Turn or
an XZC Mill, you specify whether
or not the machine can position the tool in the Y-axis and
whether or not your machine can take
Cartesian coordinates. For this particular postprocessor, we
have an Initial Spindle Axis of Z and
the Default Coordinate mode is Polar and the Machine Mode is XZC
Mill. If your machine is
essentially a lathe with live tooling, then you could select
Simple Mill-Turn and choose
lathe_tool_tip for the lathe postprocessor and then the
postprocessor uses the operation type to
switch between your mill postprocessor and your lathe
postprocessor, so you dont need the Start
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 62
Events in the Methods in the NX CAM template part; however,
because we are also going to
configure a postprocessor for milling with tools perpendicular
to the spindle, we need to check
XZC Mill and link 3 postprocessors together.
In milling mode, an XYZC Mill-Turn machine is just a XYZ Mill
with a 4th axis mounted on the
table, so if you click Rotary Axis in the tree view, you see the
same options that you would for a
4 axis mill. The options set below are typical.
Because we did not select the Simple Mill-Turn option, we need
to go to the Linked
Postprocessors tab on the Program & Tool Path tab and
specify the lathe postprocessor that we
want to use as well as the postprocessor that will be used for
milling perpendicular to the lathe
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 63
spindle axis. This is shown below. Whenever you have linked
postprocessors, one postprocessor
is the master postprocessor. The master postprocessor is the
postprocessor that is used for the
Start of Program sequence and is also the only postprocessor
that has linked postprocessors
specified. So the millturn_4axis_mll postprocessor is the master
postprocessor and the
lathe_tool_tip and millturn_side_spindle postprocessors are the
linked postprocessors
The lathe_tool_tip postprocessor is just a basic lathe
postprocessor. Remember, the Start of
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 64
Program and End of Program event sequences are taken from the
master postprocessor, which in
this case is the millturn_4axis_mill postprocessor. The few
settings on the Machine Tool General Parameters tab and the linked
postprocessors are all that set this postprocessor apart
from any other 4 axis mill postprocessor.
Lets take a quick look at the millturn_side_spindle
postprocessor. As you can see, the settings are the same as those
for the millturn_4axis_mill postprocessor, except the Initial
Spindle Axis is
now +X and the Position in Y-Axis setting is no longer greyed
out. If your machine can position
in Y, then check this box.
Other than that, this postprocessor is just a 4 axis mill
postprocessor. It does not have any linked
postprocessors, because only the master postprocessor has linked
postprocessors.
So, NX essentially comes with enough postprocessors and CAM
templates to cover the majority
of mill-turn machines out there, you may just have to do a
little tweaking to get what you want.
-
NX 10.0 POST BUIDER
Bin son:KS.Phan Vn T Page 65
The millturn_3axis_mill postprocessor covers a simple lathe with
live tooling where the tooling
axis is Z only. The millturn_4axis_mill postprocessor covers a
mill-turn machine like we have
been talking about here. The millturn_baxis_5axis postprocessor
covers a mill-turn machine with
a milling head that rotates in the XZ plane. This postprocessor
is simply a 5 axis milling
postprocessor that is linked to a lathe postprocessor. Then, if
you have multiple spindles and
multiple turrets, you just link additional postprocessors to the
master for all the different sets of
kinematics.
Next time, we will take a closer look at the postprocessors that
we talked about here and
customize them a little.