question

Patricia_brenny R avatar image
4 Likes"
Patricia_brenny R asked Patricia_brenny R commented

How to wait for a custom Task Sequence to finish on the DLL?

I have created a custom task sequence where an operator will interact with a processor-like machine, the Op will grab a flowitem being processed, inspect it in another location and return it.

However, trouble occurs when the machine won't wait for the task sequence to be completed, causing the operator to arrive with one more flowitem to an already processing machine, resulting in excpetion.

Is there any way to solve this directly in my C++ code? Some kind of wait until complete or make busy function to call?

The behavior I want is for the machine to explicitly stop processing until the operator arrives with the flowitem. All manipulation of said flowitem continues from this point.

FlexSim 22.2.2
module sdkdlldll c++module development
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

·
Kavika F avatar image
1 Like"
Kavika F answered Patricia_brenny R commented

Hey @Patricia_brenny R, one solution you could try would be to close the input port of the Processor while the Operator is inspecting the flowitem at a different location. Once the Operator returns the item and the item exits the Processor, you can open the input port again.

Side Note: It can be dangerous to add/remove flowitems to/from a processor without going through a port. When flowitems travel through port connections, there are some "handshakes" the sending and receiving objects do to ensure that specific things are preserved (like maxContent, OnExitTriggers referring to that item, etc.). If you find yourself removing an item from a processor before it was done processing, then you may get a treenode exception or other unexpected behavior. This principle is especially true for conveyors and Entry/Exit Transfers.

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

Patricia_brenny R avatar image Patricia_brenny R commented ·
Thank you!! since the behavior I wanted as mostly an impersonation of an inspection and not actually change anything on the flowitem, I created a "dummy" version of the object for the operator to carry and deleted it by the end, thus following your recomendation.

I also used the default task types to ask for a pause to the holder object and its release by the end of the Implemented behavior. Worked perfectly!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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