Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Actors retaining information during successive Launch-Close operations

Solved!
Go to solution

I've developed a couple of actors for re-use in my test programs, namely a 3D Surface Plot actor and a .NET XY Chart actor. Depending on the test program, I tend to launch the actor(s) (or several instances of them), configure them with test data via messages, save the plots (again using messaging), and close them using a Normal Stop message. I'll do this as often as necessary during the test program run, obviously without closing down the main test sequencer actor. But I notice that during successive launch-close operations, the plot actors re-launch with the data from the previous plot. This turns out to be a problem with the .NET actor, as some references don't get recreated as required, and the actor will error out due to a null reference. Note that I'm being good with my references in the previous plot run, as in I destroy everything correctly.

Anyway, my question here is more to do with why actors retain information on successive launch-close operations? How do I ensure that I have a completely unique actor everytime I launch one?

0 Kudos
Message 1 of 5
(4,084 Views)

To me it sounds like the .NET object is retaining information rather than the actor itself.

Perhaps you could try clearing the data drawn on the .NET chart in an overridden stop core. Goal being to return the chart to the "default" state before the actor shuts down.

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
Message 2 of 5
(3,180 Views)
Solution
Accepted by topic author DMurrayIRL

By "plots", are you referring to the charts/graphs on the front panels of the Actor Core VI?

You'll need to explicitly clear those because they are storing state in shared reentrant VIs, which is generally a no-no unless you manually clear that shared state when the VI starts running (or clear it when it stops running).

0 Kudos
Message 3 of 5
(3,180 Views)

Yes, I'm referring to the charts that I display on the Actor Core FP. I've just been closing .NET references which isn't enough, it appears. I haven't yet found the correct .NET methods to clear the graph state correctly, and it's too late on a Friday to think clearly anyway, but thanks to both of you for your replies. 

Message 4 of 5
(3,180 Views)

Okay, I'll post the solution to this for completeness, in case anyone else is doing anything with .NET-style actors. As suggested, it's a case of clearing the chart data in the actor Stop Core. For the .NET charts I'm working with, I just need to use Invoke Nodes to clear the various plot "collections", e.g. Series, Titles, Legends, etc, and then closing all references in turn.

Thanks again for the help.

Stop Core .NET XY Chart.jpg

0 Kudos
Message 5 of 5
(3,180 Views)