Showing results for 
Search instead for 
Do you mean 
Reply

Post builder how to write a procedure for rays and circles

Hello

 

I want to generate a full circles using vectors IJK, and will not complete with CR =

 

I have this code.

G1 Z3.5 F5000.
Z.5 F450.
Y15.2
G3 X47. Y10.2 I5. J0.0
G2 X47. Y10.2 I0.0 J-10.2 (full circle)
G3 X52. Y15.2 I0.0 J5.
G1 Y15.409
Z3.5
Z50. F5000.

I want the code.
G01 Z3.5 F5000.
Z0.5 F450.
Y15.2
G03 X47. Y10.2 CR=5.
G02 X47. Y10.2 I=AC(47.) J=AC(0) (full circle)
G03 X52. Y15.2 CR=5.
G01 Y15.409
Z3.5
Z50. F5000.

 

How to write such a procedure?

 

 

I also need a procedure to display the warning at the beginning of the program if the feed rate exceeds 5000.

 

 

8 REPLIES

Re: Post builder how to write a procedure for rays and circles

This can be done in postbuilder using conditional code behind two circular block templates (if you are using above version 8.) One will issue R:

R.jpg

And the other - the one built by settings in PB:

 

NX10.03
Windows 7 Pro

Re: Post builder how to write a procedure for rays and circles

Abs.jpg

NX10.03
Windows 7 Pro

Re: Post builder how to write a procedure for rays and circles

And as it looks like you want it...

For the I, J and K words, set the "leader" to "I=AC("

Set the trailer to ")"

 

Be careful if these words are also used for other output - this will (likely) effect ALL the I/J/K words the post outputs.

 

Also in the circular move event, set the "Circular record" to output "full circle" (not "quadrant")

Also check PB_CMD_init_helix

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Post builder how to write a procedure for rays and circles

Succeeded so I did it.

 

1.jpg2.jpg3.jpg

 

 

Please more help in writing a procedure that will display a message about exceeding the feed at the beginning of the program.

 

example:


Start program:

 

(!!!!!!!!!!!!!!! FEED FOR BIG !!!!!!!!!!!!!!!!!!!!)

%
O001 (EXAMPLE)
G97 G40 G54

(OPERATION1)
T1 M6
S3000 M3
G0 X0 Y0 M8
G1 X .. Y .. F300
G1 X .. Y .. F500
.
.
.
.
.
(OPERATION2)
T2 M6
S4000 M3
G0 X0 Y0 M8
G1 X .. Y .. F600
G1 X .. Y .. F8000
G1 X ... Y .. F400
.
.
.
.

Re: Post builder how to write a procedure for rays and circles

We'll it will be somewhat convoluted to get it before the % (where you show it.)

 

For this sort of thing I tend to use code like

MOM_output_to_listing_device "$mom_operation_name: Feed too big"

 

But the issue with that is that if the user doesn't un-check the "list output" option, they have to remember to scroll *up* the "information" window to see the messages.

 

Note in the "program & toolpath" -> "program" tab -> Machine Control section

click on the "Feedrates" item (the blue box with the work "Feedrates" in it)

Note you can set max/min values for each feedrate mode.

 

Then in the "F" word you can set "truncate value".

This will limit the feedrates to the max/min you specified.

 

Anyhow, getting back to where you want it output...

It would be probably be easiest to output the warnings to a separate "errors" file (using regular tcl commands to open/write/close the file).

In "end of program" event, use "MOM_close_output_file $mom_output_file_full_name" to close the post output file.

Then use regular tcl commands to append the post output to the "errors" file, delete the original posted output file, and rename the "errors" file the original name.

 

As far as getting the errors to output, add a custom command like this (e.g. PB_CMD_mateu_check_feedrate) to any feedrate controlled move (linear, circular, drill cycle, nurbs, lathe thread, etc.):

global feed
global feed_mode
global mom_operation_name

set error 0
switch $feed_mode {
IPM   { if {[EQ_is_gt $feed 100.]}  { set error 100.  } }
IPR   { if {[EQ_is_gt $feed 1.]}    { set error 1.    } }
MMPM  { if {[EQ_is_gt $feed 1000.]} { set error 1000. } }
MMPR  { if {[EQ_is_gt $feed 10.]}   { set error 10.   } }
FRN   { # you'll have to do this logic yourself
      }
DPM   { if {[EQ_is_gt $feed 2000.]} { set error 2000. } }
default   { 
      # Error about undhanded feed_mode
          }
}
if {$error == 0 } { return }
# output error message here
set message "4mom_operation_name: ERROR - Feedrate specified ($feed) exceeds $error $feed_mode"

 

Obviously (I hope) the numbers above are just used for illustration, you'll have to modify to suit your machine (and/or material, cutting tool material, etc.)

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Post builder how to write a procedure for rays and circles

Wouldn't it be better to calculate a factor to multiply with the spindle speed and feed rate, if the feed rate exceeds the maximum possible for that machine?

 

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Post builder how to write a procedure for rays and circles

Thank you I needed:  MOM_output_to_listing_device.

 

Where can I find  "un-check the "list output" " in NX10 ? Please screenshot

 

 

variable $mom_date  has the format Mon Jul 22 11:35:00 2002
How to change on 22.07.2002 11:35 ?

 

 

 

Re: Post builder how to write a procedure for rays and circles

RE:  "un-check the "list output" "

 

you select something in the operation navigator

You click on the "postprocess" button.

 

In the "postprocess" dialog , in the "settings" block, is an check box "List Output"

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Learn online





Solution Information