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
|
|||
|
|||
Implementig Conwip Control
Hi,
I got a simple production line like this: Source => JobQueue => Queue1 => Processor1 => Queue2 => Processor2 => Queue3 => Processor3 => Queue4 => Processor4 => Queue5 => Processor5 => Sink And I want to use CONWIP to control the WIP of this production line. I set two global variables:
The acutal production line starts with Queue1 and ends with Processor5. Therefor I set these objects to a group. Now I don't know exactly how to control the flow from JobQueue to Queue1. First approach
Second approach:
Thanks for your help! Congshi |
#2
|
|||
|
|||
If you're not using transport to move the items from the JobQueue then the exit of the JobQueue can just be:
WIP++; if (WIP>=WIPlimit) closeoutput(current); And on the entry to the sink: WIP--; openoutput(JobQueue); Last edited by Jason Lightfoot; 11-04-2010 at 07:44 AM. Reason: Clarification |
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Congshi Wang (11-04-2010) |
#3
|
|||
|
|||
If you know that the items leave JobQueue on port one, then this is a solution with transport.
On the SendTo of the JobQueue: if (WIP<WIPlimit){ WIP++; return 0; } return -1 ; And then on the sink entry: WIP--; for (int n=1;n<=content(JobQueue);n++){ if (getnodenum(first(itemtype(rank(JobQueue,n))))==FRSTATE_INQUEUE){}releaseitem(rank(JobQueue,n),1);break; |
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Phil BoBo (11-08-2010) |
#5
|
|||
|
|||
Sorry,
but I got still two questions left: What is itemtype and FRSTATE_INQUEUE? And, in which case it is better to use - the send to funtion: only send (return 0) if WIP is lower than WIPlimit, otherwise return -1 (== closeoutput) - the onexit trigger function: closeoutput if WIP reachs or exceed WIPlimit to control the flow out of the JobQueue? Thanks! Thanks! |
#6
|
|||
|
|||
The itemtype node of the item has underneath it another node (rank 1) which is used to flag whether it's scheduled to move out already - I'm just using that to see which ones are new items to be released, rather than ones that are are already released and just waiting to be moved.
If you plan to use transport to move items from the jobqueue, the first (simple) method will not work. |
#7
|
||||
|
||||
There are commands to access all the information under the itemtype node. For this case, you should be using getitemstate()
if(getitemstate(rank(JobQueue,n))==FRSTATE_INQUEUE) |
The Following 2 Users Say Thank You to Phil BoBo For This Useful Post: | ||
Jason Lightfoot (11-04-2010) |
#8
|
|||
|
|||
In a previous post it is said that:
You should NEVER, repeat NEVER open or close input/output ports in the OnEntry or OnExit triggers! http://www.flexsim.com/community/for...+code#post1877 You suggested to use the closeoutput(current) command. Could it be problematic? |
#10
|
||||
|
||||
Quote:
From the command documentation on openoutput(): "It is advised that modelers never use this command in any field other than the OnMessage field which has been triggered with the senddelayedmessage() command, because commands which open ports often spawn several other activities that shouldn't be performed during transitional events." |
The Following 3 Users Say Thank You to Phil BoBo For This Useful Post: | ||
Lars-Olof Leven (11-09-2010) |
Thread | Thread Starter | Forum | Replies | Last Post |
GUI combobox control | Sung Kim | Q&A | 1 | 04-01-2009 06:27 PM |
Job Allocation using GUI Control | Anthony Timmiss | Q&A | 1 | 01-26-2009 11:29 AM |