Post error messages: can't read variable
Post error messages: can't read variable
(OP)
Hello,
Please refer to thread561-116535: UG CAM for a similar issue of this.
I am trying to finish up my post and I have a problem. I want to use "mom_prev_out_angle_pos(0)" however, on the first move I get the 1770002 error that says:
"Error: can't read 'mom_prev_out_angle_pos(0)': no such element in array"
I assumed that this was because at the first move, there is no previous angle for the fourth axis. So at the "start of program" block I inserted "set mom_prev_out_angle_pos(0) 0.0" to set the variable initially. This does not seem to work and I still get the message that the variable cant be read.
By the way the code I am using the variable in is:
global mom_pos mom_out_angle_pos
global mom_prev_pos mom_prev_out_angle_pos
if {$mom_prev_out_angle_pos(0) != $mom_out_angle_pos(0)} {
MOM_output_literal "E11=E10*sin($mom_out_angle_pos(0)) E12=E9*cos($mom_out_angle_pos(0))"
set mom_prev_out_angle_pos(0) $mom_out_angle_pos(0)
}
Any help would be greatly appreciated.
Please refer to thread561-116535: UG CAM for a similar issue of this.
I am trying to finish up my post and I have a problem. I want to use "mom_prev_out_angle_pos(0)" however, on the first move I get the 1770002 error that says:
"Error: can't read 'mom_prev_out_angle_pos(0)': no such element in array"
I assumed that this was because at the first move, there is no previous angle for the fourth axis. So at the "start of program" block I inserted "set mom_prev_out_angle_pos(0) 0.0" to set the variable initially. This does not seem to work and I still get the message that the variable cant be read.
By the way the code I am using the variable in is:
global mom_pos mom_out_angle_pos
global mom_prev_pos mom_prev_out_angle_pos
if {$mom_prev_out_angle_pos(0) != $mom_out_angle_pos(0)} {
MOM_output_literal "E11=E10*sin($mom_out_angle_pos(0)) E12=E9*cos($mom_out_angle_pos(0))"
set mom_prev_out_angle_pos(0) $mom_out_angle_pos(0)
}
Any help would be greatly appreciated.





RE: Post error messages: can't read variable
IF anyone is thinking on this I found a related thread:
thread561-175145: How to lock and unlock axis
I am assuming that my mom angle commands can not look far enough ahead to set the angle? Not too sure. I am kinda stuck on this one.
Rick
RE: Post error messages: can't read variable
global mom_prev_out_angle_pos
#before you use
set mom_prev_out_angle_pos(0) 0.0
#???
John Joyce
Tata Technologies
1675 Larimer St.
Denver, CO
www.myigetit.com
NX3,4,5,6 Solid Works, Pro/e, Solid Edge
RE: Post error messages: can't read variable
RE: Post error messages: can't read variable
Yes I have the variable set.
jelmerra,
I will try that structure and see if that fixes it.
Thanks to both of you for the replies,
Rick