LabVIEW Development Best Practices Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LVOOP for Hardware Abstraction and Custom Datatypes

Hi all,

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

https://decibel.ni.com/content/docs/DOC-28267

  • Performance benchmarks (Array implementation vs Variant Attribute implementation)
  • Using LVOOP to bake in additional functionality for your developers (for example Cluster XML to Associative Array)
  • Polymorphic insert/retrieve functionality (help make the code calling your class neat and tidy)
  • High level algorithm overview for an Array implementation

Whitepaper #2: An Architecture for Object Oriented Hardware Abstraction in LabVIEW

https://decibel.ni.com/content/docs/DOC-28268

     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!

Scott Crook

Certified LabVIEW Architect

CMOS Test Engineer - TriQuint Semiconductor

0 Kudos
Message 1 of 1
(4,683 Views)