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
|
|||
|
|||
Stopping "Source" production
I have a source which produces many different itemtypes with the itemtypes ultimately reaching many different queues that are itemtype specific. I need to somehow stop the source from producing certain itemtypes when the batch size of a queue has been met but at the same time continue to produce other itemtypes provided the other queues are not full. Then after the queue has been emptied by a transporter, I need the source to recognize the empty queue and resume production of the specific itemtype.
I'm thinking I need to send a message from the full queue to the source but I don't know what command(s) to use to stop the source from producing a specific itemtype. Any suggestions? |
#2
|
|||
|
|||
Hi Scott,
There is a lot of way to handle this scenario. One way to do this is to use multiple sources one for each itemtype and from the queue that is attached to source sending a message to close or open the output for the source. If the different itemtypes is coming in sequence like ABCCAB and random then you need to write your own code that keep tracks of which itemtype should be created. When you should assign the type to the item you need to check which types to use. One way to do is thsi is to generate the type first and the check if it as a valid type, if not create a new type and repeat this until a valid type is generated. Lars-Olof |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
Scott Patterson (11-10-2008) |
#3
|
||||
|
||||
Scott,
Along with what Lars suggested, if you are setting the item type with a trigger like on creation then there are a few things you could try. First, would be to do a quick check to see if the content of the queue is maxed and and if it is then choos a different value. The most logical way for this is a while loop but you would need to be careful of an infinite loop if all of the queues are maxed out. Here is a sample check: while(content(outobject(current, port)) == getvarnum(outobject(current, port), "maxcontent")) Second, to get aroundthe infinite loop problem you can simply set the itemtype on exit of the source. Then to choose the random (or other wise) port that the item goes through you can use the SendToPort trigger. So imagine that you set the SendToPort trigger to random if available. Doing that would randomly select a port but only if the down stream queue wasn't full, then on exit the item type gets set to the appropriate value (port will give you the port the item is leaving through). The beauty of this is that if all of them are full the item will simply wait for the first one to become available and you don't have to worry about an infinite loop. Good Luck, Brandon
__________________
thats not normal. |
The Following 3 Users Say Thank You to Brandon Peterson For This Useful Post: | ||
Scott Patterson (11-10-2008) |
Thread | Thread Starter | Forum | Replies | Last Post |
Is it possible one object comprised of the function of "combiner" and "separetor"? | Vic Li | Q&A | 1 | 08-19-2008 04:41 AM |
control the source input "By the time of the day" | KelvinHo | Q&A | 3 | 05-13-2008 09:46 PM |
about "no select" and "show parameter window from side bar" | qin tian | Gripes and Goodies | 3 | 03-21-2008 08:10 AM |
can "do not release item" commend be used in source? | KelvinHo | Q&A | 2 | 03-10-2008 12:30 AM |
"Getting Started" and "Tutorial" models for v4.01 | Cliff King | Product Announcements | 0 | 12-10-2007 07:34 PM |