Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output UDE Value in Post 1

Status
Not open for further replies.

pracslipkerm

Mechanical
Dec 17, 2008
58
I have been able to use info in thread561-249010
to output expression value in the post.
Now I am trying to use a UDE (User Defined Event) to input the variables and use these in the post.
I can't seem to be able to pull the values into the post, anyone know what I am doing wrong???
I have a custom command that I call in Program Start Sequence.
Code:
global AED_Mn_X
global AED_Mn_Y
global AED_Mn_Z
global AED_Mx_X
global AED_Mx_Y
global AED_Mx_Z
global AED_Format

set AED_Format "%#4.1f"
#Set variables to expression values
[MOM_ask_ess_exp_value AED_Min_X]]}
  set AED_Mn_X [format $AED_Format [MOM_ask_ess_exp_value AED_Min_X]]
  set AED_Mn_Y [format $AED_Format [MOM_ask_ess_exp_value AED_Min_Y]]
  set AED_Mn_Z [format $AED_Format [MOM_ask_ess_exp_value AED_Min_Z]]
  set AED_Mx_X [format $AED_Format [MOM_ask_ess_exp_value AED_Max_X]]
  set AED_Mx_Y [format $AED_Format [MOM_ask_ess_exp_value AED_Max_Y]]
  set AED_Mx_Z [format $AED_Format [MOM_ask_ess_exp_value AED_Max_Z]]
##Pull values from UDE - doesn't work???
#  set AED_Mn_X [format $AED_Format [MOM_AED_Min_X]]
#  set AED_Mn_Y [format $AED_Format [MOM_AED_Min_Y]]
#  set AED_Mn_Z [format $AED_Format [MOM_AED_Min_Z]]
#  set AED_Mx_X [format $AED_Format [MOM_AED_Max_X]]
#  set AED_Mx_Y [format $AED_Format [MOM_AED_Max_Y]]
#  set AED_Mx_Z [format $AED_Format [MOM_AED_Max_Z]]
  #Output Stock Sizes
MOM_output_literal "BLK FORM 0.1 Z X${AED_Mn_X} Y${AED_Mn_Y} Z${AED_Mn_Z}"
MOM_output_literal "BLK FORM 0.2 X${AED_Mx_X} Y${AED_Mx_Y} Z${AED_Mx_Z}"
UDE Parameters are AED_Min_X etc... in EVENT Block_Form with POST_EVENT "Blk_Form"
Does anyone know how to get the UDE values to work???
Thanks in advance

Cheers
Steve Griffiths :)

If you want to make apple pie from scratch, first you must create the universe!
 
Replies continue below

Recommended for you


does the proc name match the name of the UDE?

for example if the event name is barpuller then the proc in the post would need to be named MOM_barpuller.



John Joyce
N.C. Programming Supervisor
Barnes Aerospace, Windsor CT
 
Also are you upleveling your commands and calling them in Start of Program? If not the event isn't being seen by the post.
 
Oh and also if you are trying to get these variables in Start of Program they are not available until Start of operation even if the UDE is set on the top level program folder.
 
Thanks for the advice everyone!
I'm not quite sure how to do this though...
The UDE.cdl file has an EVENT Block_Form
The post has PB_CMD_Block_Form which I want to call from the program start sequence to insert the block form at the start of the program.
How do I uplevel the command? Is this in the post or UDE?
Thanks Again

Cheers
Steve Griffiths :)

If you want to make apple pie from scratch, first you must create the universe!
 
This is from an old thread that I responded to. Take a look at the file. What is meant by upleveling is it brings the proc up to the top(or whatever desired by using a different # than 0 but in post seems to always be 0) level of the stack. You don't have to fully understand it but it makes the event handler(the custom command with the uplevel in it) seen by the post when the event when the ude is used. You must call this or put the command in the Start of program area so this can happen. either way you do it whether it is used at time of event or whether you hold the variables and then use the output command. See if you can make sense of it and if you can't I am sure someone or myself will help you out. I ain't the kingfish of this stuff and there are alot of knowledgeable people out here on the net.

 
 http://files.engineering.com/getfile.aspx?folder=f4711ed4-b9df-438f-a107-438572646f8f&file=ude_custom_command_examples.tcl
Thanks shags72
I will give it a go and see what happens. That example seems to make sense now!!!


Cheers
Steve Griffiths :)

If you want to make apple pie from scratch, first you must create the universe!
 
No problem Steve, I hope the file helps get things in line for ya.
 
Got it working!
Thanks to all for the valuable insight that put me on the correct track.
Annoying not being able to use the Start_of_Program section, but I got the job done!
Thanks again everyone

Cheers
Steve Griffiths :)

If you want to make apple pie from scratch, first you must create the universe!
 
Glad I could help. I did put an er in on having the ude's set on program header come out in Start of Program, which is where any logical person would think they would be available, but I don't think I have heard back on it yet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor