01-17-2016 05:42 AM
Solved! Go to Solution.
02-07-2016 04:54 PM
Good afternoon, I have a question about using Actor Framework. Deputy example, to better understand what I do. I have a parent class that inherits from the actor, and the various messages are defined for the class, in this case "Get state.vi". Now define a child class that inherits from the parent class. Whether messages that are to be used are the same as those of the parent class, you need to define all messages for the child class or the child class can inherit all messages? How I can do to make a child class run messages from a parent class, with references to the child class?
Thanks.
02-08-2016 04:04 AM
I'm not that familiar with the actor framework, but one of the best resources I found while learning it was here (at least, I think it was this): https://decibel.ni.com/content/docs/DOC-32600
It takes a sample application built using a QMH and shows you the various steps / progression moving it from a QMH to an LVOOP implementation all the way through to the Actor Framework.
It should help you see how you can adapt/modify your code to the actor framework.
02-08-2016 04:00 PM
Thank you. The link has been helpful, but still have not managed to run the example. Deputy what I have done case anyone comes up with an idea.
Thank.
02-11-2017 10:11 PM
hello gentlemen..
i was just stuck again and again with actor framework usage in labview.
here i try to pass the message of boolean and a numeric between parent and child but it not works anyone help me to solve this?
02-13-2017 12:10 AM
02-13-2017 01:11 AM
Yes but... Problem is the numeric value not received between parent and child???
02-13-2017 01:41 AM
@mohamedtanveej17 wrote:
Yes but... Problem is the numeric value not received between parent and child???
-You have to add first numeric control and indicator in same way as created for boolean control and indicator for both parent and child actors.
-Create new vi from static dispatch template and follow the same steps followed for Get State from Parent and Child methods.
-In parent inside event structure add new event for Numeric control and pass the value to the new method created.
02-13-2017 04:11 AM - edited 02-13-2017 04:14 AM
Carlos,
Firstly, just in case you haven't seen it, there is a subforum/group for Actor Framework questions - the people there are really helpful and the questions are all about Actor Framework problems. They also have some helpful materials stickied.
Secondly, what are you trying to do? I opened the example project you uploaded (Example1.zip) and took a look but didn't see anything as the obvious goal.
Regarding inheritance, child classes (not the same as nested actors) behave in the same way as with non-Actor Framework OOP code. That is, if you have a dynamic dispatch VI in the parent, you can override it in the child class to modify the behaviour of the VI. VIs in the parent (dynamic or static) can be used by the child, provided it has access to the VI (i.e. the VI is Public or Protected, or the child class is a friend of the parent class and the VI is Community scope.)
If the VI called is implemented by the parent (because it is static, or because you don't have an override, or because your override uses 'Call Parent Node') then the private data available should be that of the parent - if you have a child implementation called via dynamic dispatch, the child's private data will be available to the override (but not the parent, during a 'Call Parent Node' VI call).
Messages also have their own inheritance hierarchy, but in the simplest case, they inherit only from Actor Framework's 'Message' class. Typically, they are a class with private data, which might be empty, or contain the inputs to the VI that the 'Do.vi' calls, and two VIs, 'Send <MessageName>.vi' and 'Do.vi'. The Do.vi is an override of the Actor Framework's 'Message.lvclass:Do.vi' and the parent does nothing here - what is important is that when an Actor receives the message, it calls the 'Do' VI of the Message that you define. Usually, this calls some public class VI (for example, 'Set Indicator' might be an example that could be called by Message). Here, you will also see that data is often unbundled from the Message class' private data, and used as an input for the public VI of the class that you sent the message to, via the enqueuer.