question

Julian Sundermeier avatar image
0 Likes"
Julian Sundermeier asked Julian Sundermeier commented

How to duplicate / clone a flowitem with all labels due to a breakdown?

Hi everyone,

I don't know how to simulate the following issue:

A machine processes a flowitem until a breakdown occurs. The OnBreakdown-trigger should duplicate / clone the flowitem and place it in a buffer next to the machine. The cloned flowitem should have all labels and their current values. After the duplication is finished, the original flowitem should be deleted.

I hope you understand my problem and can help me?

FlexSim 7.5.4
flow itemscloneduplication
· 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.

1 Answer

Joerg Vogel avatar image
2 Likes"
Joerg Vogel answered Julian Sundermeier commented

There is a problem with the item on the processor. There are existing events in the event list, for example the Process finish event. If you delete this item the event occurs and causes an error in the engine, because the item it is pointing to doesn't exist anymore. You can try to fetch those events and delete them. If the original item can finish the processing and you send it to a sink at a special output port or by the command moveobject, the events won't interfere.

If you think you need an object, that behave like a processor but only storing an item and changing states, you can use a queue. The behavior is controlled by delayed messages. You hold the item in the queue by not sending the item (Do Not Release Item). If the item should leave you call on the item the command releaseitem(obj item, num output port number). Even if there occurs a delayed message that manipulates an item not existing in the queue you can check if it exists in the queue and ignore the action.

If you need a supporting operator you implement the utilize tasksequence on your own.

To copy an item you can try the commands createcopy(...) or insertcopy(...).

· 7
5 |100000

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