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

Post Builder - How to attach a "macro" to a UDE?

 Instead of continuing to beat my head against a wall, I'd thought I'd ask the experts here.

 

I've been modifying the OOTB Heidenhain TNC Post (Sim 08, both inch and metric) to support Heidenhain Probing. To make it "easy" (yeah right) on myself, I took the OOTB post, and under the "NC Data Definitions" tab, on the "Other Data Elements" tab, I enabled the "inherit UDE From A Post" checkbox. I then used "new" and "browse" to select my "probing_cycles_heidenhain" post. (I took the 'probing_cycles_fanuc' post in PB, and renamed it)

 

This works to give me the normal "machine motion" code in Heidenhain TNC format, but when it comes to the Probing codes, I'm getting Fanuc Probing Cycles that are output. I expected this, since I inherited the UDE's from my 'probing' post (and that started as a Fanuc Probing post.)

 

When I look in the OOTB post for the TNC, I see there are "Macros" created under the "Macro" tab, and these are for the Drilling Cycles. OK, all that works great. I can modify the Macro for each "Cycle 20x" call, and edit the output.

 

Now, if I open the "probing_cycles_heidenhain" post inside PB, and create a new "Macro" (There are no exisiting Macros in the OOTB Probing Posts), I can create the Macro with the output parameters, but when I attach it to the 'probe_single_direction_point' Event, I get no output from this Event. (through the "TNC" Post, that should inherit the UDE from this "probing" post.)

 

Just to clarify, I'm posting using a "TNC" post, that has "inherited" a UDE from this "Probing" post. I cannot get a "Macro" in the "Probing" post to output on the 'Probing' Event.

 

Just to test it out, I added a simple "text" output to the UDE/Event for 'probe_single_direction_point', and that comment came out in the posted code, as I would expect.

 

Should I be taking a different approach with this? Should I just build new "Machine Control Events" into the OOTB post, and skip trying to inherit the UDE? This would write the new UDE's to the "default" UDE File? ($UGII_CAM_USER_DEF_EVENT_DIR/ude.cdl)

 

I was able to add the Events to the "installed_machines\sim08_mill_5ax\postprocessor\heidenhainTNC\sim08_mill_5ax_tnc_in.cdl" file. And those events now show up in the Machine Control "Program" section as Machine Control Events.

 

If I go the 2nd route (including events inside the base TNC post, under installed machines), are there any "Custom Commands" that I should import and use?

 

When I look at the OOTB 'probing_fanuc' post, there is a 'PB_CMD_probe_common_output_check' for most of the Probe Cycles. For "Single Point" and "Angled Surface", there are some custom 'PB_CMD's' that are attached to the event, prior to the "G65" output line.

 

Is there a way to use the "Macros" tab, and have a routine that I run prior to outputting the Macro to "suppress" some of the parameters? If not, then I might rethink trying to use the "Macro" option, and just build the Probing Cycle output more similar to the way it is done on the Fanuc side. That way the "common output check" code can use the 'MOM_suppress' command to suppress individual parameters from the output...

 

Thanks for looking!

 

-Colin

 

 

17 REPLIES

Re: Post Builder - How to attach a "macro" to a UDE?

I don't think you can suppress individual fields in a macro (they aren't normal "words")

But if the variable isn't set ("catch { unset variable_name}") then the macro call should "do the right thing"

 

At least I  think that's how it works...

Ken

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 attach a "macro" to a UDE?

Hi Ken, I think the main issue for me is that I'm "including" a UDE from another Post. So I'm not getting any output from the event that has the Macro attached. (in the "indcluded" UDE).

 

When I look on the "Program" tab, the UDE Events are not present in my "main" post. These Machine Control Events are only present in the UDE that I'm linking to.

 

If I open the "Probing" post (the one that is linked), and add a "Macro" in that post to the UDE event, I do not get any output from my main post (from the Macro). I was able to add just some simple "text" output for testing, and that output does get output from the main post.

 

My intent here was to see if I could just create this "Probing" post using the existing "Fanuc Probing" default post, and thereby be able to attach the UDE from this post to any future post I might build.

 

Since I wasn't able to get the Macro to work this way, I could still accomplish my goal by building output consisting of "normal words", and that works. I was also able to just copy the custom UDE's from the "linked" post, and paste them into the UDE for the main post. When I did that, I was able to build new Macros in the Main post, and attach them to the UDE.

 

So I think I answered my own question Ken. Thanks for your insight, I've learned so much from all your forum posts.

 

Re: Post Builder - How to attach a "macro" to a UDE?

Once question I do have is how to implement the "suppression" of the Macro variables. You mentioned using some TCL code to "unset" the variable. Would I need to add a Custom Proc before the Macro call to do that? I guess I'm wondering where the "right place" is to add that code?

Re: Post Builder - How to attach a "macro" to a UDE?

I believe you will need a custom proc before he macro call.

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


Solution
Solution
Accepted by topic author colin-gilchrist
‎11-04-2016 02:24 PM

Re: Post Builder - How to attach a "macro" to a UDE?

When post-A inherits the UDE stuff from post-B, the "post-B.tcl" is sourced in by "post-A.tcl' in the beginning. However, this means all the commands in post-B that have already existed in post-A will get overwritten. This could be the cause of what's happening. To circumvent this would be to source in another Tcl script, containing only needed stuff, as user's Tcl file (Output Settings => Other Options) in the back end of the post-A.

Another way to tackle the suppression issue with the Macro, would be to create different macros and control the output with "Output Conditions" (right mouse click on the edge of Macro or Block).

Re: Post Builder - How to attach a "macro" to a UDE?

Thank you Postino, that is good information. I will dig through both ".tcl" files for "PostA" and "PostB" to see what I can figure out from that.

 

I've seen the output conditions used in existing posts, but I'm not sure how to set the conditions, so that Post Builder can perform the "If Check" on each output block.

 

Here are the possible output conditions for a Linear Move. I know I can select one or more of those options in the list, but where are these options "set"? That's something I'm not sure of...

 

Linear Move output conditionsLinear Move output conditions

Re: Post Builder - How to attach a "macro" to a UDE?

In your picture, use the option "new"

type in the name for the command

add the logic - just rememebr you have to return "0" or "1" as appropriate

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 attach a "macro" to a UDE?

Hi Ken,

 

Where would I add the logic? Would it be at the Program Start sequence, or the Operation Start? (I guess that might depend on if the setting is a "global" for the entire program, or if I want to check the status and set a return at each Operation?).

 

I've noticed that these Conditions all use a "double underscore" as the start of the PB Command name. Is that naming convention significant? Do I need to use a special command, or create a Custom Proc for each condition? How do I go about using the existing "conditions" that already exist in the Post? If I desire to create a new Condition Proc, do I need to use the double underscore naming convention?

 

Sorry for all the Noob questions, but I'm a Noob at NX Post Building.

 

Thanks,

 

Colin

Re: Post Builder - How to attach a "macro" to a UDE?

You'll have to figure out the logic yourself - I have no idea why you would want a particular line outut (or not)

When you create a new one, there is a minimal bit of code to start with.

 

These get applied to individual blocks, so you would want to add it to each block you want suppressed.

 

If you already have a check you want to use on another block, merely select it from the list (after the "remove" option)

 

I would not alter the custom command prefixes.

 

If I were you, I'd take the post builder training class (on-line thru learning advantage, or instructor led, as desired):

http://training.plm.automation.siemens.com/index.cfm

 

For Instructor led, it is "Post Building Techniques" (I see there is one in Nov and one in Dec)

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