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
|
|||
|
|||
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
|
||||
|
||||
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 |