LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to programatically determine the children of a class during program execution?

Solved!
Go to solution

I am basically trying to determine programatically if a class is a child of a specific parent class OR along the same lines I need a list of all children of a parent class.  Either method would work.  Is this possible to do via code?

-Daniel
Technology Service Corporation

0 Kudos
Message 1 of 4
(2,482 Views)
Solution
Accepted by topic author daniel.coons

Getting a list of all children is impossible, since you have no way of knowing if all the children are loaded or not. Checking the inheritance is simple, however. First, if the wire is of a specific class, you can simply use the To More Generic Class primitive and figure it out at edit time. If the wire is of a more generic class, you can use the Preserve Run-Time Type primitive and check the error output. I haven't checked, but I believe this should work.


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

And an image to go with Yair's reply...

 

 

 

 

 

If no error then it is a child.

 

More LVOOP images here.

 

See this thread for more words.

 

Ben

 

PS: An yes that error wire should be wired between the loops.

 

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 4
(2,472 Views)

Good call; Preserve Run-Time Class will error when it has the incorrect parent.  Thanks for the help!!

-Daniel
Technology Service Corporation

0 Kudos
Message 4 of 4
(2,461 Views)