03-02-2022 08:02 AM
Hello All,
i need help with actor framework, as i'm new in this.
I have created one caller actor and one nested actor with all needed methods and messages.
From caller actor core, i can send messages to methods of nested actor, and that work just fine.
Also abstract message is sent back to the caller.
But when I want to send value form caller actor core to nested actor core, i don't have idea how to do this.
Instead of 'ms to wait' and 'send' controls in nested actor core, i'd like to get values from caller.
If anyone can give me direction in which way i should think?
Thanks.
Solved! Go to Solution.
03-03-2022 01:53 PM
What are you doing with the data in the nested actor? Are these values only used in the actor core? If so just message from the caller actor to the nested actor. If not then perhaps you need to rethink the structure so that you only need the values in the actor core. Retain the values in the actor private data. If you need to display the values in the nested actor then put references to the controls in the nested actor private data and write to those when the message is received.
03-03-2022 02:07 PM
But when I want to send value form caller actor core to nested actor core, i don't have idea how to do this.
What do you mean by caller actor core to nested actor core? Do you want to transfer data between actor helper loops? For that you can send a normal message to the nested and from there you can use a queue or a user event to send data to the actor helper loop.
03-07-2022 01:58 AM
Hello,
Yes, i just sending from actor loop to nested helper loop.
But this is solved with normal messages. thanks.
But there is another problem..
When i close caller actor front panel, nested actor is also close, what is ok.
When nested actor receive stop event, it should send private message (close FTDI communication).
But nested actor is closed before that message is sent and process is complete.
I put 'one button dialog' in my close FTDI message, and action is not complete.
Please for advise.
How can i complete message/method, and then to close nested actor.
Nested actor:
Thanks
03-07-2022 02:18 AM
When caller actor stops it will automatically stop all nested actors (this is already implemented in the framework). You can override Stop Core.vi in the nested actor and close there the FTDI communication. If data is not available in the actor you can send a message from Stop Core.vi to your helper loop to close the FTDI communication and then another message to stop the helper loop. Do not send the stop message for the helper loop from anywhere else!
03-07-2022 02:44 AM
Thanks Lucian,
this helps, and now work correctly.
I put close message in stop core of nested actor.
But as i am totally new in AF, can you please explain me how to override stop core? And what does it mean?
Thanks
03-07-2022 07:33 AM
@milan87 wrote:
Thanks Lucian,
this helps, and now work correctly.
I put close message in stop core of nested actor.
But as i am totally new in AF, can you please explain me how to override stop core? And what does it mean?
Thanks
When you make a stop core for the nested actor this is an override. If you do not make the stop core vi then the stop core from the parent class (usually actor) will be used.
03-07-2022 07:58 AM
Understood. Thanks