ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LVOOPs-Problem with object creation

Hi all,

I am new to LVOOPs and trying to figure out things. I have a parent class named "Vehicle" under which there is a "Bike" class. The Bike class has two children A and B. To each class A and B I created Object instances and upcasted them Using "To more generic functions" to vehicle class. Now I am not able to access any of the VIs under any class using this newly created object instance. Can anyone explain me why? being new to LVOOPS I find it difficult to understand this. Thanks for the help in advance.

0 Kudos
Message 1 of 3
(3,509 Views)

Why are you using "to more generic" at all? It sounds like you messed that one up.

 

I assume that you are looking for dynamic dispatching. Please review the LVOOP examples for this.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 3
(3,478 Views)

You can only use VIs that the "wire" (aka class) knows about. If you up cast to a parent calss there has to be a VI in the parent class if you want to use that VI. Any VI (marked for dynamic dispatch) in a child class can over-ride the  same named VI of the parent.

 

Ben

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