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 06-03-2011
CasimiraFederspiel's Avatar
CasimiraFederspiel CasimiraFederspiel is offline
Flexsim User
 
Join Date: Mar 2011
Posts: 11
Downloads: 6
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 111
CasimiraFederspiel is on a distinguished road
Post 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-
Attached Files
File Type: zip LPAS 2nd lvl_2.zip (45.6 KB, 152 views)
  #2  
Old 06-03-2011
shashanktrivedi shashanktrivedi is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 59
Downloads: 26
Uploads: 0
Thanks: 26
Thanked 16 Times in 3 Posts
Rep Power: 122
shashanktrivedi will become famous soon enough
Default

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  
Old 06-04-2011
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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  
Old 06-04-2011
Kris Geisberger Kris Geisberger is offline
Flexsim Canada, Forum Moderator
 
Join Date: Aug 2007
Location: Canada
Posts: 209
Downloads: 54
Uploads: 1
Thanks: 99
Thanked 389 Times in 133 Posts
Rep Power: 451
Kris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud of
Default

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
Attached Files
File Type: fsm MergeSort SendRequirement.fsm (33.2 KB, 140 views)
  #5  
Old 06-09-2011
CasimiraFederspiel's Avatar
CasimiraFederspiel CasimiraFederspiel is offline
Flexsim User
 
Join Date: Mar 2011
Posts: 11
Downloads: 6
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 111
CasimiraFederspiel is on a distinguished road
Thumbs up

Thank you all for your help


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


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.