LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Find active object instance

Let's say you have an an application which starts a few active objects. Is there a way to locate a specific instance of the active object? That is, all are descendants of the same class which has a "Run.vi". I found a way to get a list of all VIs in the memory, but what I'd like to do is something in the line of:

   - for all "Run.vi":

      + get the parent object
      + call "Read ID.vi" for that object
      + do stuff when you find the one you need...

Any help/pointers would be greatly appreciated.

Br, Mike

0 Kudos
Message 1 of 3
(2,642 Views)

Miha Vitorovic wrote:

Let's say you have an an application which starts a few active objects. Is there a way to locate a specific instance of the active object? That is, all are descendants of the same class which has a "Run.vi". I found a way to get a list of all VIs in the memory, but what I'd like to do is something in the line of:

   - for all "Run.vi":

      + get the parent object
      + call "Read ID.vi" for that object
      + do stuff when you find the one you need...

Any help/pointers would be greatly appreciated.

Br, Mike


 

I imagine there will have to be some trial and erro in there to get this all to work.

 

I know i can set a dynamic dispatch VI control using the "Set Control" method so maybe reading the control by name and apssing that value to your "Read ID.vi" method will get you what you want. (see this thread).

 

Launch_Template.PNG

 

Another note:

 

Casting the child class data as the parent should NOT return an error. Attempts to cast it to other classes should fail.

 

All I can offer off hand.

 

Ben

Message Edited by Ben on 06-16-2010 09:16 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 3
(2,621 Views)

Thanks, in the mean time I had exactly the same idea, but had to turn to other work before I could try it out. What stopped me was getting the correct VI instance. I thought that "VI Server/Application/All VIs in memory" will get me VI references, but all it gets me are their names. So now I somehow have to get from names to VI references, but as I mentioned, other work interrupted...

 

Thanks again, Mike

0 Kudos
Message 3 of 3
(2,616 Views)