×
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

Correct variable definition in PB

Correct variable definition in PB

Correct variable definition in PB

(OP)
Hi everyone!

MB it will be a silly question, but... I have 2 processes within which the one variable is used.
proc MOM_myProc1 {} {
global myVar
set myVar 1
}

proc MOM_myProc2 {} {
global myVar
MOM_abort "$myVar"
}

in the log it is writen than "no such variable 'myVar'" in process 2
what I've made wrong?

Thanks in advance

RE: Correct variable definition in PB

Gotta be mom_myVar.

RE: Correct variable definition in PB

Wait I am assuming these are ude's.

RE: Correct variable definition in PB

(OP)
Sorry, my fault.
myVar is simple PB variable. not UDE

RE: Correct variable definition in PB

Where are you using MOM_myProc1 ?

Is this activated by a UDE?


 

John Joyce
N.C. Programming Supervisor
Barnes Aerospace, Windsor CT
NX6.0.5.3

RE: Correct variable definition in PB


proc1 is not being called before proc2 or they are being called in a different namespace.

 

RE: Correct variable definition in PB

Why not just use a custom command? Or are you writing in tcl file and not using post builder. Ok Where and how is the myVar being set? If it is never set then it will not be there.

RE: Correct variable definition in PB

(OP)
joycejo, proc1 is activated with ude.
mouldy1, proc1 and proc2 are in the start of the program. I think, if the process is initialized once, it will be also available during the whole post processing, isn't it?

RE: Correct variable definition in PB

if proc1 is activated with ude.
what is activating proc2?
 

John Joyce
N.C. Programming Supervisor
Barnes Aerospace, Windsor CT
NX6.0.5.3

RE: Correct variable definition in PB

There's (one of) your problem! Ude's are not available in start of program. Though they are available in start of path. And again if a var is in a ude then it will be mom_myVar when it gets to the post. You did call it myVar in the param field, right? Then as joycejo asks, How is proc 2 getting called? There is no callout for it in proc 1. Why don't you tell us what you are trying to accomplish and then we can tell you the best way to get it done? OK?

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