After NI week last year, I had a bit of encouragement to write a couple of whitepapers about some interesting things I had been working on in Hardware Abstraction and LVOOP.
It took a few months to get the necessary sign offs at my company to publish. Norm Kirshner at NI had suggested that I post them in this group when I finally got the OK. I wanted to post this discussion just to give anyone who may be interested a 10,000 ft overview.
Whitepaper #1: Object Oriented Associative Array in LabView
For many test applications, the type of instrument you want to use for a measurement isn't set in stone. For example, you can measure a voltage with a PSU, a DMM, or probably any number of things. What I set out to do was come up with a method where I could have my top level code reference an abstract 'Test Instrument' and call similar functionality (e.g. measure voltage) the same way across instrument classes to allow more flexibility. The end result is something akin in concept to multiple dispatch (a form of dynamic dispatch where the actual function called is determined by the datatype of 2 or more parameters). While this isn't directly possible in LabVIEW (you can only use OO Dynamic dispatch on 1 input on a VI), this method achieves the same practical effect. Use of the above mentioned Associative Array datatype in this architecture allows for a really neat 'semi hidden' feature in that it gives you the ability to use a unit test to create API documentation for your hardware actions automatically based on the actual key/value pairs pulled from the array (as well as what type they are cast to by the polymorphic retreive).
I sincerely hope that this information can be of use to the wider LabVIEW community. Constructive feedback and discussion are of course always appreciated!