rg006
Mechanical
- Mar 25, 2008
- 65
Hello,
Please refer to thread561-116535 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 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.