LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a scene object from one Actor to another

Solved!
Go to solution

Hi everyone,

I am creating a scene object in one actor and want to pass that to its parent actor when the creating actor shuts down. While I can display the object, I cannot access any of its child objects (Find Object fails with error 1055). Also, it is recognized as an invalid refnum.

When I try the same thing with a subVI instead of an actor, everything works fine.

Am I missing something here? This seems like a bug, albeit a very weird one.

Cord

0 Kudos
Message 1 of 5
(2,841 Views)
Solution
Accepted by topic author cordm

All LabVIEW references are "owned" by the top-level VI that created them (and all AF Actors are separate top-level VIs).  When a top-level VI stops, it cleans up all its references.  

 

BTW, you should use "3D picture" in your question, as few people will know what a "scene object" is.

0 Kudos
Message 2 of 5
(2,836 Views)

Thanks for your reply! I tried to be specific with the scene object, but maybe too much so.

That explains why the reference is invalid, but the fact that I can still display it in a 3D picture threw me off.

Ok, so in order to display it in the calling actor I will have to recreate the picture. I will see if it is possible to "flatten" a 3d picture.

When is a new top-level VI created? I suppose start asynchronous call will do that. Anything else?

 

0 Kudos
Message 3 of 5
(2,805 Views)

@cordm wrote:

Ok, so in order to display it in the calling actor I will have to recreate the picture. I will see if it is possible to "flatten" a 3d picture.

 


Why not just not shutdown the scene-creating actor till you are finished with the scene?  It seems a bit strange (and not very actor-model-like) to be doing this.

 


@cordm wrote:

When is a new top-level VI created? I suppose start asynchronous call will do that. Anything else?

 


Async call, plus the older "Run VI" method, plus just running something manually from the run arrow.

0 Kudos
Message 4 of 5
(2,795 Views)

If you want a short-lived helper Actor to populate the scene for you, then you need to pass a scene reference to it for it to work with instead of letting it create its own.  This way, you get around the "Who owns the scene" problem when shutting down the helper.

0 Kudos
Message 5 of 5
(2,790 Views)