Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Stopping multiple helper loops with one user event

I think you need to do some playing around with queues and user events. This isn't really an Actor Framework problem; it's just making it harder for you to actually see what's happening with all of the dynamic launches.

 

Anyway, yes you can use queues OR user events to talk to helper loops. These helper loops should be in Actor Core.vi. If you have a helper loop in your Actor Core.vi that has a Panel Closed? case, you can use that to send a Stop message to the Actor as well as stopping itself. If you have multiple helper loops, you'll need some way to communicate between them all. In this case you don't really need a Stop user event. If you have multiple helper loops, you would then add your Stop user event so that only one loop has to monitor for Panel Closed. It would then send Stop events to the other helper loops and a Stop message to the actor.

 

You could do the same with queues. The "get queue status" trick is a simple way to shut down loops without needing to send a specific message, in that you just release the queue reference.

 

Queue lifetimes are determined by their references. I'd have to double check this with code to be 100% sure, but I'm almost certain that a queue will stay alive until it's released, regardless of if anything is waiting on it. When it's released, the queue is no longer valid, and a Dequeue Element called on that reference will return an error immediately. No messages will be returned.

 

I suggest you make all of this happen with parallel loops on one single block diagram. This will let you probe and see how things work. Adding Actors to the mix is just making it much harder to see what's actually going on.




Heads up! NI is moving LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 31 of 31
(701 Views)