×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Post error messages: can't read variable

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.
 

RE: Post error messages: can't read variable

(OP)
Hey,
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

In your start of program event do you have

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

I think I would opt for the 'if [info exists mom_prev_out_angle_pos(0)] { }' structure instead.

RE: Post error messages: can't read variable

(OP)
joycejo,
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources