10-22-2019 01:37 AM - edited 10-22-2019 01:39 AM
I have a caller actor that launches a nested actor with an abstract implementation to a method that changes the caller actor private data.
When I run this, I can probe the specific message implementation and notice that the data from the abstract message is received.
However, when I now read out the caller private data within the caller actor itself, that data is nowhere to be found.
I attached a this project.
You will see that the nested actor tries to push its VI Refnum via an abstract message to the caller. The caller actor will launch this nested actor with a child implementation of that abstract message to push the nested actor VI Refnum in an array in it's private data.
For testing purposes, the caller actor timeout case in the helper loop will probe for this VI refnum array (every 100ms).
When the caller actor is started, the nested actor is also launched.
The nested actor will send its VI refnum via an abstract message to the caller actor.
But this refnum is not being inserted in the caller actor private data.
Am I doing something wrong?
10-22-2019 01:52 PM
Actors are by value - you are looking at the actors class data in the event loop, which is a branch of the actor class wire before Actor Core. So, you essentially have two copies of your actor - the one running in actor core, and the branch going to your event loop. The message updates the value of the actor running in actor core.
10-22-2019 07:57 PM
Excellent answer!
By changing the child implementation of the abstract method to also generate a user event that is catched by the event structure to update a front panel indicator (array of VI Refnums), the problem was solved.