LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

References are becoming invalid when passed to an actor using the Actor Framework

I have having an issue with passing a couple of references to an actor using the actor framework 3.0.7 (LabVIEW 2011 & TestStand 2010 SP1). 

 

Some background:

My application has three main components:

  • Main VI -- is not part of any class and Launches UI Actor.
  • UI Actor -- Launches the teststand actor
  • TestStand Actor -- Initializes and starts teststand.

The two references showing similar behavior (invalid reference) are the TestStand App Manager control and the "Current VI's Menubar" reference.  The App Mgr control is on the front panel of the UI Actor's Actor Core.vi.  The menubar reference is retrieved in the block diagram of the UI Actor's Actor Core.vi

 

Now,

When I run the Main VI I get an error in the TestStand Actor's Actor Core.vi (Remember Main VI launches UI Actor launches TestStand Actor) because the App Mgr and menubar references are invalid (.  I have checked and verified that in this scenario the references are valid in the UI Actor before it launches the teststand actor. 

 

If I run the UI Actor's Actor Core.vi stand alone (i.e. run it top level) the App Mgr and menubar references are passed to the teststand actor, no error occurs, and the code functions as expected

 

Why would these references be invalid by simply starting a different top level VI?  Could it have something to do with when the references are passed vs. when the front panel is loaded into memory?

 

I tried putting the App Mgr control on the front panel of the Main VI and passing it to the UI Actor and then to the TestStand Actor.  This works.... 

 

Anyone have any experience or knowledge to why this is occurring?

 

 

 

 

0 Kudos
Message 1 of 2
(2,203 Views)

Generally, references in LV are "owned" by the hierarchy they are first created in, and the hierarchy is determined by the top level VI. Once the hierarchy goes idle or out of memory, the references created by that hierarchy are automatically closed. That's usually what causes something like this - the reference is created in one hierarchy (let's say the main VI hierarchy) and then that hierarchy stops running.

 

I don't know the AF well enough to say if that's really the case (I actually thought that it always launches a separate top level dynamic process, which I assumed is where the UI actor's core VI would always be called), but that might help explain it. If not, you might wish to post to the AF group in the communities section.


___________________
Try to take over the world!
0 Kudos
Message 2 of 2
(2,178 Views)