question

Kadircan T avatar image
0 Likes"
Kadircan T asked Felix Möhlmann commented

How to Release Items from Queue to Sink at Specific Times?

Hello,

In my simulation, I send products from a Queue to a Sink as the final step. However, I need to control the release timing based on specific hours.

For example:

  • Items should wait in the Queue until 3:00 AM and then be released.
  • Any items arriving after 3:00 AM should wait in the Queue again and be released at 2:00 PM instead.
  • This cycle should continue throughout the simulation.

How can I implement this logic in FlexSim?

Thank you.

FlexSim 24.0.2
queuetimedelay
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

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

releaseitem is a command to iniate a transfer of items from an object. Obviously the item must wait in such an object. You can let wait an item by sending it to a non-existing output port number or a to a port value of -1. In realseitem command you specify an available outpu port number.

You need this timed, then you create an event in an on message trigger by sending a delayed message to this object.

· 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.

Kadircan T avatar image Kadircan T commented ·

Thank you for your response. I followed your instructions and set "Send to Port" to "-1". I also added the On Message trigger, but when the simulation reaches the release times, the items are not being released.

Could you check my model and let me know where I might have made a mistake?

release_item.fsm


0 Likes 0 ·
release-item.fsm (27.2 KiB)
Felix Möhlmann avatar image Felix Möhlmann Kadircan T commented ·

There are no message being send to the queue, so the trigger never fires. And the code in it wouldn't work, since it's currently telling the queue to release itself (the command needs a reference to the item it should release).

This is more straightforward in a small (instanced) Process Flow. A token is created for each entering item. These tokens are pushed to a list. At the specified times a different source creates a token that pulls everything from the list. The other items thus continue and release their respective item.

release-item_1.fsm

Even simpler, the token from the DateTime source could just open the output of the queue at the specified times for a short moment and then close it again. The Send to Port option is set back to "1" and an OnReset trigger on the queue closes the output, so it starts closed.

release-item_2.fsm

0 Likes 0 ·
release-item-1.fsm (35.0 KiB)
Kadircan T avatar image Kadircan T Felix Möhlmann commented ·

I couldn't download the second model. Could you send it again? Also, in the first example, the products are not being directed to the sink, but I couldn't fully understand the exact cause of the issue. Could you provide an example that sends the products to the sink at the times I mentioned?

0 Likes 0 ·
Show more comments