Changing G-codes in Post Builder

UX@CAE

New Member
Author
Tech Tip by Jim Wright, Siemens PLM Software

This is video 4 of 16 in a series about how to create and edit postprocessors with NX Post Builder.

The NX Post Builder application is extremely flexible and powerful, and can provide useful benefits. This online Tech Tip series is intended as an overview of the post builder and postprocessing workflows in NX CAM.

Much of the content discussed in these videos is fairly advanced and while potentially valuable to everyone, it may be more useful to those of you with post processor experience. To get the most from this series, we suggest that you watch the videos in sequence. You can find the other videos in the Postprocessor section of this Tech Tip Knowledge Base.

Videos in this series:

  1. What is a postprocessor?
  2. Create and test a 3-axis postprocessor
  3. Modifying tool change and work offset output
  4. Changing G-codes in Post Builder
  5. Tool Command Language (TCL) - Part 1
  6. Tool Command Language (TCL) - Part 2
  7. Tool Command Language (TCL) - Part 3
  8. Tool Command Language (TCL) - Part 4: More on IF statement
  9. Tool Command Language (TCL) - Part 5: Source and Switch
  10. Using the Custom Command Library
  11. Create a lathe postprocessor
  12. Create a mill-turn postprocessor
  13. Create a 4-axis postprocessor
  14. Create a 5-axis postprocessor
  15. Tilted work plane
  16. User Defined Events

[h=2]Do you have a question? Please contact with us[/h]MAT (VIETNAM) CO., LTD
Address: 11th Floor, Hancorp Plaza Building, Tran Dang Ninh Str., Dich Vong, Cau Giay, Hanoi, Vietnam
Website : http://www.mat.co.th/en/
Tel: +84-4-32115790
Fax: +84-4-32115792
Email : vnmatsoftware@gmail.com
Skype : tuanviet_nstda


[video=youtube;dm29wnJBAIg]http://www.youtube.com/watch?v=dm29wnJBAIg&list=PL5-X0d6T22GF25jkwRgxs0TDMOANM0Xoa[/video]
 
Ðề: Changing G-codes in Post Builder

Post Builder của NX cho phép chỉnh sửa, viết post processor cho các hệ điều khiển và máy khác nhau tích hợp ngay trong bộ cài nên mọi người dù dùng crack vẫn có thể tự tạo post processor.

Viết Post với NX rất trực quan, dễ sử dụng nhờ Post Builder. Việc viết post 3 trục thì rất đơn giản và không có nhiều rủi ro nhưng với post 5 trục và phay tiện phức hợp thì đòi hỏi người viết phải nắm khá vững về code của hệ điều khiển máy CNC. Nếu anh em nào quan tâm tới post của NX có thể liên hệ trao đổi với mình nhé (mình có lấy bài từ Endesin để mọi người tham khảo bên dưới)

[LEFT] 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.[/LEFT] 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 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.





Give your post a name and a description and click OK and Post Builder will start as shown below.





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.





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.





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 isn’t 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.





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.





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 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





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.





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.





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.





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.





That is Post Builder in a nutshell. Stay tuned for more articles on how to actually write postprocessors.

Dave Holland
 
Top