02-16-2014 09:51 AM
Hello,
I'm trying to find a way to get a list of all diagram object for a given VI. I have tried the method "Diagram - AllObjects[]", but this function returns references to the main objects of the diagram, not all the objects recursively that are located inside these main objects. Is there a method to do so? If not, is there a way to do it recursively? I did not found anything so far.
Thanks,
Michel
Solved! Go to Solution.
02-16-2014 11:18 AM
Search for "Traverse for GObjects.vi"
02-16-2014 11:43 AM
Oh, so simple.
Now, let say I want to search for the object "SharedVariableNode". Is it possible from the references returned by "Traverse for GObjects" to extract the library name of the shared variable?
Thanks,
Michel
02-16-2014 12:14 PM
Is it possible from the references returned by "Traverse for GObjects" to extract the library name of the shared variable?\
Yeah, VI scripting has made life easier...!!
02-16-2014 06:57 PM
I think that this is valid when you have a shared variable reference. In the case of the "Traverse for GObjects" function the references returned are not a shared variable references.
So to simplify things I have attached a simple project with two libraries one called "toto.lvlib" and the other one called "toto2.lvlib", one VI "toto.vi" and in it's block diagram I have put the shared variable "What is my owning library name?" from "toto.lvlib" and "What is my owning library name 2?" from "toto2.lvlib".
My question is: How can I programmatically knows how many objects are in the block diagram that are shared variable type and for these shared variable I'd like to know the owning library? Is this possible with VI scripting?
In addition to this, would it be possible to do this operation recursively into the sub VI's of a top level VI?
Thanks in advance.
Michel
02-16-2014 07:50 PM - edited 02-16-2014 08:03 PM
Check the attached file.
Edited:
In addition to this, would it be possible to do this operation recursively into the sub VI's of a top level VI?
Oops I missed the recursive part, you still will be able to use the code presented in the attached VI, however you need to provide the VI/subVI references recursively.