What Is The Difference Between LVOOP API To More Specific Class And To More Generic Class ?

Updated Feb 13, 2025

Reported In

Software

  • LabVIEW

Issue Details

I have a customer who is curious about the difference between the "To more specific class" and " To more generic class" functions since they sometimes have the same output for both parent and class input.

enter image description here

Solution

 

To More Specific and To More Generic only control the wire type. Dynamic dispatch works off the type of data on the wire. The class instance (data) is the same regardless of the wire type so the dispatch goes to the same thing.

To More Specific would be appropriate for casting Parent to Child. To More Generic would be appropriate for casting Child To Parent. It is generally expected To More Specific to cause an error casting Child To Parent because Parent is not a more specific type but the LVOOP allows that. So using To More Generic to cast Parent to Child is not broken.