LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LVOOP HAL Commonality Best Practice


@Norbert_B wrote:

...Sadly, one option other OOP languages can provide is not possible in LV OOP: Overloading...


Well, actually overloading is possible. Using a polymorphic VIs. And although they cannot hold dynamic-dispatch VIs, you can have a wrapper VI in the poly-VI and in that have the dynamic dispatch. I used that technique to build a HAL with overloaded methods. If I remember correctly, DAQmx is a good example of what can be done. I'm too tired right now though to understand if this solves the OP's question.

Certified LabVIEW Architect
Message 11 of 12
(417 Views)

Thanks for the input Kevin and Bert. I had considered using a composition class in the properties of the instrument. In this case I was using actor framework and it seemed to be duplicative to have an actor handling an instrument and then a class in that actor that handled communication to the instrument. I might have another look at this in the future, it does seem like a sensible way of doing things.

 

And in the end it might just be faster to code something quick rather than something ideal!

CLA - Kudos is how we show our appreciation for comments that helped us!
0 Kudos
Message 12 of 12
(412 Views)