01-05-2021 11:03 PM - edited 01-05-2021 11:09 PM
I do the same, my logic is I add all my child enqueuers in the parent's private data. In handle last ack core.vi, I initialise the child count as 5 , keep reducing it as the child stops, once the count is 0, i send stop msg to parent. This works fine when I give break points in the case where child's last ack is received, but if I remove the breakpoints, My project gets into lock mode. I don't understand why that happens. I have attached the snapshots of cases of my logic below.
01-07-2021 11:01 PM
How to store the enqueuers in a array in private data? I tried by creating a data member access VI for a Array constant in Private data, and the using Write vi of data member access, I transferred the data of enqueuers. But when I unbundled the private data in Handle Ack core, I am getting only empty array. Can someone please help me resolve this issue?!
01-07-2021 11:06 PM
Post your whole code. I can't tell what's going on from just those screenshots.
01-08-2021 05:04 AM
I am posting the project which I did just to try out this feature. "Generate" is the parent that launches "Display and Child 2". I have used Data Member Access VI to write the Enqueuers in Array format to the parent's private data.
The issue is I am getting empty array when I unbundle the private data of the parent in its Handle Last Ack core.vi. Can someone help to solve this...
01-08-2021 07:23 AM - edited 01-11-2021 07:08 AM
Hi,
You should never fork your actor somewhere else your parent actor core.vi.
The thing is you handle your "real actor" in actor core, where is executed Handle last Ack, and a kind of copied "dead actor" in your event loop where you store your references. These two objects are not the same! So the arrays are different. One is empty for ever, the other is filled. The breakpoint must not change anything to me.
To solve your problem, embed ALL your methods managing your actor into class VIs called by message from your event loop. The cool thing is that you won't have to create a data member access, just bundle/unbundle your nesteds array. The bad thing is it adds complexity and messages. But it's the only way.
01-08-2021 10:52 PM
I have changed the actor tunnels with shift register and linked input tunnels, I'm getting the array of enqueuers when i check in the actor core vi, but still not getting in handle last ack core. I have attached the screenshot of the changes I made.
01-11-2021 02:01 AM
Sorry, I think I was not clear at all...
Look at the code below:
Do you think the "Nested queues" indicator in the while loop will ever display a non-empty array? Obviously no. Because the cluster is forked at the beginning and 2 copies are then used, one in the sequence where the array is added with a new element, and one in the while loop where nothing happen to the array.
The situation is exactly the same for you. Replace the cluster by the actor object, the sequence by your event loop, and my while loop by the parent actore core.
Anyway, again the solution is to:
- Never insert your actor in the event loop!
- Instead, insert its self enqueuer
- Create a method for the actor called "Launch nested actor" or whatever, and put inside the exact code you have in your event "Launch Nested actor".
- Create a message on this method
- Send the message from your event using the self enqueuer your previously added
Thus, your nested enqueuers are handled in the same object, and your Handle last ack should work properly 😉
01-11-2021 11:48 PM
Thanks a lot everyone for your replies! It helped a lot and my issue is solved!!! Thank you so much!
01-11-2021 11:53 PM
I get my enqueuers in Handle Last ack core now, But incase of error, I handle it in parent's Handle Error.vi override, where I get the pop of my error but My parent actor gets stopped as soon as I click ok in the pop up. Is there any other way that I can give any other logic instead of my parent getting stopped. I tried to change the constant to false inside the handle error subvi, still thats not working....