Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Actor Framework auto generate actor?

Solved!
Go to solution

Hello,

I'm starting to use the actor framework for a large application. I am wondering if there is a way to auto generate a new Actor?

I understand I can auto generate messages for an actor using Tools -> Actor Framework Message Maker...

I make an Actor by making a new Labview class say:

Test Actor.lvclass

Then set the inheritance of this class to Actor.lvclass

Make the Actor Core.vi Method

Make a Write waveform method

Set the scope of Actor core to protected, and other methods to public (just like the Simple Actor example) and make actor core reentrant

I am making the structure EXACTLY like the Simple Actor example, but I get the following errors in my new Actor Core.vi:

"This VI doesn't match other VIs in the method, Connector Pane Terminal(s) are different. All VIs that implement a method of a LabVIEW class must match Connector Panes. To correct this, compare Connector Pane of both this VI and the VI of an ancestor class that implements this method."

and

"The owning VI is not a dynamic member VI of a LabVIEW class. The Call Parent Method node should only be used in a dynamic member VI of a LabVIEW class."

I tried to read into this message, but it appears my connector pane is the name. I'm not sure whats going on.

(1) Can someone show me what I am doing wrong here?

(2) Is there a way to auto generate the Actor?

Every time I try to construct an actor from scratch I get the above errors. I have attached my project (LV2012).

Any help is greatly appreciated!

0 Kudos
Message 1 of 8
(6,406 Views)
Solution
Accepted by topic author mkabatek

1. There's no tool that I know of to create an Actor from a template for you like the AFMM does. If you want to do something like that, the most straightforward way is to create a Template Actor and copy that class on disk using a VI Scripting method. Look at the AFMM source code to see how it's done.

2. Are you working in LV 2012? If you set the inheritance of any class before creating override methods,  the "New >> VI for Override" context menu will create each override VI with the correct connector pane, VI properties, and access scope already set.

0 Kudos
Message 2 of 8
(3,881 Views)

Hi all,

Found it, right click the new actor class and choose New -> VI for Override, choose Actor Core.vi

http://forums.ni.com/t5/LabVIEW/Actor-Framework-auto-generate-actor/m-p/2515778

0 Kudos
Message 3 of 8
(3,881 Views)

Thank you David!

0 Kudos
Message 4 of 8
(3,881 Views)

You also might want to look at the "Save>>Save As..." menu option on a class (allowing you to copy a child actor as a template).  Another useful thing with LVOOP classes is the "LVOOP Assistant", which adds among other things, the useful options "Create Child Class" and "Clone Method".

Message 5 of 8
(3,881 Views)

drjdpowell wrote:

Another useful thing with LVOOP classes is the "LVOOP Assistant", which adds among other things, the useful options "Create Child Class" and "Clone Method".

Wow, how did I miss that tool?!

0 Kudos
Message 6 of 8
(3,881 Views)

mkabatek, at some point during your Actor Framework learning curve, I suggest you take the time to walk through Launch Actor and Actore Core. This can help you decide where to put functionality: whether in Pre Launch Init, Handle Error, Stop Core, etc. (all of which are methods in Actor.lvclass).

0 Kudos
Message 7 of 8
(3,881 Views)

Todd, David, and JD,

Thank you all for your responses, I'm well under way, and looking forward to learning AF in depth, I can already tell it will be very useful.

0 Kudos
Message 8 of 8
(3,881 Views)