Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

TCL growing pains

Status
Not open for further replies.

Franklin M.

Aerospace
Jan 20, 2018
59
0
0
US
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)
 
Replies continue below

Recommended for you

It may be a small thing but in some cases you have a space between braces and some do not. }{ vs } {
I have seen this change the behavior of TCL.



John Joyce
Manufacturing Engineer

NX 12.02 Vericut 8.2.2

If I asked people what they wanted, they would have said faster horses

- Henry Ford
 
thank you John.

it was spaces among a couple other issues. but it now works.

Franklin
UG 10,13 & 18
NX 1,2,4,6,11 & 12
NCL502 (yep I love Sequential Mill)
 
Status
Not open for further replies.
Back
Top