Showing results for 
Search instead for 
Do you mean 
Reply

Incorporate parametric programming within NX

Hello.

After probing & using parametric programming, from NX, is there a way to output variables, we use 500-599, as seen below...?

 

...
...
G43 X-13.003 Y-9.123 Z10.206 H#3020 Z10.206 G82 G94 G98 X-13.003 Y-9.123 Z[-.294+#582] R.306 F1. P3000 M107 M210 G80 G0 Z10.206 ... ... ... Z10.206 Z.306 G01 G17 G94 Z[.016+#582] F1. G4 P1000 G0 Z.306 Z10.206 Y9.102 ... ... ... G54.1 P2 () G0 G90 C[0.+#591] () G68 X0 Y0 Z0 I0 J1 K0 R88.3169 G43 X-11.5962 Y.0232 Z10.8123 H#3020 Z10.8123 ...
...
etc.

Thanks.

Kal.

NX 9.0.3.4 MP12
PB 9.0.3.2
Vericut7.3.4
14 REPLIES

Re: Incorporate parametric programming within NX

Hi Kal

How do you decide when the variable is used and when it's not used?

regards

Paul

Re: Incorporate parametric programming within NX

in adress:

leader X[

trailer +#555]

done

---------------------------------------------
#♫ PB, 5ax, itnc, nx, vericut ♫ #

Re: Incorporate parametric programming within NX

In the provided code above I see the following lines of g-code


Z10.206  --> no variable on Z
Z.306 --> no variable on Z
G01 G17 G94 Z[.016+#582] F1. -->variable on Z


This would indicate we need two adresses for Z? and what was the trigger for using which address?

 

Re: Incorporate parametric programming within NX

there is possibility put signs even in variable and decide outputing y/n in ude for each axis...

 

and:

Z10.206  --> no variable on Z    RAPID
Z.306 --> no variable on Z   RAPID
G01 G17 G94 Z[.016+#582] F1. -->variable on Z LINEAR

I think you can + handle (variable) it for non-rapids

 

---------------------------------------------
#♫ PB, 5ax, itnc, nx, vericut ♫ #

Re: Incorporate parametric programming within NX

[ Edited ]

You'll have to add a fair bit of logic to your post, to determine if the next line is "Z[...+#...]" or just plain "Z..."

 

Once that is done...

Set the "Z" word "trailer" to a variable (e.g. "$kal_z_trailer")

In "Start of program" initialize that to "" (e.g. an empty string)

 

Then in a custom command that is run before any block is output with "Z" word in it...

global kal_z_trailer
global mom_sys_leader
global kal_octothorpe_variable_number     ; what variable you want to use, defined somewhere else
global kal_use_variable     ; results of logic to use or not use variable

if {$kal_use_variable} {
    set mom_sys_leader(Z) "Z\["
    set kal_z_trailer "+#$kal_octothorpe_variable_number\]"
} else {
    set mom_sys_leader(Z) "Z"
    set kal_z_trailer ""
}

 

Hopefully you get the idea...

Forgot to add picture for trailer:

Untitled.png

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: Incorporate parametric programming within NX

Hello Ken.

Thanks for your contribution...

 

How to control the "$kal_z_trailer" value? ude?

The post(linked posts)...I setup methods for diff. mach. modes...will that hinder the logic you supplied....?

Not quite sure how to approach the "...add a fair bit of logic to your post..." subject...we add probe variables in Mill & point to point...?

 

I'll try something...will be in touch...

 

Kal.

NX 9.0.3.4 MP12
PB 9.0.3.2
Vericut7.3.4

Re: Incorporate parametric programming within NX

RE: Logic -

That's the part I can't answer for you, as I don't know when you do (or don't) want the variable output.

 

RE: Value for kal_z_trailer

Yes, I would use a UDE to define the variable value (i.e. the number after the "#" in the output)

Depending on things, you could use this to define the first value, and auto-increment (in the post) after that, or treat it as a "one and done" value (cleared after use, and you have to add another UDE to get the next number)

 

Where is the data coming from?

Do you have an overall structure to your code that you want to share?

You talk about probing... Another option would be to use probing to adjust a fixture offset (G54 or whatever) and program relative to that F.O.

I.e. overall part uses G54

One feature uses G55

In program set G55 to "nominal" value (G10 or whatever) then probe the part to get the exact location, and update G55 values.

Then machine that feature using G55

 

 

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: Incorporate parametric programming within NX

[ Edited ]

From the code you attached it looks like rapid z's are normal output and feed motions and cycles are parametric z outputs?

If so, you can create a "parametric Z" word with "Z[" as the leader and "+#582]" as the trailer, all other settings should be identical to the normal Z word. Then in the Linear, Circular, and all Cycle Events replace the normal Z word with the "parametic Z" word. No logic required!

 

If it is more complicated than that you can also do the above and add conditional outputs with the logic required in each Event. For example look at the Motion Events in the "sim14_mill_5ax_fanuc_in" postprocessor located at

C:\Program Files\Siemens\NX 9.0\MACH\resource\library\machine\installed_machines\sim14_mill_5ax\postprocessor\fanuc

Re: Incorporate parametric programming within NX

And if you are doing this for "part family" type of programming...

You could have a second UDE to set all the # variable values - Maybe in first operation (Mill control or whatever operation type)

UDE would have # variable number, and either value or NX expression name to use to get the value

Output would be "#nnn = 1.2345"

In CAM part you might have to use IPEs to get the expression from the CAD part in an "easier to use" form.

 

Note if you do this, you can have the post keep track of what is

- defined in the header

- used in the program

And report at the end (and / or in a documentation file)

- variable, value and "where used" (to do a sanity/cross check vs. "expected" values)

- variables defined but not used (not too big a deal, but maybe you missed something!)

- variables used but not defined (probably a big deal)

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