question

Raja M avatar image
0 Likes"
Raja M asked Logan Gold answered

How to close ports for a processor when the queue is full

Hello, I have just started using Flexsim and i'm having some troubles with it. I have a queue where the maximum content is 3 and I want the processor behind this queue to close ports when the queue is full. I have a center ports connection between them but the processor closes ports when the queue has one item not 3.

Choose One
send messagecenter ports
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

Logan Gold avatar image
5 Likes"
Logan Gold answered

I would use the Queue's OnEntry and OnExit triggers to close and open the input ports on the Processor that is upstream. Both triggers have a "Close and Open Ports" option that you can use to perform both actions - close the ports using the OnEntry trigger and open the ports using the OnExit trigger.

The "Close and Open Ports" option also has a Condition input field where you can identify a specific condition that must be true before the Processor's ports are closed. That way, you only close the ports of the Processsor when the Queue is full and not every time a flowitem enters the Queue, which sounds like what is happening in your model.

I am attaching an example model (closeinputports-example.fsm) to show you what I mean. I am using FlexSim 2017 Update 1, so the model uses dot syntax.

Both triggers on the Queue use the inObjects property of the Queue to reference the Processor. I am also using the subnodes.length property to get the Queue's current content and the getvarnum() command to get the Queue's maximum content. I use both of them in the Condition of the OnEntry trigger to make sure we close the input ports of the Processor only when the current content of the Queue is equal to its max content value.

The OnExit trigger always opens the input ports of the Processor. So every time a flowitem leaves the Queue, the Processor will open its input ports. Even if its input ports are not closed, calling openinput will not affect the model at all and that is the reason I don't include a condition in this trigger.


5 |100000

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