I'm pretty new to OOP in LabView (but I've already do it with other langages). I'm trying to do these classes in my project but I'm facing a problem, I can call the methods of the class "Voie" from her daughter Voie_AI_PT but when I try to call a method from a "grandchild", the method doesn't return anything (and I don't have any errors shown). Anyway, as soon as I try to call from above a parent method, I can't get a result and I don't know why.
Here is the inheritance of my classes:
And here is the scope of my method (which is the same for others). All my classes have public methods, I've tried with protected too but nothing changed.
I'm working on LabView 17.
Thank you for your help
Solved! Go to Solution.
Oh, how or where can I check to resolve this ? Could it comes from the inheritance or a parameter I added or removed ? I chosed this inheritance parameters from my grandparent but I tried others things without success.
If you have the same method implemented in a child class, then calling the dynamic dispatch with the child object like you're showing will use the child implementation (even if you drop a grandparent node).
You could make 'Lire ID.vi' static dispatch (if you always want the grandparent to provide the value) or you can just not override it in children (but you can't always control middle classes in some arbitrary inheritance hierarchy).
The icon will update in the case that you're showing if a child class's method is being used, but the icons seem very similar so I can't tell if that's happening or not.
Also, you can use Context Help to see which VI will be called. Since you have a block diagram constant on the block diagram, it will give the "lowest" child that suits the hierarchy.
I found where the problem came from, it has nothing to do with inheritance. I just badly used my constructors in my first grand child so the grandparent data where sent in void.
Without you I would have searched in parameters instead of my code, thanks a lot for your help !