ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 09-22-2008
Vic Li Vic Li is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 1 Time in 1 Post
Rep Power: 150
Vic Li is on a distinguished road
Default different labels have different delay time

I have a simple question about delay time, as described here: there are the same kind of itemtype but two different kind of labels .If I wanna have different delay time between two labels. how do I modify the code to meet my needs? If anyone can give me advice I thank you for your help in advance.
Attached Files
File Type: zip delay.zip (47.8 KB, 716 views)

Last edited by Vic Li; 09-22-2008 at 03:15 AM. Reason: add a file
  #2  
Old 09-22-2008
tobias.biemueller tobias.biemueller is offline
Flexsim User
 
Join Date: Aug 2007
Location: Bielefeld, Germany
Posts: 42
Downloads: 22
Uploads: 0
Thanks: 23
Thanked 18 Times in 16 Posts
Rep Power: 164
tobias.biemueller is on a distinguished road
Default

I dont know if i understand your question right, but lets try.

You have 2 items with 2 different labels and want to send a delayed message to an object with the value of one of the labels?

You can try it in a way:

Code:
double d_Delay = 0;
if(objectexists(label(item,"Label1")))
{
d_Delay = getlabelnum(item,"Label1");
}
if(objectexists(label(item,"Label2")))
{
d_Delay = getlabelnum(item,"Label2");
}
senddelayedmessage(toobject,d_Delay,fromobject,msgparam1,msgparam2,msgparam3);
But in this case, if the item has both labels, then it will always take the second one..
Maybe this helps you a little bit..

Regards Tobias
  #3  
Old 09-22-2008
Vic Li Vic Li is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 1 Time in 1 Post
Rep Power: 150
Vic Li is on a distinguished road
Default attach file~

thx for tobias.biemueller ' s answer ~ I forgot to attach my files @@ I think you understand my question right! maybe you can try to see my model and give me some advice ~ thx a lot again!
  #4  
Old 09-22-2008
tobias.biemueller tobias.biemueller is offline
Flexsim User
 
Join Date: Aug 2007
Location: Bielefeld, Germany
Posts: 42
Downloads: 22
Uploads: 0
Thanks: 23
Thanked 18 Times in 16 Posts
Rep Power: 164
tobias.biemueller is on a distinguished road
Default

I looked into your model, i dont understand what you want to do with the different labels?

Would you like to have different loadtimes?
i.e.

G = 1 -> Loadtime = 10 sek
G = 2 -> Loadtime = 3 sek

or what do you want with this solution?
  #5  
Old 09-22-2008
Vic Li Vic Li is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 1 Time in 1 Post
Rep Power: 150
Vic Li is on a distinguished road
Default

YES ~ that's what I want!! when there is a pallet into combiner , then according to the "1" and "2" of label "G" , it will have different delay time~ just like your instance. in my model now, the delay time is 13 sec no matter what kind of [email protected]@
  #6  
Old 09-22-2008
tobias.biemueller tobias.biemueller is offline
Flexsim User
 
Join Date: Aug 2007
Location: Bielefeld, Germany
Posts: 42
Downloads: 22
Uploads: 0
Thanks: 23
Thanked 18 Times in 16 Posts
Rep Power: 164
tobias.biemueller is on a distinguished road
Default

Then why you dont use the LoadTime Trigger to refer to the label..

i.e.:
return getlabelnum(item,"G");

a other solution, is your way but additional one of the msgparam from the message used with the value of the G-Label (or the delaytime) and in the MessageTrigger the msgparam value.

If you have different times for loading, according to the value of G (1 = 12 sec, 2 = 30 sec):
add 2 labels to the robot with the timevalues for loading..
First label for the first Loadtime
Second label for the second Loadtime

then refer to the labels i.e.:
// if G == 1 then the first label will returned, else the second
return getlabelnum(current, getlabelnum(item,"G"));

hope this is what you want to do..

regards Tobias
The Following User Says Thank You to tobias.biemueller For This Useful Post:
Brandon Peterson (09-22-2008)


Thread Thread Starter Forum Replies Last Post
Task Sequence Delay for Multiple Capacity Sung Kim Q&A 6 06-16-2008 03:11 PM
Updating Labels Alexandre Ouellet Q&A 2 04-02-2008 06:55 AM
Updating Labels Naresh Yamani Q&A 7 03-28-2008 11:28 PM
can I use an edit box entry to update multiple labels? KelvinHo Q&A 10 03-28-2008 07:17 AM
Display Labels with the Recorder tsconcept Q&A 9 09-26-2007 08:16 AM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.