Franklin M.
Aerospace
- Jan 20, 2018
- 59
Need a little help, tried CTAC and they weren't the best...
I'm trying to get a proc called output_spindle to not output if a key word is found in path name. TCL is NOT friendly.
Original and working is this:
global mom_spindle_mode
if {$mom_spindle_mode == "RPM"} {
MOM_force once M_spindle S G_spin
MOM_do_template spindle_rpm
} elseif {$mom_spindle_mode == "SFM" || $mom_spindle_mode == "SMM"} {
MOM_force once M_spindle S G G_spin
MOM_do_template spindle_max_rpm
MOM_do_template spindle_css
}
I add a few lines and it is now this, and it fails during post execution. (TCL buys it in post builder):
global mom_spindle_mode
global mom_path_name
if{![string compare "TOOL_CHECK" $mom_path_name]}{
set a 1
}
else {
if{$mom_spindle_mode == "RPM"}{
MOM_force once M_spindle S G_spin
MOM_do_template spindle_rpm
} elseif{$mom_spindle_mode == "SFM" || $mom_spindle_mode == "SMM"} {
MOM_force once M_spindle S G G_spin
MOM_do_template spindle_max_rpm
MOM_do_template spindle_css
}}
The "set a 1" is junk filler in case the keyword is found, if not found I want the else loop to run. I tried several variations of the string command, doesn't work. CTAC says it looked like a spaces/delimiter problem, made the changes they suggested and post builder rejects it while editing the proc. To say I'm missing the logic of the syntax in TCL is huge understatement. Each time I trifle with postbuilder I remember why I still use GPM!
The syslog error is
***TCL_ERROR***: Event Handler: C:\Users\XS034250\post_builder_play\my_youji.tcl, Event: MOM_linear_move, Error: invalid command name "if{!-1}{"
while executing
"if{![string compare "TOOL_CHECK" $mom_path_name]}{"
Any help would be greatly appreciated,
Regards, Franklin
Franklin
UG 10,13 & 18
NX 1,2,4,6,11 & 12
NCL502 (yep I love Sequential Mill)
I'm trying to get a proc called output_spindle to not output if a key word is found in path name. TCL is NOT friendly.
Original and working is this:
global mom_spindle_mode
if {$mom_spindle_mode == "RPM"} {
MOM_force once M_spindle S G_spin
MOM_do_template spindle_rpm
} elseif {$mom_spindle_mode == "SFM" || $mom_spindle_mode == "SMM"} {
MOM_force once M_spindle S G G_spin
MOM_do_template spindle_max_rpm
MOM_do_template spindle_css
}
I add a few lines and it is now this, and it fails during post execution. (TCL buys it in post builder):
global mom_spindle_mode
global mom_path_name
if{![string compare "TOOL_CHECK" $mom_path_name]}{
set a 1
}
else {
if{$mom_spindle_mode == "RPM"}{
MOM_force once M_spindle S G_spin
MOM_do_template spindle_rpm
} elseif{$mom_spindle_mode == "SFM" || $mom_spindle_mode == "SMM"} {
MOM_force once M_spindle S G G_spin
MOM_do_template spindle_max_rpm
MOM_do_template spindle_css
}}
The "set a 1" is junk filler in case the keyword is found, if not found I want the else loop to run. I tried several variations of the string command, doesn't work. CTAC says it looked like a spaces/delimiter problem, made the changes they suggested and post builder rejects it while editing the proc. To say I'm missing the logic of the syntax in TCL is huge understatement. Each time I trifle with postbuilder I remember why I still use GPM!
The syslog error is
***TCL_ERROR***: Event Handler: C:\Users\XS034250\post_builder_play\my_youji.tcl, Event: MOM_linear_move, Error: invalid command name "if{!-1}{"
while executing
"if{![string compare "TOOL_CHECK" $mom_path_name]}{"
Any help would be greatly appreciated,
Regards, Franklin
Franklin
UG 10,13 & 18
NX 1,2,4,6,11 & 12
NCL502 (yep I love Sequential Mill)