LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Actor Framework to launch new root actor into a sub panel

Hey Everyone!  

First post long time lurker.  I have searched and looked into the application control invoke nodes/property nodes and cannot find (subject) or direction on (subject).  I have used the subpanel to hold sub-vi's before, but I used the static VI ref.  I am unsure how to get the AF to launch a new root actor and have it populate a subpanel or array of subpanels programmatically.  

I am unsure as to what code I can provide given this is a specific example.  Here is my FP/launcher though.  The Actor core is still under development as I haven't tied all of the indicators to variables yet.

 

Thanks!

0 Kudos
Message 1 of 6
(5,344 Views)

I would suggest you to start looking here and read https://decibel.ni.com/content/docs/DOC-17193

-If you want to launch root actor you need to get the root actor class and give as input to this vi: https://zone.ni.com/reference/en-XX/help/371361M-01/lvcomm/af_launch_root_actor/

-And this to start with :http://www.labvolution.com/labview-actor-framework-basics/

Thanks
uday
0 Kudos
Message 2 of 6
(5,338 Views)

Hi, thanks for the response, but launching the root actor isnt the problem, it is getting the root actor front panel to populate into a subpanel (or array of subpanels).  Thanks for the pointers to the examples though.  They are very helpful and helped me learn the basics of AF.

0 Kudos
Message 3 of 6
(5,333 Views)

Hi mbrue101,

 

When using AF and subpanels, there are two options:

  1. Share your actor's VI reference with your UI that's hosting the front panel. (The UI can also be an Actor)
  2. Share the SubPanel's reference with the actors you are launching

I prefer prefer the first option as to me I prefer the dependencies to go from the Actor to the UI (that might change) as opposed to the other way around.

 

Root actor to UI actor:

To send the actor VI reference to the VI that is hosting the subpanel, then you could send a an message (normal or abstract) that contains your reference data. In your UI actor, you will then have the reference and you can update the subpanel in a method.

 

Root actor to UI vi (Actor to standard VI):

I would be hesitant to do this... but. the general ways of transferring data are still valid (not recommended) for example: CVTs, Globals, Notifiers etc... You just need a way to send your actors VI reference to your user interface.

Message 4 of 6
(4,228 Views)

I am using a parent actor class in order to do the embedding of the actor core VI into the subpanel of the UI. The UI sets the suppanel as a property to the launched actor an the launched actor embeds itself to the subpanel.

 

I would recommend to implement the UI itself as an actor and to launch the actor to insert as a nested actor. Like this, UI Data from the suppanel can be transmitted by an abstract message. Like this you can start several instances of the same actor to embed them to several suppanels and implement different fuctions on the calling actor.

 

I started using this technique for simple objects like buttons or even timer (abstract "time is up" message) but it is also suitable for more complex objects like a table indicator that allows multicollumn cells.

0 Kudos
Message 5 of 6
(3,893 Views)

You should use the MGI Panel Manager! Just have your actor inherit from Panel Actor and it will handle all this for you.

Message 6 of 6
(3,882 Views)