labview object oriented programming (lvoop) introduction of the hgf base class library (helmholtz,...

Download LabVIEW Object Oriented Programming (LVOOP) Introduction of the HGF Base Class Library (Helmholtz, GSI, FAIR) Studiengruppe für elektronische Instrumentierung

If you can't read please download the document

Upload: saul-pannell

Post on 15-Dec-2015

227 views

Category:

Documents


3 download

TRANSCRIPT

  • Slide 1

LabVIEW Object Oriented Programming (LVOOP) Introduction of the HGF Base Class Library (Helmholtz, GSI, FAIR) Studiengruppe fr elektronische Instrumentierung 24.9.2008 Holger Brand Slide 2 24. Sep. [email protected], SEI Herbsttagung 2008 2 Contents Introduction to LVOOP What is LabVIEW? Why Object Oriented Programming? Why should use LVOOP? Differences to conventional OO languages Some remarks on constructors, destructors and dataflow VI & Object Memory Simple classes, inheritance, examples LVOOP Design Patterns Focus of HGF Base Class Library Factory & HGF_Base Reference & Object Manager Functional Global Variable & Visitor Events & Thread Pool Network Communication Slide 3 24. Sep. [email protected], SEI Herbsttagung 2008 3 What is LabVIEW? LabVIEW is a development environment For development of Measurement-, Automation-, Test- and Control Systems. It includes an advanced math and analysis library. Provides interfaces to DAQ, many field busses, network communication, ActiveX,.Net, DLL, etc. LabVIEW is a graphical programming language Inherent multithreaded with easy to use synchronization methods VI: Virtual Instrument consists of frontpanel and blockdiagram subVI: VI to be used as function Express VI: configurable subVI LabVIEW Modules and Add-Ons extend the base functionality Refer to http://www.ni.com/labviewhttp://www.ni.com/labview Slide 4 24. Sep. [email protected], SEI Herbsttagung 2008 4 LabVIEW 8.5 Slide 5 24. Sep. [email protected], SEI Herbsttagung 2008 5 Dataflow Paradigm LabVIEW is a data flow language Data flows from data source to sink. It does not normally have variables. Wires are not variables. Front panel controls are not variables. Even local or global variables are not scoped or allocated the way variables are in other languages. Variables are part of a model that conflicts with data flow. Without variables and a scope defining the lifetime of those variables, construction and destruction are meaningless concepts, and therefore they are left out of the language design. Therefore: LabVIEW forbid LabVIEW classes in the interface of LV- built DLLs (shared libraries). Slide 6 24. Sep. [email protected], SEI Herbsttagung 2008 6 Why Object Oriented Programming? Classes Attribute data encapsulation Methods operating on attribute data Access scope (Multiple-) Inheritance Recipe, how to create objects Advantages Well defined public interface Well define responsibilities (class and developer) Easier to debug Better scalability Better maintenance Each object can be viewed as an independent little machine or actor with a distinct role or responsibility (object by reference). Leads to better software design and architecture (hopefully!) // C++ class example #include using namespace std; class CRectangle { private: int x, y; public: void set_values (int,int); int area () {return (x*y);} }; void CRectangle::set_values (int a, int b) { x = a; y = b; } int main () { CRectangle rect; rect.set_values (3,4); cout