S5 Solutions, Inc. | Electronic and Software Solutions for Product Development, Manufacturing, and Automated Test Equipment
  • Solutions
    • Product Design
    • Engineering Solutions
    • Automated Test Equipment (ATE) >
      • What is ATE?
  • Case Studies
  • Tools
    • ALOHA
    • MLA
    • LabVIEW & TestStand >
      • LabVIEW Basics
      • TestStand Basics
      • Learning LabVIEW
      • Getting Started with OOP
  • Blog
  • Contact

Getting Started with Object-Oriented Programming (OOP) in LabVIEW

LabVIEW is a great language. What could make it better? Objects.

Object-oriented programming adds a dimension to LabVIEW that can help bring order to your program and keep that order as it grows. If you have used OO in other languages, most of the principles are still in place. If it is a new concept, don't let that keep you from harnessing the power of objects to improve your LabVIEW code.

There is a learning curve, of course. But it is well worth it.

​Why use OOP?

  • Your life will get much harder and then much easier. Much, much easier.
  • It is a more intuitive way of looking at solutions
  • It mirrors the way things work in the real world
  • Code Reuse
  • Extensibility
  • Maintainability
  • Abstractions are the Keys to Upping your Game
Picture
The Dunning-Kruger Effect
How learning something new works

OO Basics

Encapsulation

  • A place for everything and everything in its place
  • Classes own data and protect access to it
  • Scoping / Access Privilege (Public, Private, Community)
  • ​Property on LVCLASS Virtual Folder/VI/CTL/etc
  • LV - Property Nodes & Accessors 

Scoping / Access Privilege

  • Scoping / Access Privilege
  • Public - Everybody
  • Private - Just Me
Picture
Looking for help with your LabVIEW project?
Get in touch to discuss how we can help.
Contact Us

Inheritance

Inheritance is a type of relationship between Parent & Child Classes. Child classes inherit attributes and functionality from their parents. From there, child classes can grow to include additional attributes and functionality that the parent does not possess.
  • Parent - more generic Class
  • Child - more specific Class
  • Many Levels Supported
  • Single vs. Multiple Inheritance - LVOOP supports Single Inheritance. Some other Languages support Multiple Inheritance.
Picture

Polymorphism

The word polymorphism comes from ​Latin, meaning “many forms”. This is the OO concept that there are varying forms of things that have similarities. For example, you may have multiple forms of shapes, such as Square, Circle, and Triangle, that have certain similarities, like color, size, and position.

By Value vs. By Reference

There are two ways a program can manage an object in memory: by Value or by Reference.
By Value (By-Val)
  • Enhanced Cluster
  • Copy-on-write
  • Branching Wires Generates Multiple Values
  • Hard to Share Data
  • When copies are OK
By Reference (By-Ref)
  • Traditional “Pointer”
  • Single Instance on Construction
  • Branching Wires Enables Multiple Access
  • Designed to Share Data
  • When Single Value is desired
So, how do you choose when to use By-Val or By-Ref?
The right choice depends on the purpose of the object and how it is used in the program.
Picture

Helpful Tools

NI GDS (GOOP Development System)
  • Available in VIPM
Picture
OpenGDS
  • Available for download at opengds.github.io and github.com/opengds/OpenGDS
Picture
Picture
Let's get in touch to discuss how we can help you with your LabVIEW project.
Contact Us
​Quick Links
Home
Company Overview
Case Studies
ALOHA
​MLA
Blog
Contact
Picture
S5 Solutions, Inc.
Mukilteo, WA
​
425.298.7447
​Info@S5Solutions.com
© 2023  S5 Solutions, Inc.           Employee Site
  • Solutions
    • Product Design
    • Engineering Solutions
    • Automated Test Equipment (ATE) >
      • What is ATE?
  • Case Studies
  • Tools
    • ALOHA
    • MLA
    • LabVIEW & TestStand >
      • LabVIEW Basics
      • TestStand Basics
      • Learning LabVIEW
      • Getting Started with OOP
  • Blog
  • Contact