question

Rahul T5 avatar image
0 Likes"
Rahul T5 asked Jacob W2 commented

Manufacturing Process Deadlock

Hi,
I have a product with three subcomponents. All three item types flow through a common process independently but serially (conveyor with capacity x) and are required to assemble the product. But I run into a deadlock scenario where downstream process is waiting and common process is blocked. How can I open/close ports (Queue1,2,3) based on triggers? Or is there a better approach?

DeadlockTest.fsm1666234708261.png

FlexSim 22.2.0
deadlockcommon process
1666234708261.png (247.0 KiB)
deadlocktest.fsm (50.3 KiB)
· 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.

Jacob W2 avatar image Jacob W2 ♦ commented ·

Hi @Rahul T5, was one of Rahul T5's or Jason Lightfoot's or Felix Möhlmann's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

Closing the queues' output would just create a little bit more buffer space. But eventually the backlog would reach the source and prevent it from creating any more items.

In the attached model I opted to track the number of items per type currently in the system. If the number exceeds 500, the source will not choose that type for the next item.

The number is tracked in an array label on the source. It is incremented in the customized On Creation trigger and decremented in the On Entry trigger of the sink.

1666270848130.png

deadlocktest(1).fsm


1666270848130.png (40.6 KiB)
deadlocktest1.fsm (52.7 KiB)
· 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.

Rahul T5 avatar image Rahul T5 commented ·

Thank you for your response, Felix! My model has only the excerpt of a bigger process flow I plan to model. So I have a few questions here -

  1. I plan to run an experimeter with parameters for EQueue1/2/3. I suppose if I replace the "500" from custom code with a parameter (MaxContent of each EQueue) that can be a way to go. But how do I manage to do it for every type?
    In the attached model I opted to track the number of items per type currently in the system. If the number exceeds 500, the source will not choose that type for the next item
  2. Can you help me understand the "limitCnt" variable? and why the condition is "limitCnt < 50"
  3. Since I plan to add processes between "QueueFinal" and "Sink", I should be able to change the center port from "Source" and "QueueFinal" and add the "On Entry" trigger (with code snippet). Is that correct?
    The number is tracked in an array label on the source. It is incremented in the customized On Creation trigger and decremented in the On Entry trigger of the sink.
0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Rahul T5 commented ·
1. I'm not sure what you mean with "do it for every type". The 500 is used for types. Do you want to set different limits?

2. Theoretically all types could have 500 or more items in the system at the same time. To prevent the while-loop from executing infinitely often (and locking up the model), I added a condition that the loop will run at most 50 times. "limitCnt" just counts how often the loop has run and stops it if it reaches 50.

3. Yes, you could also refer to the source directly with "Model.find("Source1")", instead of using a connection.


0 Likes 0 ·
Rahul T5 avatar image Rahul T5 Felix Möhlmann commented ·

Thank you for clarifications on 2. and 3.

On 1. - Yes, if I want to set different limits for different part types.

0 Likes 0 ·
Show more comments