Joe L6 avatar image
Joe L6 asked Joe L6 commented

Make Combiner keep combining even the target quantity didn't achive

Here's a situation that I want to simulate:

A machine can process at most 10 items in one run. Operator will combine 10 items together and put it in the machine. If there are more than 10 items waiting in the queue before the machine, operator will always combine 10 items together and put it in the machine. Until the end, there are less than 10 items waiting in the queue, then operator will combine the remaining items and put it in the machine. After the machine finishing the process, operator will separate the items.

To simulate the upon situation, I set the FlexSim model as below:


And it will remain 1 item in the Combiner1.


How can I change the Target Quantity of Combiner1 into the number of remaining items in the Queue1?

PS: The reason that I don't set Maximum Content of the Processor is that I need the operator to process. But FlexSim can't let the Operator process the Processor with more than 1 item.

FlexSim 18.1.2
combinerseparatortarget quantity
model-set.png (234.4 KiB)
end-simulation.png (1.9 MiB)
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jeanette F avatar image Jeanette F ♦ commented ·

Hi @Joe L6,

Can you post your model?

0 Likes 0 ·
Joe L6 avatar image Joe L6 Jeanette F ♦ commented ·

Combiner Question.fsm

Of course! Thaks for your reply.

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦ Joe L6 commented ·
Hello @Joe L6

I have a solution in the works but something is occurring that I did not expect. I will get back to you on Monday with a solution.

1 Like 1 ·
Show more comments
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joe L6 commented

There is a picklist option on Entry event trigger to update the component list.
It uses a global table. It updates the component list only on Entry of an item entering through port one as the container item. If you update the value of components right before a container item is entering an incomplete full pallet or container, you need only change the global table value to the value of remaining items in the queue. Once the packaging is complete you set the value back to default value.
This approach is much simpler than to update the source code in a combiner to pack items.

· 11
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joe L6 avatar image Joe L6 commented ·
Hi @Joerg Vogel ,

I've already tried the function you've mentioned before, but I think I don't know how to use the function correctly. Do you mind upload a model with the function and I can study how it works. I would appreciate it!

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Joe L6 commented ·

The option assumes that the container item entering through port 1 has a "Type" label. Depending on the value of that label it then copies one of the columns of the specified global table into the component list of the combiner.


With this example, if the container item had Type 2, the combiner would then receive 2 items through port 2, 5 through port 3 and 8 through port 4.

So in order to use the option in its default state, you would have to create a global table with a single cell and assign the "Type" label with value 1 to your items.

I believe in your case it might be quicker to just edit down the code of the trigger option to the bare necessities.


The edited code skips the global table and sets the two involved variables to 9 or the number of items in the input queue, whichever is smaller. You might also want to add the following line to the code (inside the {} brackets of the if-condition). It also writes the target component quantity to a label on the first item, so you could later use it in the separator to split it into the correct number of items again.

item.CombinerQty = Math.min(9, current.inObjects[1].subnodes.length) + 1;

This whole approach does have one problem though. When the first item enters the combiner at the start of the model, the other items were not created yet and the combiner would set the component number to 0.

To work around this, I close the output of the queue on reset and whenever the last item exits and open it 0.001s after the first item enters through a combination of the On Entry and On Message triggers.


1 Like 1 ·
Joe L6 avatar image Joe L6 Felix Möhlmann commented ·

Hi @Felix Möhlmann ,

Appreciate for your detailed explaination, it really solve my problem perfectly. Thanks again for your helping.

0 Likes 0 ·
Show more comments
Jeanette F avatar image
1 Like"
Jeanette F answered Joe L6 commented

Hello @Joe L6,

In the following model I use process flow but you could move this into a trigger on the combiner. In the process flow the token waits for the OnProcessFinish event on the combiner and then the token gathers the content of the queue and compares it to the target quantity of the combiner. If the content is less then it will change the combiner's component list and targetcomponentsum variables to take in what's left in the queue.

I also put an on reset trigger on the combiner to set its component list back to 9.


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joe L6 avatar image Joe L6 commented ·
Hi @Jeanette F ,

Thank you for your helping. I'm learning the ProcessFlow function recently and your helping makes me gain a new understanding. Thank you very much!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.