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 01-25-2010
Anthony Timmiss Anthony Timmiss is offline
Flexsim User
 
Join Date: Aug 2007
Location: Sunderland - UK
Posts: 78
Downloads: 41
Uploads: 0
Thanks: 65
Thanked 45 Times in 28 Posts
Rep Power: 187
Anthony Timmiss will become famous soon enoughAnthony Timmiss will become famous soon enough
Default Simple Separator Question

How Can I control the flow of a separator so that the contents are split evenly between ports 2 & 3 and the container goes to port 1?

Thanks

Anth
  #2  
Old 01-25-2010
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

I copied the code from the pick list option Round Robin in the Send to Port into the Default Seperator Option and made a few changes (change from port 1 to port 2) and that's all.
It seems to work.

treenodeitem = parnode(1);
treenode
current = ownerobject(c);
/**Default Separator Option*/
/** \nPort for container: */
int containerport = /**/1/**/;
/** \nPort for contents: */
int contentport = /**/2/**/;
/** \n\nNote: If not unpacking, just send to first available.*/
if(getvarnum(current,"unpack"))
{
if(
getrank(parnode(1)) == 1)
return containerport;
else
{
treenode curlabel =
label(current,"f_cursendport");
if( !
objectexists(curlabel) )
{
curlabel =
addlabel( current, "f_cursendport" );
setlabelnum(current, "f_cursendport", 2);
}
if(
getoutput(current)==0 && getrank(item)==1 ) setnodenum(curlabel,2); //reset round robin counter if first part
double returnvalue = getnodenum(curlabel);
inc(curlabel, 1);
if(
getnodenum(curlabel) > nrop( current ))
setnodenum(curlabel, 2);
return returnvalue;

}
}
else
return
0;

I did not clean the code, but I guess you get the idea.

__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
The Following 3 Users Say Thank You to Tom David For This Useful Post:
Sebastian Hemmann (01-25-2010)


Thread Thread Starter Forum Replies Last Post
Seek for some help in a simple question KelvinHo Q&A 3 01-20-2010 02:52 AM
A simple question about “block” Vic Li Q&A 10 08-27-2009 11:20 AM
simple pallet question (i think) bsantens Q&A 2 03-23-2009 11:39 AM
simple question about "Separator" Vic Li Q&A 5 01-14-2009 09:45 PM
simple question for operators Kang Han Q&A 1 10-23-2008 08:35 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.