cancel
Showing results for 
Search instead for 
Did you mean: 

MOM_force in Post Processor

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Hi all,

I am doing a Post for EDM CNC machine, 

This is my Custom command:

 

global mom_prev_pos mom_pos

if { $mom_pos(2) < $mom_prev_pos(2) } {
MOM_output_literal "E0810F150"
} else {
MOM_output_literal "E1010F150"
}

 

The question is: how can I output the code like this (I mean E0810F150 and E1010F150 no force print)

 

G01X20.737Y1.915
E0810F150.
X20.750Y1.916Z2.519
X20.825Y1.916Z1.958
X20.850Y1.916Z1.805
X20.950Y1.917Z1.750
E1010F150.
X21.125Y1.918
G03X22.325Y1.925I-32.365J5333.836
G01X22.362Y1.925
X23.362Y1.932Z2.250
X23.525Y1.933
G03X28.125Y1.965I-34.765J5333.821

 

Thanks & Regards

Khang

4 REPLIES

Re: MOM_force in Post Processor

Esteemed Contributor
Esteemed Contributor

One possible way....

Define a word "E"

- leader = E

- 4 digit integer (leading & trailing zeros if you need both)

- trailer = F150.    (note if the "150" changes, the trailer can use a variable as well, but you have to format it)

- Modal

 

Create a block "E_khang" (or whatever description makes sense)

Put the above word in it, value = "$khang_e_value"

 

Then change your code below to something like

global mom_prev_pos mom_pos
global khang_e_value

if { $mom_pos(2) < $mom_prev_pos(2) } {
set khang_e_value 810
} else {
set khang_e_value 1010
}
MOM_do_template E_khang

The modality will  take care of only outputting the line when it changes.

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: MOM_force in Post Processor

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Thanks Ken_A,

I did with your guide, but error appears. Please see attached video my process

 

Re: MOM_force in Post Processor

Esteemed Contributor
Esteemed Contributor

Several issues:

1) if you get the "Error in do_event" message (like at end of video)
The *real* error message is in the syslog (Help -> NX log file; go to END, then scroll up for line like "tcl error..."

 

2) Format - you check leading zeros, you probably also want to check "trailing zeros"

 

3) In your PB_CMD - you probably want to check if prev pos exists before trying to use it (sorry, I should have added this to my example code):

global ... 
if {![info exists mom_prev_pos(2)]} { 
    # Either set to appropriate value (0 or 100 or ...) 
    # or "return" here 
}

# rest of code

 

 

4) In the linear move event, you need to add the call to your PB_CMD_*, *not* the E1 block itself (as the PB_CMD_* proc is what actually defines the variable, and if it isn't called anywhere, then the variable is never defined, hence your "error in do_event")

Hope this helps...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: MOM_force in Post Processor

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Ken_A,

 

You are great,

 

successful

 

Thanks.

Learn online





Solution Information