Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Modifing the CLS output for angle heads

Phenom
Phenom

I just tried the MOM_before_output option - all the extra "turbo" gotos (and some other stuff too) don't go there - and don't even go through the goto block template. I don't know how they could be intercepted and modified. So: I bet the only way to modify all the gotos is to flip the mom_kin_clsf_generation flag and rebuild the cl post.

NX12.02
Windows 10 Pro
ITC Inc.
Highlighted

Re: Modifing the CLS output for angle heads

Siemens Legend Siemens Legend
Siemens Legend

Just to get this out of the way...

 

Turbo mode must be turned OFF, if you ought to manipulate anything in the event handlers (Tcl). This is how turbo is achieved by bypassing most of the handlers. This also means, MOM_before_motion is not processed in turbo mode, since it's the precursor to other event handlers. 

Re: Modifing the CLS output for angle heads

Valued Contributor
Valued Contributor

Do you know how to turn off Turbo Mode? It does not appear to be the

 

set mom_kin_clsf_generation TRUE

 

Line since changing this only lets you edit the First and Initial moves. Unless of course I am missing something else.

 

Re: Modifing the CLS output for angle heads

Siemens Legend Siemens Legend
Siemens Legend
Turbo mode is on when "mom_kin_is_turbo_output" is somehow set to "TRUE" and MOM_reload_kinematics is issued.

Re: Modifing the CLS output for angle heads

Siemens Legend Siemens Legend
Siemens Legend

Almost forget what the square-1 was. Here's something you can try...

 

1. Keep the original mom_mcs_goto & mom_tool_axis intact and use different variables (globals) to carry the manipulated data.

   - Do the data manipulation at (or near) the end of GOTO_output proc.

 

2. Modify the definition file (clsf.def) by replacing mom_mcs_goto & mom_tool_axis with new variables.

Re: Modifing the CLS output for angle heads

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

@Randy_Sims wrote:

set mom_kin_clsf_generation TRUE


This variable is used to change MOM into a special mode used only for generating CLS files, aka APT format files.

 

It is similar to turbo mode, but doesn't bypass as much as turbo mode.

 

I have customized CLS file generation, but you need to use the original procedures.

 

My custom_clsf.tcl file looks like this, just the procedure names listed, not their content to keep the post small, but one should get the concept:

 

source [MOM_ask_env_var UGII_CAM_TOOL_PATH_DIR]clsf.tcl

# alter a copy of the procedures shipping with NX clsf.tcl
proc MOM_path_warning {} {
# ...
}

proc MOM_gouge_marker {} {
# ...
}

proc MOM_end_of_program {} {
# ...
}

proc MOM_start_of_group {} {
# ...
}

proc MOM_initial_move {} {
# ...
}

proc MOM_first_move {} {
# ...
}

proc MOM_end_of_path {} {
# ...
}

 

I even specify custom block templates in a custom_clsf.def file:

MACHINE UG_CLSF

INCLUDE
{
   $UGII_CAM_TOOL_PATH_DIR/clsf.def
}

FORMATTING 
{
ADDRESS part_name {
                  LEADER "$$ PART "
                  FORMAT String
                  FORCE always
                  }

ADDRESS path_name {
                  LEADER "$$ PATH "
                  FORMAT String
                  FORCE always
                  }

BLOCK_TEMPLATE part_name_output {
                                part_name[$JH_clsf_part_name]
                                }

BLOCK_TEMPLATE path_name_output {
                                path_name[$mom_group_name]
                                }

BLOCK_TEMPLATE JH_approch {"GOTO/"\nows
                     X[$mom_mcs_goto(0) + 1000 * $mom_tool_axis(0)]
                     Y[$mom_mcs_goto(1) + 1000 * $mom_tool_axis(1)]
                     Z[$mom_mcs_goto(2) + 1000 * $mom_tool_axis(2)]
                     I[$mom_tool_axis(0)]
                     J[$mom_tool_axis(1)]
                     K[$mom_tool_axis(2)]}

BLOCK_TEMPLATE JH_clearance {"GOTO/"\nows
                     X[$mom_mcs_goto(0) + 1000 * $mom_tool_axis(0)]
                     Y[$mom_mcs_goto(1) + 1000 * $mom_tool_axis(1)]
                     Z[2000]
                     I[0]
                     J[0]
                     K[1]}

}

 

In the template_clsf.dat file I have the following line added:

Standart CLSF,${UGII_CAM_TOOL_PATH_DIR}custom_clsf.tcl,${UGII_CAM_TOOL_PATH_DIR}custom_clsf.def

 

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX12.0.2, VERICUT 8.2, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX (1876) | AWC 3.4 Preparing: -

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: Modifing the CLS output for angle heads

Phenom
Phenom

@Postino wrote:

... This also means, MOM_before_motion is not processed in turbo mode, since it's the precursor to other event handlers. 

There was an old post that said "MOM_before_output" was fired for all the "turbo" stuff (not MOM_before_motion.) I determined that it (at least in version NX8.5) is not.

 

NX12.02
Windows 10 Pro
ITC Inc.

Re: Modifing the CLS output for angle heads

Siemens Legend Siemens Legend
Siemens Legend

MOM_before_output is triggered immediately after each execution of MOM_do_template or MOM_output_literal. In turbo mode, the bulk of motion events does not go through event handlers, it's very little you can do with MOM_before_output, since outputs are mostly not produced by either MOM_do_template or MOM_output_literal.  BTW, all your customization with MOM_before_output, if needed, should be done in PB_CMD_before_output (add one if it doesn't exist.); and, for debugging purpose, you should only use MOM_output_text or MOM_output_to_listing_device (or other Tcl means)  to avoid recursion.

Re: Modifing the CLS output for angle heads

Phenom
Phenom

Postino,

 

Yes - I have experienced the recursion. The only time I have overridden MOM_before_output was when I loaded output into an array instead of writing a file. In this case - more of what MOM_before_output did - I wanted to modify. I understand it isn't a good idea to override that one - or most of the lowest level routines. I do like that it is possible if necessary (though.) And thanks for the insight with MOM_output_text/to_listing_device not going into MBO - I didn't know that.

 

Thanks, Dan 

NX12.02
Windows 10 Pro
ITC Inc.

Re: Modifing the CLS output for angle heads

Valued Contributor
Valued Contributor

After talking to GTAC it looks like Stefan's solution is the path that you need to follow to do this in NX. Before I go there we are going to write a VB executable to do at the end of the cl file output to edit the numbers the way we want them. If for some reason we can't get that to work then I will do exactly what Stefan said. What GTAC said is when you remove the

 

set mom_kin_clsf_generation TRUE

 

then you have created a non-supported manual post. They do not recommend doing this and consider this to be outside their support arena. This is really only needed for someone who like me is going to a 3rd party post since the NX post itself does not have an issue with this problem.

Thanks for all the help!

Learn online





Solution Information