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 |
|
Downloads |
Q&A Using Flexsim and building models |
#1
|
||||
|
||||
Change the downstream Combiner's batch quantity to this object's batch
Hi, I tried the picklist option in the Queue with a combiner as next object, but the function does not work. I tried it on the entry trigger (makes more sense to me here) and on the exit trigger.
As far as I know you need to chenge two values on the combiner to update the Pack,Batch or join quantity. So the function would look like this on the entry trigger: treenode t_Combiner=outobject(current,1); int i_wagenkapa = content(current); setnodenum(node(">variables/componentlist/From Input Port 2/Target Quantity",t_Combiner),i_wagenkapa); setnodenum(node">variables/targetcomponentsum",t_Combiner),i_wagenkapa);
__________________
kind regards Nico. |
#2
|
|||
|
|||
If you ever change the target to be less than the number of items the combiner has already collected the combiner will never reach the target and therefore will not start the setup and processing stages.
If you want to add an extra item to the component list you should increment the value relevant to the correct port and also increment the targetvalue. Usually, the trigger for this is placed on entry of the combiner and checks that the port is 1 - ie. the arriving container, so that the component list only gets updated once per container. |
#3
|
||||
|
||||
Yes you are right Jason.
But if you do not know the number of parts to be collected when the container enters the combiner, you can use a batching queue upfront and change the number of parts to be collected in the queue and on the combiner dynamically. I guess that is what was intended with the picklist option in the queue (which does not work at all???). (FS 5.04)
__________________
kind regards Nico. |
The Following User Says Thank You to Nico Zahn For This Useful Post: | ||
Jason Wills (01-07-2011) |
#4
|
|||
|
|||
I think the standard trigger on the queue should have opipno(current,1)-1 and is missing the line to update targetcomponentsum.
Try using this code instead, but you'll find this also fails under some circumstances Code:
treenode combiner=outobject(current,1); treenode componentlist=getvarnode(combiner,"componentlist"); settablenum(componentlist, opipno(current ,1)-1,1,minof(content(current),getvarnum(current,"batchsize"))); int total=0; for (int n=content(componentlist);n>0;n--) total+=gettablenum(componentlist,n,1); setvarnum(combiner,"targetcomponentsum",total);; (btw I assumed that's a typo. on the last line of the first post where you're missing a bracket) Last edited by Jason Lightfoot; 06-22-2012 at 03:36 PM. |
The Following 2 Users Say Thank You to Jason Lightfoot For This Useful Post: | ||
Jason Wills (01-07-2011) |
#5
|
||||
|
||||
Dynamically changed combiner input
Thank you for this thread.
I was about to give up on updating the combiner dynamically when I found this. I had been updating the Target Quantity only and overlooked the targetcomponentsum until I saw Jason's post. Instead of triggering the updates from the input queue, I used an On Message trigger on the combiner. This meant I did not need to wait for the input queue to gather the whole batch. The msgparam(1) that I passed to the combiner was the sum of the incoming items--I calculated this sum on an upstream conveyor. Once I passed this value to both Target Quantity and targetcomponentsum in the combiner the dynamic changes worked fine. Since I didn't wait for the input queue to have all items batched, I had to keep the combiner input port closed until after the values were updated for each batch. I put this code On Message for the combiner and sent the message when the input quantity was known. treenode combpieces = node(">variables/componentlist/From Input Port 2/Target Quantity", current); treenode targetcompsum = node(">variables/targetcomponentsum", current); setnodenum(combpieces,msgparam(1)); setnodenum(targetcompsum,msgparam(1)); openinput(current); I haven't tested all possibilities, but it works so far. Jason |
The Following User Says Thank You to Jason Wills For This Useful Post: | ||
Efrain Marchena (06-19-2012) |
Thread | Thread Starter | Forum | Replies | Last Post |
Batch Behavior Q. | shafizad | Q&A | 11 | 12-13-2010 09:14 AM |
Batch connection changes | KelvinHo | Q&A | 2 | 02-05-2010 03:01 PM |
Batch Processor? | Anthony Timmiss | Q&A | 7 | 08-19-2009 10:11 AM |
Batch production (Batch size for processor) | Patrick Cap | Q&A | 12 | 03-27-2009 12:14 AM |
Batch/Max Content | Gavin Douglas | Q&A | 4 | 07-09-2008 12:28 AM |