Showing results for 
Search instead for 
Do you mean 
Reply

using existence of cutcom as condition in writing post processor

Hi, I am making a new post processor and I need help on checking the existence of cutcom (cutter compensation) to use as a condition before insert some code in the post.

 

I need to do something like this:

 

If ( cutcom) existed then

              Do something

Else

              Do other thing

Endif

 

How to wrtie in the post for the above?

Any help is greatly appreciated

 Thanks

 

LIM

 

NX 10.0.3.5, WINDOWS 7
8 REPLIES

Re: using existence of cutcom as condition in writing post processor

[ Edited ]

Why not add this to the cutcom on event in the program tab of PB?

The cutcom on event will only be called when there is cutcom turned on, so no conditional branching needed.

Best would be to add some sample nc-code files, one showing how it looks now and the other one for how it should be.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: using existence of cutcom as condition in writing post processor

Hi,

If you want to check the existence of cutcom in any your procedures, you can use the global variable mom_cutcom_status, like this:

global mom_cutcom_status

if { $mom_cutcom_status == "OFF" || $mom_cutcom_status == "UNDEFINED" } {
## ...do something when no cutcom
} else {
## ...do something when cutcom
}

 

Re: using existence of cutcom as condition in writing post processor

Thank you FROBI & Stefan

 

LIM

NX 10.0.3.5, WINDOWS 7

Re: using existence of cutcom as condition in writing post processor

use " string compare" when you want string comparisons

[string compare $mom_cutcom_status "OFF"]

than

$mom_cutcom_status == "OFF"

is more efficient Smiley Wink

 

@mkn

Re: using existence of cutcom as condition in writing post processor

I think others have mostly covered this, but a couple minor points...

 

1) is the mom_cutcom_status set the same way if you turn it on in non-cutting moves -> more tab, vs. using the UDE? (it might be, but I'm not 100% sure).  Also check turning or Wire EDM cutcom (if applicable).

 

2) If you set a variable in the "cutcom on" event, don't forget to turn it off (or "unset" it) in the "cutcom off" event :-)

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: using existence of cutcom as condition in writing post processor

And in FROBI's code, I'd add a check (again, I don't know if it is ALWAYS set when post initializes)

if {[info exists mom_cutcom_status]} {
     # do whatever
}
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: using existence of cutcom as condition in writing post processor

Ken,
I didn't check the existence of mom_cutcom_status because it is initialized as "UNDEFINED" in the template procedure MOM_start_of_program.

Re: using existence of cutcom as condition in writing post processor

mom_cutcom_status appears left/right only in specific segments of motions.

 

In the start of (every) operation just set it to OFF.

 

Then check it in every motion (left/right/off?) and do whatever.

 

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

Learn online





Solution Information