Documentos de Académico
Documentos de Profesional
Documentos de Cultura
com/labviewzone
Agenda
Object-oriented programming
Benefits of object-oriented programming
Object-oriented development in LabVIEW
Object-Oriented Programming
An approach to application development
Appropriate for large-scale applications with teams of
developers
SubVIs
SubVIs improve code readability and
maintainability
You need subVIs if:
The same code appears twice on the block diagram
Block diagram is larger than one screen
You repeatedly use sequence structures
Project Library
Set of related VIs and other LabVIEW files
Information on library is stored in a text file (.lvlib)
Namespace applied to VI
names
Public
Public VIs
Private VIs
Private
Object-Oriented Programming
Parent Class
Child Class
Inheritance
10
Camera phones are types of cell phones that also contain a camera
Cell phones make calls
Camera phones make calls and take pictures
To test a cell phone, a call must be placed and verified
To test a camera phone, the cell phone and camera functionality must be tested
To test a camera, an image must be taken and compared to a reference
11
Additional features
Specify the class icon
Specify a VI icon template
Specify the wire color
12
Classes Demonstration
13
14
Create a VI
Specify scope
Public
Private
Protected
15
Methods
Initialize
Turn On
Place Call
Verify Call
Test
16
Methods Demonstration
17
Inheritance
Defines subclasses
Creates is a relationship
Example: Camera phone is a cell phone
Reuse common functionality
Specialization
Extend or override common functionality for specific
needs
18
Methods
Test Extends Cell Phone Class Test
method to test camera functionality
19
Inheritance Demonstration
20
Encapsulation
Treat each object as a black box
Well-defined interface of data and
methods
Must use this interface in the application
21
22
Encapsulation Demonstration
23
Class Composition
Defining a class creates a new data type
A class can be made up of other classes
24
Methods
Test (Cell Phone and Camera)
Camera Class
Data
Camera Type
Methods
Take Image
Verify Image
Test Camera
25
26
27
28
29
Resources
LabVIEW Object-Oriented Programming FAQ
A Note on Learning Object-Oriented Programming
LabVIEW Object-Oriented Programming: The
Decisions Behind the Design
Graphical Object-Oriented Programming (GOOP)
www.ni.com/info - objectoriented
30
New User
Courses
Experienced User
Advanced User
LabVIEW Basics I
LabVIEW Intermediate I
LabVIEW Advanced I
LabVIEW Basics II
LabVIEW Intermediate II
Skills learned:
LabVIEW environment navigation
Basics of application creation
using LabVIEW
Basics of data acquisition and
instrument control
Skills learned:
Modular application development
Structured design and
development practices
Interapplication communication
and connectivity techniques
Skills learned:
Large application design
Advanced development
techniques
Multideveloper project
implementation
Certifications
Certified LV Associate
Developer Exam
Skills tested:
LabVIEW environment knowledge
Certified LabVIEW
Developer Exam
Skills tested:
LabVIEW application development
expertise
Certified LabVIEW
Architect Exam
Skills tested:
LabVIEW application development
mastery
31
32
Questions?
Thank You