LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use multiple children classes?

Solved!
Go to solution

OK, I'm lost.

 

In the image from a shipping example with LabVIEW, I can see how the circled example works. What I want to be able to do is use more than 1 child, in the same way. Do I have to replicate the code for the other child, or can I somehow have more than 1 child use the same wire?

 

Class Question.png

0 Kudos
Message 1 of 4
(2,447 Views)
Solution
Accepted by elrathia

Use an array where each element in the array is an instance of the child you require.

 

Invoke your methods inside an auto-indexed For loop.

 

Ben

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

Thanks Ben.

 

That worked, but showed me that I was following the wrong course. The methods in the loop only allow work on the parent class data. I can't access the child class data at all. So I'll have to figure some other way to do what I want.

0 Kudos
Message 3 of 4
(2,426 Views)

Just remember, as a class data is in private scope in LVOOP, only the class it self can access it's own data, no matter if it is a child or parent.

And a child class will NOT inherit the parents data.

Message 4 of 4
(2,417 Views)