ATTENTIONThis 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 |
#1
|
|||
|
|||
time event
Hello together.
My problem is to have an item sent by a conveyor to four different ports (by an operator). Three ports are depending on percentage, the fourth port should be used every half an hour for exact control purpose on the item (only one part) . I tried it with a user event that increments some label at every 1,800 time units (seconds). Somehow doing it this doesn't work properly. Sometimes it works, sometimes not. Is there another way to do this? Maybe I made a mistake in the code I put into the SendTo field. |
#2
|
||||
|
||||
What about the idea to control the input of the downstream objects?
The input of the first three objects is open and the input of the fourth is closed. So the send to statement is just a standard functionality (e.g. First available Open all ports). A user event is fired every 1800 time units and close the input of the first three objects and open the input of the fourth object. OnEntry of the fourth object the input of the three is opened again and the input of the fourth is closed. OnReset of the fourth object the input is closed.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#3
|
|||
|
|||
Thank you, I think the idea is good.
Only one thing: I am still wondering how to manage the percentages I have as conditions for the first three objects? |
#4
|
||||
|
||||
Support_SendToTimeEvent_TD
Donatus,
Sorry, but I oversaw the first time I read your post the percentage task. I defined a task for myself and made a solution. I wanted to put the model in the Download Section under Support Models, but I reached my download limit. I contacted the administrator (Bill) and I am pretty sure that he will higher my limit. Then I will download the model. I will still try to attach the model at this thread directly (Which seems to work. So my limit is only in the download section ). But I don’t like this because I have always the feeling the models disappear in a black whole if they are directly attached here. That’s why the Support Models Section was introduced. Even if it seems that I am the only one who uses it. I hope my solution is a help for you. Good success tom the (A)tom Task: Have an item sent by a conveyor to four different ports. Three ports are depending on percentage. The fourth port should be used at a specific time (e.g. every 3 minutes) for one item (control purpose). Solution: Define Global Table (GlobalTablePercentage) for the first three ports. The table has 3 Rows and 2 Columns where the first column is the percentage and the second column is the port number. Define a Global Variable (iTimeEvent) which is used as a switch for the Time Event. It could also be a label on the conveyor (Conveyor4). At OnReset the Global Variable iTimeEvent is set to zero. At time 180 the variable is set to 1. This can be done by two UserEvents (used in the model) or at OnReset and OnMessage of e.g. the Conveyor4. At OnEntry of Conveyor for the Global Variable iTimeEvent is set to zero again, to use the empirical distribution for the next 3 minutes. In the Send To Port of the upstream conveyor (ConveyorIn) is the important code: // LOCAL VARIABLE double returnvalue; // IF NOT TIMEEVENT THEN USE EMPIRICAL DISTRIBUTION TO DEFINE PORT if(iTimeEvent == 0) { returnvalue = dempirical("GlobalTablePercentage"); } else// ELSE USE PORT NUMBER 4 { returnvalue = 4; } // RETURN PORT return returnvalue;
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#5
|
|||
|
|||
Hello Tom!
Thank you so much for your post. I tried it like you showed in your model, and it works... almost... Problem: the operator that is doing the transport from the conveyor to the other stations has a capacity of two - I guess that's why it always goes the way to "station 4" twice after the time event was triggered (but always takes one instead of two parts - another mystery). Unfortunately I need this capacity of two items and can't change it to 1. Donatus Last edited by Donatus Minio; 02-13-2009 at 01:47 AM. Reason: missing sentence |
#6
|
||||
|
||||
Donatus,
It is difficult to solve a task if you do not have all information. I guess the operator with capacity makes everything a bit more complicated. Did you get the operator with capacity = 2 working? Does the operator take always 2 items if he goes to one of the first three stations? Does he bring these two items to one station or to different ones depending on the empirical distribution? In the time event if the item comes, does he then only take one item and brings it to the fourth station? I guess if this is the scenario then a few things have to be thought of. You need to take care to "collect" 2 items. Give a task sequence to the operator to bring them to one station or generate a tasksequence to bring them to two different stations. So you might need a queue with some control mechanism to take care to collect 2 items. If they are collected generate the tasksequence. For the time event you might like to use an additional queue. So the special item goes into this queue and this queue send this item to the fourth station (standard tasksequence will work). You could also try to control only one queue to do both jobs but that’s more coding I would think. I suggest you modify my posted model and put the operator in and try to solve the task (control of queue, tasksequences). If you get stuck again, you can describe what you tried and what is working and not. Post your built model with it and then the community might be able to help you.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#7
|
|||
|
|||
Basically I got the operator working with the capacity of two items, only that (answers to your questions):
- probably depending on the itemtype it is loading two items or only one item at a time (I got four different itemtypes) - the operator takes always one part only if he goes to one of the first three stations, but if it comes on the travel network from the fourth station back near to the “conveyor_out”, it will take one more item from that conveyor and bring these two items to one of the final stations (1, 2, or 3) – strange but true - in the case of that itemtype that is coming on that conveyor_out, the operator generally takes only one part - yes, but as described it always takes only one item form that conveyor I thank you for the hints. Altogether I am quite confident with this now, even if it is not working perfect. My problem is that these are the last few weeks of my thesis and the model is the main result of my paper. That is the reason why I can’t post the model here. In the model I got quite some other things to settle, and I am under time pressure… With your help that issue is running satisfyingly for me. Great support! |
#8
|
||||
|
||||
Support_SendToTimeEventOperator_TD
Donatus,
I gave someone else some support and this gave me some new ideas for your problem. I did not make the model exactly as you described in your last post, but I included an operator who now always takes two items and brings them to one destination. If the Time Event occurs he only takes one item and brings it to Station 4. I am pretty sure that this could now be modified to your described task or any other constellation. Anyway, even if you are already satisfied, I thought I post the model. I hope in a way it proves that nearly everything is possible in Flexsim the questions is sometimes only the effort and time you have to put in. By the way, if you appreciate the help and hints in the forum, you can thank people by pressing the Thanks button in the right button corner of the posts. I wish you good success with your thesis.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
The Following User Says Thank You to Tom David For This Useful Post: | ||
Donatus Minio (02-17-2009) |
#9
|
|||
|
|||
Hello Tom.
The model you posted is running great. Anyway, I finally had some trouble with the operator's capacity of two. That's why I changed a few things and now it is running quite well (with your old hints and to any port only one item). I am facing now a complete different problem, for which I might make a new thread in the forum. |
Thread | Thread Starter | Forum | Replies | Last Post |
"time" event | Vic Li | Q&A | 4 | 06-12-2014 12:46 PM |
Invalid link, event not created | Nico Zahn | Q&A | 4 | 09-05-2008 08:33 AM |
Problem with user event | Yasemin Vatandas | Q&A | 2 | 08-06-2008 02:49 AM |
profileevents() and order of event nodes under project/exec/events | Tom David | Q&A | 3 | 05-15-2008 11:33 PM |
question about User Event | Ning Wang | Q&A | 3 | 04-22-2008 10:56 AM |