Difference Between Classes and Object in LabVIEW

Updated Nov 6, 2023

Reported In

Software

  • LabVIEW

Issue Details

I am not familiar with object oriented programming in LabVIEW and I am trying to implement class hierarchy in my application. What is the difference between a class and object in LabVIEW?

Solution

A class defines the data and methods associated with an object of the class. A class will be associated with a .lvclass file inside of your LabVIEW project.
     

Figure 1: The class shown here is Vehicle. The .ctl file contains all associated data for the class
and there are two methods associated with the class.

An object is a specific instance of a class. Objects have data and methods defined by the class. If you only have a LabVIEW class but have not used it inside another VI then you will have no objects. Below is a Vehicle object:
 

Additional Information

Please refer the the Classes and Objects help documentation for more information regarding LabVIEW classes and objects.