Create Custom Gauges in LabVIEW

Updated Dec 28, 2023

Environment

Software

  • LabVIEW

This article explains and walks you through how to create a custom control in LabVIEW. The steps provided in this article can be applied to any custom control, due to the customization is implemented using Type Definitions. A type definition or a strict type definitions is a custom control or indicator linked to the saved file for that custom control or indicator. When you save a custom control or indicator as type definition, any data type changes you make to the type definition affect all instances of the type definition in all the VIs that use it.  When you save a custom control or indicator as a strict type definition, any data type and cosmetic changes you make to the strict type definition affect all front panel instances of the strict type definition. However, if you change a strict type definition, instances placed on block diagrams as constants, act as if the links is not strict, and LabVIEW updates the constant only with data type changes.

You can save a custom control or indicator you created in a directory or LLB and use the custom control or indicator on other front panels. You also can create an icon for the custom control or indicator and add it to the Controls Palette. Refer to the caveats and recommendations before you begin creating custom controls and indicators.

 

Complete the following steps to create a type definition or a strict type definition.

  1. Right-click a control, indicator, or constant you want to make a type definition and select Make Type Def. from the shortcut menu.
  2. Right-click the instance of the type definition and select Open Type Def. from the shortcut menu to display the Control Editor window.
  3. (Optional) To create a strict type definition, select Strict Type Def. from the Control Type pull-down menu on the toolbar.
  4. Make the changes you want to the control or indicator. You can change the size, color, and relative position of the elements of a control or indicator and import images into the control or indicator.
  5. Select File»Apply Changes to apply the changes to the control or indicator. The Apply Changes menu item is available only after you make changes to the control or indicator. If you make changes to a control or indicator and try to close the Control Editor window without selecting File»Apply Changes, LabVIEW displays a message asking if you want to save the changes.
  6. Select File»Save to save the custom control or indicator as a type definition or a strict type definition. You can save the type definition or strict type definition in a directory or in an LLB.

In order to show an example of how to create a customized control in LabVIEW, the process of customizing a gauge is shown below.
  1. Open LabVIEW and create a Blank VI.
image.png
  1. Select a Gauge from the Controls Palette or by using quick-drop.
image.png
  1. Right-click the gauge control and select Make Type Def. from the shortcut menu.
image.png
  1. Right-click the instance of the type definition and select Open Type Def. from the shortcut menu to display the Control Editor window.
image.png
  1. (Optional) To create a strict type definition, select Strict Type Def. from the Control Type pull-down menu on the toolbar.
  2. After making the desired changes using the Control Editor window, the new customized gauge looks like is shown in the image below. 
image.png
  1. Select File»Apply Changes to apply the changes to the control or indicator. The Apply Changes menu item is available only after you make changes to the control or indicator. If you make changes to a control or indicator and try to close the Control Editor window without selecting File»Apply Changes, LabVIEW displays a message asking if you want to save the changes.
image.png
  1. Select File»Save to save the custom control or indicator as a type definition or a strict type definition. You can save the type definition or strict type definition in a directory or in an LLB.
image.png

Once your new customized gauge has been saved, you will be able to see it in your project explorer, where you can drag-and-drop it to your front panel and work with it. 
 image.png