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
|
||||
|
||||
Timing on Conveyor
Ok, I'm still trying to get my printing area of our distribution center to work correctly. I'm stuck on how to get the timing of the cartons arriving to be correct. I'm using the Source to dictate the arrival of cartons and which conveyor lane they get diverted to. But I'm not confident on how to write the code to say that, "if lanes 1 and 2 are backed up then use lanes 3 and 4. Only x% of cartons will utilize lane 5."
Thank you for your help , -Casey- |
#2
|
|||
|
|||
As far i understand query, source is directly connected to conveyor which you are calling lane, what you can do in exit trigger of the source try to play with ports like
if (port ==1) { your desired code } similar with other ports. May be if you tell your problem in detail i will be able to help you more. I am using flexsim4.5 hence not be able to open your attached model. Regards Shashank Trivedi |
#3
|
|||
|
|||
Choose the mergesort send pickoption called "By Port" and then use the template to enter something like this:
case 1: case 3: return getitemtype(item) == 1 && content(outobject(current,port))<10; case 2: case 4: return getitemtype(item) == 2 && content(outobject(current,port))<15; default: return 1; This means type 1 items would go to port 1 unless the conveyor on that output port has 10 or more items - in which case they will try port 3 when they get there. Having a blank entry against a case just means you drop through to the next case effectively sharing the line of code. Port 5 will use the default case. I've assumed you only have two types of item in this example. Last edited by Jason Lightfoot; 06-04-2011 at 08:42 AM. Reason: clarification |
#4
|
|||
|
|||
Looks like Jason and I were working on this at the same time, I'll post my model anyway.
In the first example, I have a MergeSort connected to 5 conveyor lanes with the flow items taking the first available lane. The SendRequirement code is: Code:
treenode current = ownerobject(c); treenode item = parnode(1); int port = parval(2); //in this case is the lane number the item is currently at treenode lane = outobject(current,port); if(port == nrop(current)) //this is the last lane, we must send return 1; //yes, send else if(content(lane) < 10) //this lane has less than 10 items return 1; //yes, send return 0; //don't send Note that this lets the model naturally determine how many flow items will have to take the last lane. In the second example, i use the entry trigger of the MergeSort to set the itemtype of 15% of the flow items to 0. In the SendRequirement I make an exception for these items such that they take the last lane. Code:
treenode current = ownerobject(c); treenode item = parnode(1); int port = parval(2); //in this case is the lane number the item is currently at treenode lane = outobject(current,port); if(port == nrop(current)) //this is the last lane, we must send return 1; //yes, send else if(getitemtype(item)==0) //OnEntry we set x% of itemtypes to 0 to indicate that they should take the last lane return 0; //don't send, because this is not the last lane else if(content(lane) < 10) //this lane has less than 10 items return 1; //yes, send return 0; //don't send |
Thread | Thread Starter | Forum | Replies | Last Post |
Ever lost a post due to the forum timing out? | Ben Wilson | Tips and Tricks | 0 | 01-18-2010 10:39 AM |
What is the difference between a Conveyor and Basic Conveyor | shivrash | Q&A | 2 | 07-21-2009 04:09 AM |