05-14-2013 11:53 AM
Has anyone come up with a way of creating private messages that can only be sent (with Send my_method.vi) from within VIs of an Actor descendant? The main application would be for creating messages that could only be sent from parallel loops inside an actor's Actor Core.vi to the parent method so that the main actor loop can process the message. For instance, if you only want parallel processes inside the override of Actor Core.vi to be sending their error info back to the loop in the parent method, using a private-scoped message could keep any other VI exterior to the class from accidentally sending error info to the actor.
Solved! Go to Solution.
05-14-2013 01:16 PM
Yes.
1) Put the parent actor and its message in a library and then mark the message class as private in the library. This creates a message that only the parent actor can send.
2) Add a "send this message.vi" to the parent class. Make it protected. Have that VI generate and send the private message.
05-17-2013 03:33 PM
Cool. Next time I need to do this, I will give it a shot.