Example Code

Custom Slider Indicator with Thresholds

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Description

Overview

 

Often specialized applications will require specialized controls and indicators. This simple VI shows a demonstration of how simple it can be to customize controls to suite your needs.

 

Description

 

A custom control which consists of a pointer indicating the value and a background bar representing the range of acceptable values

 

I have implemented this by starting with a Horizontal Pointer Slide (Silver). To add extra Pointers you right click on the Slide bar and click Add Slider. The scale appearance can be changed by right clicking and selecting

Scale » Style.

 

To create a custom control you can right click on the control and go to Advanced » Customise...

 

To change the behaviour of each slider you can right click on the slider and select Fill Options

 

More information can be found here

 

The range and increments of the scale and the colours of the fill and background of the indicator are controlled programmatically with property nodes.

 

Steps to Implement or Execute Code

  1. Unzip Indicator Demo.zip
  2. Open Indicator Demo.lvproj
  3. Open and run Demo Indicator.vi and examine block diagram

 

Requirements

 

Software

LabVIEW 2013

 

Demo Indicator.PNG

Tim, CLD, CTD
National Instruments (UK & Ireland)
________________________________________________
"No problem is insoluble in all conceivable circumstances"

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
tm1308
Member
Member
on

Is there anyway you could provide a screen shot of the Block Diagram. I have a version of labview that is older than the version you are using, so I can't access the vi. If you can provide this I'd appreciate it!

tim.h
NI Employee (retired)
on

Hi, I have added a version for LV2010 does that go back far enough?

Tim, CLD, CTD
National Instruments (UK & Ireland)
________________________________________________
"No problem is insoluble in all conceivable circumstances"
tm1308
Member
Member
on

That goes far enough for the computer I am working on right now, but my commuter in my lab is labview 8.5 (definitely should update soon, but limited on funds). I also wanted to ask you a quick question... My goal is to have a slider or tank with a predefined upper and lower limit range so then the slider has a "goal" region for the notch (movable slider) to go towards. I'm reading voltage measurements from strain gages so I'd like to have the indicator show how close the voltage gets to the "goal" range. I've been thinking about using property nodes to define this region, and thought that this vi would allow me to do this. Do you think this vi shows me in the right direction?

Contributors