Thunderbird336
Mechanical
- May 16, 2013
- 30
I was following along with John Joyce's PLM World 05 PowerPoint for the probing example... this is what my current procedure looks like:
... without the additional proc command as in the example, which I list next...
I tried the above code (with the additional procedure) but it does not run it that way, it appears that the nested proc is never called; it doesn't bomb out, it just doesn't seem to do anything.
So that is one question: is that second "proc" necessary? If so, why and what am I doing wrong that it never runs...
The next question is about checking status: if I un-comment the "if" statement that is checking the status of mom_probex_status the procedure will fail with an error saying that there is no such variable as $mom_probex_status
Where would that variable come from? I assumed that it was created from the UDE since we gave it a "POST_EVENT" name of probex
I do see this in the post's tcl file:
So it would seem since MOM is in caps that a command is created called MOM_probex from the UDE.
I've been reading everything that I can find on Tcl but not all of it applies since there is no MOM_ anything in Tcl it simply uses puts, etc. instead of MOM_output_literal for example. When I click on any of the Help menus I get an error that the postbuilder.chm has not been installed properly... I was getting that in NX8 and just installed NX8.5 on Friday and still get the same error message.
Thanks in advance,
Gary
Code:
proc PB_CMD_probeXpos {} {
global mom_probex_status
global mom_probex_pos
#if { $mom_probex_status != "ACTIVE" } { return}
set probex_pos [ format %3.4f $mom_probex_pos(0) ]
set probey_pos [ format %3.4f $mom_probex_pos(1) ]
set probez_pos [ format %3.4f $mom_probex_pos(2) ]
MOM_output_literal "G65 P9811 X$probex_pos Y$probey_pos Z$probez_pos"
}
... without the additional proc command as in the example, which I list next...
Code:
proc PB_CMD_probeXpos {} {
proc MOM_probex {} {
global mom_probex_status
global mom_probex_pos
#if { $mom_probex_status != "ACTIVE" } { return}
set probex_pos [ format %3.4f $mom_probex_pos(0) ]
set probey_pos [ format %3.4f $mom_probex_pos(1) ]
set probez_pos [ format %3.4f $mom_probex_pos(2) ]
MOM_output_literal "G65 P9811 X$probex_pos Y$probey_pos Z$probez_pos"
}
}
I tried the above code (with the additional procedure) but it does not run it that way, it appears that the nested proc is never called; it doesn't bomb out, it just doesn't seem to do anything.
So that is one question: is that second "proc" necessary? If so, why and what am I doing wrong that it never runs...
The next question is about checking status: if I un-comment the "if" statement that is checking the status of mom_probex_status the procedure will fail with an error saying that there is no such variable as $mom_probex_status
Where would that variable come from? I assumed that it was created from the UDE since we gave it a "POST_EVENT" name of probex
I do see this in the post's tcl file:
Code:
#=============================================================
proc MOM_probex { } {
#=============================================================
global mom_probex_pos
}
So it would seem since MOM is in caps that a command is created called MOM_probex from the UDE.
I've been reading everything that I can find on Tcl but not all of it applies since there is no MOM_ anything in Tcl it simply uses puts, etc. instead of MOM_output_literal for example. When I click on any of the Help menus I get an error that the postbuilder.chm has not been installed properly... I was getting that in NX8 and just installed NX8.5 on Friday and still get the same error message.
Thanks in advance,
Gary