![]() |
|
|
Customizing controls in LabVIEW only takes minutes and can make a big impact in the usability and visual appeal of your LabVIEW application. Common reasons for wanting to use custom controls include:
This tutorial will demonstrate how to customize the gauge control in LabVIEW. Other controls follow similar steps and the principals learned here will easily translate.
This tutorial will use the gauge from the modern palette to demonstrate how to customize a standard LabVIEW control.

2. There are numerous elements of the gauge control which we can edit. The needle is the notable exception (although you can change its color). There is an advantage to leaving the default frame as it is a vector graphic which scales very nicely. Scaling effects are most visible around the edge of your control so leaving the default frame while customizing the background image and the center piece is a good compromise between scalability and customizability. In this example we will replace the background and center piece.
3. Now you have your background image created it’s time to switch back to LabVIEW. Right click on your gauge and select Advanced»Customize to bring up the control editor.
4. Change to Customize Mode by clicking on the wrench icon on the toolbar
5. Customize mode allows you to move, rescale or replace any of the stock components of a control. In order to use your new background image, right click on the current dial and select Import from File at Same Size….
6. Browse to select your new background image.
7. You background will take the place of the original plain background.
8. The center piece of the gauge is also replaceable using the same technique. For this example right click and select Import from File at Same Size… and use the same background image. You will end up with something like this:
9. Save your new control by selecting File»Save.
10. Now when you close the control editor LabVIEW will prompt you if you want to replace the original control. Click “Yes”.
11. Congratulations you have created a nice looking, reusable gauge. As we created a large background image and kept the original frame your gauge will rescale nicely up to, and probably a little beyond, the size of the original background image size.
12. This is a quick and easy example of what is possible. Using the control editor you can create almost any style of gauge you’d like, here are few of my favorites:
13. In addition to using custom created graphics, using real-life images such as photographs can lend provide a familiar interface to users who are not familiar with virtual instruments. In this last sample you can see how a photo can be used as the basis of a custom control:

You can add additional needles to your gauge or change the color of existing needles by right clicking on the gauge and selecting Properties and then the “Appearance” tab.
The ramp has a number of customizable factors. First of all is whether or not it is displayed at all – you can enable it from the “Scale” tab of the Properties dialog. The other visual option you have here is “Interpolate Color”. This option gives you a constant gradient between colors as opposed to blocks of solid color
Changing the color of your ramp is done with the same color tool you can use for just about any front panel element in LabVIEW. You can bring up the tools palette by holding Shift and right clicking on the front panel. This works in both interpolated and non-interpolated mode. Even if you intend for your finished product to be interpolated it may be easier to turn it off while you pick colors and then let LabVIEW interpolate once you are done.
You can also adjust the radius and thickness of the ramp by clicking and dragging the handles located at the 12:00 position.
Finally you can adjust the starting point for your gauge by hovering over a tick mark until your cursor changes (as shown below) and then rotating the entire scale around.
I strongly encourage anyone who is creating custom controls to share them with the community if your situation allows. Any customizations can be saved and distributed very easily by simply saving your custom control and uploading the .ctl file to this community group. As the group grows and more controls are posted you might be able to just download the design you want rather than creating it from scratch as shown here. You can find all the controls I showed in this tutorial in the attached zip file.
Well, Simon is a Brit. Makes for a good excuse if you get caught speeding... "I don't know what 30 mph is!"
Great job Simon, by the way.
Actually Britain still uses mph. It would be too expensive to change all the road signs to km.
First of all, I want to say thank you very much. I am now looking for a guideline to make my front panel resemble real automobile dashboard. And your help is available. I just a temporary labVIEW learner, so I really like to see your example file, but I only have LabVIEW 8.5. Do you mind saving as file for 8.5 or older verson. If you wouldn't upload on this site, just send to my e-mail address: Esley.Ng@gmail.com.
And I want let you know that your name will be appear in my project (gratitude page) like a contributor. Your tutorial is the key I need to finish my work.
Who's got the Canadian vehicle??