question

Remi A2 avatar image
0 Likes"
Remi A2 asked Remi A2 commented

How to manage the number of objects in my processor?

Hello,

I have a problem. In the attached model, there are 2 processors which process objects in a certain order. The Process Flow allows, according to the different labels, either inject 2 objects at the same time and exit 2 or inject 3 and exit only 1.

To give you an example of my problem, we will take the label 4 of my model. In the pullorder label 4 will go 2 times to processor 1. But I want the first time that there are 2 that go in and 2 that go out and for the second time only 1 that goes in and one that goes out. (The previous stock having only 3 times the label 4).I would like to have a solution that I can apply in so many other cases because this is just one example that I have presented to you.

I don’t know if it’s clear don’t hesitate to tell me

Thanks in advance, Rémi

test-2 (8).fsm

FlexSim 21.2.2
processorobject
test-2-8.fsm (42.9 KiB)
5 |100000

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

1 Answer

·
Pierre G avatar image
1 Like"
Pierre G answered Remi A2 commented

Hi,

You will find attached (Example.fsm) an example of what you are asking for.

I added a column in the Process Table which describe the number of cycles you need for a type of product:

1639664963611.png

In the ProcessFlow, I added 2 labels on the token. The label Cycle is the number of cycles which will be needed for the next product(s), and the label currentCyle will count the number of cycles already did:

1639664976140.png

Then, I just add a Decide activity to choose if I want a new cycle or if I send the items in Queue2 :

1639664986624.png

I destroyed the A connexion between the Processors and the Queue2, because it’s now controlled with ProcessFlow.

Pierre.


1639664963611.png (75.3 KiB)
1639664976140.png (88.5 KiB)
1639664986624.png (85.5 KiB)
example.fsm (49.3 KiB)
· 3
5 |100000

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

Remi A2 avatar image Remi A2 commented ·

Thank you for your answer but unfortunately and it's my fault I have trouble expressing myself during my question (however your answer will be useful to me for something else so thank you very much).

I will try to rephrase but in fact I wish that during the first pass there are 2 objects at once in the processor and in the 2nd pass only one object. How can I handle this? Hope the diagrams will help you understand.

exp3.png

exp4.png


0 Likes 0 ·
exp3.png (33.8 KiB)
exp4.png (14.6 KiB)
Felix Möhlmann avatar image Felix Möhlmann Remi A2 commented ·

Currently, the process flow always needs to pull the number of items specified in the "InNum" column. If you want this to be an upper limit, so to speak, you can change the "Require Number" in the pull activity to 1.

1639828913992.png

If this should only apply to certain types (some types always have to pull the specified number, possibily the 3->1 ones), you could create another column and split the "InNum" column into a minimum and a maximum. Then assign these to two labels and use them in the pull activity.

1639829199933.png

1639829187235.png

Lastly, to prevent any errors with the deletion of items, the token quantity that gets generated for the respective subflow should be changed to "Math.max(token.items.length - token.NextOutQuantity, 0)".

Since the number of items that exit the processor might now vary, the number of tokens for the assign labels subflow has to be variable as well. To achieve this, I would remove the empty entries from the "token.items" array after the corresponding items get deleted and use the length of the array as quantifier.

test-2-8_autosave.fsm

1 Like 1 ·
1639828913992.png (12.7 KiB)
1639829187235.png (12.6 KiB)
1639829199933.png (9.3 KiB)
Remi A2 avatar image Remi A2 Felix Möhlmann commented ·

Thank you very much, it works perfectly

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.