Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Creating a LabVIEW Class

LabVIEW 2011 Help

Edition Date: June 2011

Part Number: 371361H-01

»View Product Info

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.

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit