mike5 Posted June 16, 2010 Report Share Posted June 16, 2010 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 Quote Link to comment
Shaun Hayward Posted June 16, 2010 Report Share Posted June 16, 2010 Maybe, when you initialize your active objects you could keep a registry (functional global / whatever) of the ones you launch? Then, you could use this whenever you want to do your action. Quote Link to comment
mike5 Posted June 16, 2010 Author Report Share Posted June 16, 2010 Maybe, when you initialize your active objects you could keep a registry (functional global / whatever) of the ones you launch? Then, you could use this whenever you want to do your action. Already have that, but I still have to match the "Run.vi" in the memory with the appropriate object. This is the problem I'm trying to solve. Br, Mike Quote Link to comment
K-node Posted June 16, 2010 Report Share Posted June 16, 2010 Already have that, but I still have to match the "Run.vi" in the memory with the appropriate object. This is the problem I'm trying to solve. Br, Mike Do your 'Run.vi's have a control on the front panel that *is* the parent object - like SciWare's Process.vi has an the object control in his ActiveObject framework? If so, can't you go get the value of that control and cast it to your desired object. This should be the instance of the object that launched the Run.vi, or am I missing something here. Alternately, each of your ActiveObject could keep a list of the Run.vi's it launched and then you could exhaustively search for the reference that matches in all of the ActiveObjects your app created. But I like my other idea better. Hope this helps. Quote Link to comment
mike5 Posted June 17, 2010 Author Report Share Posted June 17, 2010 Alternately, each of your ActiveObject could keep a list of the Run.vi's it launched and then you could exhaustively search for the reference that matches in all of the ActiveObjects your app created. But I like my other idea better. Yes, thank you. This is exactly what I will use. Br, Mike Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.