Built-in LabVIEW Object-Oriented Programming Features


For quite a long time, LabVIEW developers have needed and wanted built-in (native) support for object-oriented programming. The benefits of having OOP built into LabVIEW are the lack of need for internal support VIs, built-in support for editing tasks, editor/compiler support for enforcing encapsulation rules, better efficiency of execution, and so on. With LabVIEW 8.0 came the first built-in features that addressed object-oriented programming, and subsequent LabVIEW releases are extremely likely to continue down this path toward native support for OOP. With LabVIEW 8.0 came two new object-oriented(ish) features: project libraries and XControls.

Project Libraries

We discussed project libraries, very briefly, in Chapter 16, "Connectivity in LabVIEW," when we discussed shared variables (because shared variables must be members of project libraries). But, project libraries are good for a lot more than just storing shared variables. You can specify library member VIs as being public or private. Private VIs may only be called as subVIs by members of the project library, whereas public VIs may be called by any VIs in your application (public VIs are your project library's interface). This is a huge step forward toward native support for object-oriented programming in LabVIEW. It is the first built-in feature of the LabVIEW editor that implements one of the six object-oriented concepts (Encapsulation). There are a variety of indications, made publicly by National Instruments, that built-in object-oriented features are just around the corner and will likely evolve from the project pibrary.

XControls

XControls are a feature that allows you to create controls and indicators that have edit-time behavior that is defined by LabVIEW code that you write. And, just like traditional controls and indicators, you can define properties and methods for your XControls. You create instances of XControls by placing them on the front panel of a VI. If you want multiple instances, place multiple instances of your XControl. Although this is not intended to be a built-in object-oriented programming construct, the object-orientedness of the design is worth highlighting.

The Future of LabVIEW Object-Oriented Programming

Although there are still five out of six object-oriented concepts that are not currently supported natively in LabVIEW (project libraries provide Encapsulation), we are very confident that the future of object-oriented programming in LabVIEW looks very bright. And that's all we're going to say. ;-)




LabVIEW for Everyone. Graphical Programming Made Easy and Fun
LabVIEW for Everyone: Graphical Programming Made Easy and Fun (3rd Edition)
ISBN: 0131856723
EAN: 2147483647
Year: 2006
Pages: 294

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net