Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Custom command mom_variables output...

Hello,

 

I am trying to output the mom_cycle_clearance_plane variable in a custom command that I have in my Coolant ON block ( I have good reason for doing so I swear).

 

However, I keep getting an error when I try to post process.  

 

My custom command looks like this:

 

 

global mom_cycle_clearance_plane
MOM_output_literal "$mom_cycle_clearance_plane"

 

 

 

Has anybody run into something like this before? 

 

4 REPLIES

Re: Custom command mom_variables output...

Depending on where you put the coolant ude - the cycle variables may not be available yet. A start event on an operation may not see the variables created on start of path for the operation. Try using the review tool to check the timing.

NX10.03
Windows 7 Pro

Re: Custom command mom_variables output...

Oh okay,

 

So if I understand this correctly, the custom command is run before the cycle variables are "created".  Thank you very much

Solution
Solution
Accepted by topic author JarvisIntern
‎08-26-2015 04:32 AM

Re: Custom command mom_variables output...

[ Edited ]

Actually - I am in error according to below. But - the main point is check the timing.

 

Here is an especially important note from the doc. START OF OPERATION is done and any mom variables created by data in the operation are created at that time.

 

concepts

 Order of Events

When you post process a tool path, there is a specific order for the events which cannot be changed. The data is output in the following order:

START OF PROGRAM
UDEs attached to the program
START OF GROUP (NC_PROGRAM, GENERIC_MACHINE, GEOMETRY, METHOD)
UDEs attached to the group
UDEs attached to the geometry with Start Post commands
UDEs attached to the method with Start Post commands
UDEs attached to the cutting tool with Start Post commands
UDEs attached to the machine tool with Start Post commands
START OF OPERATION
TOOL CHANGE (not LOAD command)
UDEs attached to the operation with Start Post commands
INITIAL MOVE
UDEs attached to the operation with End Post commands
END OF OPERATION
UDEs attached to the geometry with End Post commands
UDEs attached to the method with End Post commands
UDEs attached to the tool with End Post commands
UDEs attached to the machine tool with End Post commands

END OF PROGRAM

You can write a process for your UDE's in the user.tcl file.

NX10.03
Windows 7 Pro
Solution
Solution
Accepted by topic author JarvisIntern
‎08-26-2015 04:32 AM

Re: Custom command mom_variables output...

Note that the list in the previous post is when you post an OPERATION.

The order changes slightly if you post a GROUP.

 

To fix your code, try something like:

global mom_cycle_clearance_plane
if {[info exists mom_cycle_clearance_plane]} {
      MOM_output_literal "mom_cycle_clearance_plane = $mom_cycle_clearance_plane"
} else {
    MOM_output_literal "mom_cycle_clearance_plane not yet set"
}

 

 

If you want, you can use the *_Marker "UDEs" (Start_Marker, Tool_Change_Marker, etc.) before you add your Coolant/On UDE, to push it later (so variable may exist).

 

The other option is to over-ride the proc MOM_coolant_on (that handles the "coolant on" event) so it just stores values, then have another proc (e.g. PB_CMD_Jarvis_Coolant_Out) actually output them where you want.

 

For what you're trying to do, maybe wait until the clearance plane is defined ("info exists" is true) then output the code, and set a flag variable for this operation that coolant has been 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