question

Sebastien avatar image
0 Likes"
Sebastien asked Sebastien commented

Release item of a queue on a condition (holditem / releaseitem functions)

Hello !

I would like my queue to check a label in the next machine and release items only if this label is equal to 1.

I tried with holditem and release item but the logic behind those function is not clear to me and I could not find further explanation than the one in the manual.

In the OnExit trigger I tried:


if (nextMachine.condition == 1){

holditem(item);

} else {

	releaseitem(item);

}

But it does not work. From what I read, holditem() should be called only when the item has been released. And releaseitem() only when holditem has been called before. But I do not know how to know that the item in the OnExit trigger has been held with holditem or is another item, as I do not know where the items go once the are held.

Could anyone explain to me how the two functions work in order for me to apply them in my use case ?

EDIT

Please find a sample model attached. I would like the processor to process maximum 5 items simulateously without changing the max content property.

sample-model.fsm

FlexSim 19.0.0
queuereleaseitemholditem
sample-model.fsm (32.1 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.

Ralf Gruber avatar image Ralf Gruber ♦ commented ·

Sebastian,

to be able to help you, we would need your model with a little more explanation:

- What triggers the label to be set and reset?

- Should all items be released when the label value changes from o to 1?

In general:

- If you choose the "Do not release item" strategy on the Queue's SentToPort field, all items will be held.

- In your scenario, OnExit will never be executed, once an item is held, so no further items will be released. The trigger to release further items needs to be evaluated for the following object, or the label value directly if you make the label a Tracked Variable.

Ralf

0 Likes 0 ·

1 Answer

José Antonio MD avatar image
0 Likes"
José Antonio MD answered Sebastien commented

Hello @Sebastian,

Using ProcessFlow you can do this too.

I attached a model as an example. Initially, condition is 1, at 10 seconds its value is 0 and at 30 it becomes 1. Therefore, between 10 and 30 seconds the objects will be stopped in the queue.

I hope I've been helpful.

sol-foro.fsm


sol-foro.fsm (24.7 KiB)
· 6
5 |100000

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

Sebastien avatar image Sebastien commented ·

Thank you for your answer but I cannot have a process flow managing the whole line in my model. The line can always change and I would not be able to change the process flow everytime the line changes. I could just have a process flow per object.

0 Likes 0 ·
Ralf Gruber avatar image Ralf Gruber ♦ Sebastien commented ·

Sebastian,

as I mentioned above: if you would be able to provide us with more information about the structure of your model, or preferably with the model itself, we could much more efficiently assist you.

Ralf

0 Likes 0 ·
Sebastien avatar image Sebastien Ralf Gruber ♦ commented ·

Sorry I forgot to mention I had uploaded a sample model in my post.

0 Likes 0 ·
Show more comments