10-08-2019 12:21 PM
Hi!!
I'm developing a app using actor framework, I need comunicate a root actor with many nested actors for example 50 at the same time with diferents data for each nested actor, the case is that I when have few nested actors the program execute ok and send the data but when execute many nested actors (50), system execute ok but it don´t neither sent data and update. I have created a for loop to guarantee the send but the app don´t send data for when execute many nested actor, Can I would improve the performance for the enqueue.vi in some way?
I have include an image from de app.
Thank you-
10-09-2019 12:26 AM
It's not clear for me what your problem is. Can you attach the code?
10-09-2019 06:50 AM
thank you LucianM:
In the code I have modified some names for mayor explanation, I use Labview 2017. thank you again.
10-09-2019 07:58 AM - edited 10-09-2019 07:58 AM
Firstly, thank you for attaching the project and all the files.
Secondly, I suspect the problem lies in the large number of required switches to the UI thread to update the indicators via refnum.
Probably some of this problem is related to the process by which you simplified the example (thank you for doing this, but perhaps it makes the problem appear worse than it is in your real application).
If you rework the example (particularly the clones) to avoid some of this updating, by having e.g. a helper loop in their Actor Core VIs which responds to a user event, you might be able to get more running more quickly.
I think Allen Smith and Sam Taggart did some work making this easier to set up here: Events for UI Actor Indicators. Obviously you don't have to use this package, but looking through it might show another way to update front panel indicators without using so many UI switches via property nodes and refnums.
10-09-2019 09:28 AM
Hi cbutcher,
I´m thankful for your answer, however I have a new query, theUI events are execute with the "event structure", If so have question it, in a new version in my aplication, I will need to execute all this actions automatically and I understand event estructure only support user events. isn´t it?.
10-09-2019 09:56 AM
@EDB22 wrote:
I will need to execute all this actions automatically and I understand event structure only support user events. isn´t it?.
The feature you are looking for is actually called User Events. That is a way for a loop to send messages to the loop(s) with an Event Structure. For reference, the DQMH is very heavy in the User Events. Also look in the Example Finder (Help->Find Examples) for "User Event".
10-09-2019 11:02 AM
Here's a basic example in which something triggers a User Event and then an Event Structure receives the event and processes it.
In place of the lower Event Structure that is firing the event, consider how this would work in you instead placed it in your VI called by Do.vi (the Actor's public VI called by the message).
To do this, you typically create the User Event in the Pre-Launch Actor override.
The only requirement for firing the event is the "Generate User Event" node, and the Event Reference.
10-09-2019 01:46 PM
Hi cbutcher.
I´m really confused, I have read about user events but the truth, I don´t know how using in my aplication, for example in
Explain how some use value (signaling) and user events but I don´t understand how fit this events with actor framework. For other hand in image example, I see that is necesary generate the event with the press button but I need that all actions run automatically without nobody make nothing. Some actions are:
Best regards.
10-09-2019 02:05 PM
I cleaned the code a little and changed the method of the nested actor to use user event instead of property node value and I saw a big improvement in performance (as expected). Still, by having 50 nested actors launched and messages sent from root with a 2ms rate, my 4 core CPU usage is around 38%.If I lower the rate to 10ms, CPU usage drops to around 10%. Maybe you can do the same your app as well.
I worked with LabVIEW 2018 SP1 and then converted back to 17.
10-09-2019 02:18 PM - edited 10-09-2019 02:19 PM
Like this...