Creating a LabVIEW Class

LabVIEW 2018 Help

Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)

LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help
LabVIEW 2020 Help

You can use a LabVIEW class to create a user-defined data type. A class contains private data of the class and member VIs. Complete the following steps to create a LabVIEW class.

  1. Create a new LabVIEW project or open an existing project.
  2. Right-click My Computer in the Project Explorer window and select New»Class from the shortcut menu. The New Class dialog box appears.
  3. Enter a name for the LabVIEW class in the New Class dialog box and select OK to close the dialog box. The LabVIEW class appears in the Project Explorer window along with the private data control. The private data control has the same name as the class with the exception of having the .ctl extension appended to the name.
Note  You also can select File»New to display the New dialog box and select Other Files»Class from the Create New list to create a new class.
  1. Right-click the class and select Save from the shortcut menu to save the LabVIEW class. When you save the class, consider renaming it so that you can easily identify the purpose of the class.

You can complete the following actions:

Note  You also can create a LabVIEW class from a control or type definition.

You can define data, create member VIs, or edit the class properties in the order that you need. Some classes may not need private data, but may need member VIs so that you never define the private data control. You may change the wire appearance and other class properties before developing the class. You can develop aspects of the class in the order that best suits the individual project and development plan.

Note  You can create a directory on disk named the same as the LabVIEW class to save the class library file, class member VIs, and class custom default probes. You can include the files that the class library owns in the directory. If you include files for more than one class library in the same directory, conflicts might occur if you try to include VIs of the same name in different class libraries. Naming conflicts can occur in the development process when you override dynamic member VIs.


Not Helpful