cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert existing gcode into a UDE or have the Post insert text from an external file?

Valued Contributor
Valued Contributor

I have a situation where I need to insert external gcode into a NX Cam Tape. I can think of three ways to do this:

 

1) Edit the tape after posting (undesirable since this would have to be done every time I post)

 

2) Use some kind of a UDE command to key the Post to input the contents of an external file.

 

3) Use an NXOpen command to read an external file and input its contents into a UDE using Insert statements.

 

I am not fond of #1 becaust it leaves the possibility that I could forget to do the edit and thus not get the desired result.

 

I would much prefer to use 2 or 3 for this but I do not know how to accomplish this. Does any one know of any samples that do something like this. I am currently having to put each line of gcode into a series of insert statements manually and this works fine for small snippits but it is a lot of work and prone to mistakes when you have a lot of external gcode. 

 

 

In case you are wondering the external gcode is something that NX is unable to produce itself and it is proven to work well so inserting it directly into the tape is a safe and desirable option.

 

I am using NX9 and PostBuilder Post for this.

 

Any Ideas or Thoughts would be appreciated.

Thank You

21 REPLIES

Re: How to insert existing gcode into a UDE or have the Post insert text from an external file?

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

For me very easy way#3 - NXOPEN application, I need just file name with path to this file. I will read this file line-by-line and output each line as string to output file (nc_prog)....

Re: How to insert existing gcode into a UDE or have the Post insert text from an external file?

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
Interesting topic.
I see 2 possible solutions:

1. Call your code as sub program, so just one more line in main program is needed
2. Use note in nx cam. You can add notes to cam operations. It should be better in your case because you can paste multiple lines to note. But you have to adjust your postprocessor a little, to handle note and to split it into multiple lines properly.

Sent from my iPhone
Marek Pawlus, NCmatic

Production: NX 11.0.2
Development: C#, Tcl/Tk, CSE

Re: How to insert existing gcode into a UDE or have the Post insert text from an external file?

Valued Contributor
Valued Contributor
I agree that this would be my ideal solution but my problem is finding a example to show me what to do. I am only minimally familiar with NXOpen and I am a 1 person programming department without access to a computer programmer type. Do you know of any example applications that could lead me in the correct direction?
Thanks

Re: How to insert existing gcode into a UDE or have the Post insert text from an external file?

Valued Contributor
Valued Contributor
I considered doing it this way but two things stopped me from doing so. First I actually use the note quite a bit to leave myself programming notes (I spent years asking NX to give me a way to comment my code and this works great). I usually don't want those notes output to my post but I am sure I could find a simple fix to key the post to output only the ones I want. The other reason is I did not see a way to access the contents of the note in the post (I usually use the Review Tool to show me what I have access to and when it is available). Do you know what the MOM variable for the note file is?

Re: How to insert existing gcode into a UDE or have the Post insert text from an external file?

Valued Contributor
Valued Contributor

If you convert your G code file to CLS format you can can import it into NX using "Tools -> CLSF  -> Import". From there you can assign a tool and MCS so you can verify, move and post like other operations. Some other CAM systems can post to an  APT format which should be close CLS format. A little bit of work but may be worth it.

 

HTH, Eric

Re: How to insert existing gcode into a UDE or have the Post insert text from an external file?

PLM World Member Phenom PLM World Member Phenom
PLM World Member Phenom

I used to have a GRIP program that would take a text file and import it into a machine control operation.  I will see if I can find the source.  Unfortunatly we do not have a GRIP development license so I cannot compile it.

 

 

John Joyce, Manufacturing Engineer,
Senior Aerospace Connecticut
www.senioraeroct.com
Production: NX11.0.2.7, Vericut 8.0.3
Development: Tcl/Tk

Re: How to insert existing gcode into a UDE or have the Post insert text from an external file?

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Randy_Sims wrote:
o you know what the MOM variable for the note file is?
  • mom_operation_notes
  • mom_geometry_notes
  • mom_tool_notes
  • mom_method_notes
  • mom_program_notes
  • mom_object_notes

 

2016-09-07_19-31-00.jpg

 

 

Marek Pawlus, NCmatic

Production: NX 11.0.2
Development: C#, Tcl/Tk, CSE

Re: How to insert existing gcode into a UDE or have the Post insert text from an external file?

Valued Contributor
Valued Contributor
Eric,
I use the CLSF Import function a lot and it works great for me. In this case the gcode is manual so no cl file exist and due to some of the things it is doing (lots of weird rpm changes) NX would have trouble outputting it in the correct format.

Re: How to insert existing gcode into a UDE or have the Post insert text from an external file?

Valued Contributor
Valued Contributor
John,
This is along the lines of what I am doing, but I also do not have a grip development license which my be problematic. I might be able to get a friend to compile it though.

Learn online





Solution Information