Showing results for 
Search instead for 
Do you mean 
Reply

How to insert UDE in PB

How to define in PB where UDE will be inserted (Block) for turning operations. I added end path event in operation M0, it should be added in N110 block,but it inserted in N90?!

 

 

N70 G1 Z3.1 F.1
N75 Z-7.112
N80 X44.7
N85 X44.983 Z-6.971 F.7
N90 M0
N95 S1000 M4
N100 G0
N105 X240. Z200. M9
N110 M0

3 REPLIES

Re: How to insert UDE in PB

[ Edited ]

UDEs are placed in certain positions.

NX DOC says:

 

"When you post process a tool path, the data is output in the following order:

Start of program

User-defined events (UDEs) attached to the program

Start of parent group (program, machine tool, geometry, method)

UDEs attached to the parent group

UDEs attached to the geometry with program, machine tool, geometry, method commands

UDEs attached to the method with Start Events

UDEs attached to the cutting tool with Start Events

UDEs attached to the machine tool with Start Events

Start of operation

Tool change (not Load tool)

UDEs attached to the operation with Start Events

Initial move

UDEs attached to the operation with End Events

End of operation

UDEs attached to the geometry with End Events

UDEs attached to the method with End Events

UDEs attached to the cutting tool with End Events

UDEs attached to the machine tool with End Events

End of program"

 

 

 

If you want to place NC blocks from UDE to custom location, you should add some logic to your postprocessor. What I do is:
- collect variables from UDE in MOM_ude_name proc
- in any other Custom Command or Block Template, output blocks using collected variables

And there are also "Event Placement Markers", which can be used to place UDE to position wanted by user, but I never tried it:

"Placement markers are special events that you can insert into your operations’ start and end event lists. When you generate an operation, the events are output in a sequence. Markers represent milestones in this sequence, including:

Spindle commands.

Tool change commands.

Motions to and from avoidance geometry.

When you place your events before a marker, the event output is made before the line of NC output associated with the marker. When you place events after a marker, the event output is made after the line of NC output associated with the marker. If the CAM object that corresponds to a marker is not defined, then the placement of that marker has no significance to the output order of events.

The following markers are relevant when you define Start Events:

Spindle Marker

Tool Change Marker

From Marker

Start Marker

Approach Marker

The following markers are relevant when you define End Events:

Return Marker

Gohome Marker"

Marek Pawlus, NCmatic

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

Re: How to insert UDE in PB

Like Marek said...

1) have the UDE handler proc (MOM_udename) just save the variables.  Then in your post add a "PB_CMD_udename_output" proc, and place it where you want the output.  This PB_CMD then uses the variables form the UDE to do the output.

 

2) Variant of 1.  Set a variable at "start of program" AND "end of path":

global ken_delay_your_ude_name_output
set ken_delay_your_ude_name_output 1

in UDE handler:

 

global ken_delay_your_ude_name_output
if {[info exists ken_delay_your_ude_name_output] &&
    $ken_delay_your_ude_name_output(close brace here) {
    return
(close brace here)

note the "(close brace here)" should have an actual "close brace" character (which current forum software seems to abuse)

 

 

Then where you want the output

global ken_delay_your_ude_name_output
if {[info exists ken_delay_your_ude_name_output] &&
    $ken_delay_your_ude_name_output(close brace here) {
    # Process and clear any existing data
(close brace here)
catch { unset ken_delay_your_ude_name_output (close brace here)

With this method (I use this for coolant) the output gets delayed until after the point you want in  the beginning of an operation, but after the beginning, the user controls where the output is.

 

 

3) What the *_marker "events" do

My explanation is that they force the UDE event to "trigger" before or after the "marker" event, assuming the "marker" trigger exists.

for example, consider the following:

OPSTOP
TOOL_CHANGE_MARKER
OPERATOR_MESSAGE("HERE")
START_MARKER
COOLANT ON/FLOOD

*ASSUMING* there is a tool change and a "start" avoidance point defined in  the operation, you will get something like this output:

 

M1
(tool change code - may be multiple lines)
(HERE)
G0 X Y Z (move to start point.  Could also include "initial move" output)
M8

 

 

I would suggest you take an hour and play around with operator messages like "BEFORE TOOL CHANGE" and "AFTER TOOL CHANGE" and "BEFORE START MARKER" (etc.) and see how they get output relative to the rest of the code produced by the post.

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: How to insert UDE in PB

[ Edited ]

Thank you guys!

 

Please check the video,maybe I misunderstood something in your comments,because the code is the same.

 

 

 

 

Learn online





Solution Information