Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

custom command set M8, if no M7 set

Status
Not open for further replies.

moog2

Mechanical
Jan 16, 2007
441
I'd like to add a custom command to the post which looks at the start event's in each path, and if there is no thru coolant on (M7) set, will output an M8 instead.
Can someone show me how to do this, thanks....
 
Replies continue below

Recommended for you

Perhaps this is a silly question, but why not just turn coolant on (M08)in the start event?

And when you want thru (M07), just turn it on instead?

Jay
 
it means that i'll have to set a start event of M8 in all toolpaths every time, or set M7 in the odd occasion that i need it, or i'd have to add an M8 to all my template operations, i'd rather get the post to always add an M8 unless an M7 is called for, or i could have a mill control operation in the templates, either way, it's not as good as the custom command in the post..
 
i'm not sure what you mean?
i want a custom command which will output M8, if a start event of M7 (thru coolant) hasn't been specified , is this possible?
 
Yes it is possible.

e.g.

global mom_coolant_status

if [info exists mom_coolant_status] {
switch -- $mom_coolant_status {
"NONE" {
set mom_coolant_status "FLOOD"
MOM_force once M_coolant
}
default {
MOM_force once M_coolant
}
}
} else {
set mom_coolant_status "FLOOD"
MOM_force once M_coolant
}

You could put the above code in a first move or an initial move depending upon where you intend to output the M code.

 
Thank's for your help, we got it to work like this in the end.....

global mom_coolant_status

if { $mom_coolant_status != "THRU" } {
set mom_coolant_status ON
}


#MOM_output_literal "---------$mom_coolant_status"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor