Front Panel Controls and Indicators
Front Panel Controls and Indicators
Use the front panel controls and indicators located on the Controls palette to build the front
panel.
Use the numeric objects located on the Numeric and Classic Numeric palettes to enter and
display numeric data.
You can set the representation, data range, and format and precision for these numeric
objects. Numeric objects accept only certain numeric characters.
Use the Operating tool to click or drag the slider or needle to a new position.
Use the digital display to enter data just as you do for numeric controls and indicators.
As you change the value, LabVIEW displays the value of the control in a tip strip. If you drag
the slider to a new position and the VI is running during the change, the control passes
intermediate values to the VI, depending on how often the VI reads the control.
You can add more sliders or needles to a slide or rotary control. The data type of a control
with multiple sliders or needles is a cluster that contains each of the numeric values.
You can customize the scale of a slide or rotary control or indicator and the color ramp of a
rotary control or indicator.
Color Boxes
A color box displays a color that corresponds to a specified value. For example, you can use
color boxes to indicate different conditions, such as out-of-range values. The color value is
expressed as a hexadecimal number with the form RRGGBB. The first two digits control the
red color value. The second two digits control the green color value. The last two digits
control the blue color value.
Set the color of the color box by clicking it with the Operating or Coloring tool to display the
color picker.
Color Ramps
A color ramp uses color to display its numeric value. You configure a color ramp that
consists of at least two arbitrary markers, each with a numeric value and a corresponding
display color. As the input value changes, the color displays changes to the color that
corresponds to that value. Color ramps are useful for visually indicating data ranges, such as
a warning range for when a gauge reaches dangerous values. For example, you can use a
color ramp to set the color scale for intensity graphs and charts.
Right-click the color ramp and use the shortcut menu items to customize the appearance and
configure the markers and colors.
You also can add a color ramp to any knob, dial, or gauge on the front panel. Meters have a
visible color ramp by default.
Top
Use the 2D picture control to create, modify, and view graphics in LabVIEW.
Use the 3D picture control to display graphical representations of 3D objects.
Tip You can export data and images from graphs and charts to locations such as
Microsoft Excel. Right-click a graph or chart and select Export from the shortcut
menu to view available export options.
Top
Open example
Find related examples
Radio Buttons With Event Structure VI:
labview\examples\general\controls\booleans.llb
Open example
Mixed Checkboxes
Use a mixed checkbox to display a TRUE, FALSE, or MIXED value. For example, use a
mixed checkbox if you want to display a set of Boolean values in a single indicator, where
that set of Boolean values are either all TRUE, all FALSE, or a combination of TRUE and
FALSE, called MIXED. Use the mixed checkbox as a control to simultaneously change a set
of Boolean values to either a TRUE or FALSE value.
Although the mixed checkbox is an enumerated type control, you can configure the control
similarly to a Boolean control.
Top
Use path controls and indicators to enter or return the location of a file or directory. You also
can drag a path, folder, or file from (Windows) Windows Explorer or (Mac OS X) Finder and
place it in a path control if dropping is enabled during run time.
Path controls and indicators work similarly to string controls and indicators, but LabVIEW
formats the path using the standard syntax for the platform you are using.
Invalid Paths
If a function that returns a path fails, the function returns an invalid path value, <Not A
Path>, in the indicator. Use the <Not A Path> value as the default value for a path control to
detect when the user fails to provide a path and display a file dialog box with options for
selecting a path. Use the File Dialog VI to display a file dialog box.
Empty Paths
An empty path in a path control appears as an empty string on Windows and Mac OS X and
as a slash (/) on Linux. Use empty paths to prompt the user to specify a path. (Windows)
When you wire an empty path to a file input/output (I/O) function, the empty path refers to
the list of drives mapped to the computer. (Mac OS X) The empty path refers to the mounted
volumes. (Linux) The empty path refers to the root directory.
Absolute and Relative Paths
A relative path describes the location of a file or directory relative to an arbitrary location in
the file system. An absolute path describes the location of a file or directory starting from the
top level of the file system. Use relative paths, instead of absolute paths, in VIs to avoid
having to rework the paths if you build an application or run the VI on a different computer.
Tip If you must use an absolute path, ensure that you include code to test that the
path exists and to create the path if it does not exist.
Top
Use the listbox, tree control, and table controls and indicators located on the List, Table &
Tree and Classic List, Table & Tree palettes to give users a list of items from which to
select.
Listboxes
You can configure listboxes to accept single or multiple selections. Use the multicolumn
listbox to display more information about each item, such as the size of the item and the date
it was created.
When you type characters in a listbox at run time, LabVIEW selects the first item in the
listbox that begins with the characters you type. Use the left and right arrow keys to go to the
previous or next items that match the characters you type. Right-click a listbox and select
Selection ModeHighlight Entire Row from the shortcut menu to highlight the entire row
when you select an item.
You can add a symbol next to a list item, such as in the LLB Manager window, where
directories and files have different symbols. You also can insert separator lines between list
items.
You can use a Property Node to modify list items and to gather information about list items,
such as to detect the currently selected items or to set the handling of upper and lowercase
characters when you type characters in a listbox at run time.
Refer to the following VIs for examples of using a listbox:
Open example
Find related examples
Listbox for File Explorer Demo VI: labview\examples\general\controls\listbox1.llb
Open example
Find related examples
Listbox to Select Multiple Waveforms Demo VI:
labview\examples\general\controls\listbox2.llb
Open example
Tree Controls
Use the tree control to give users a hierarchical list of items from which to select. You
organize the items you enter in the tree control into groups of items, or nodes. Click the
expand symbol next to a node to expand it and display all the items in that node.
When you type characters in a tree control at run time, LabVIEW selects the first item in the
tree control that begins with the characters you type. You can change the hierarchy of items
in the tree control by selecting an item and pressing the period (.) key to indent the current
item or the comma (,) key to move the current item to the left. Right-click a tree control and
select Selection ModeHighlight Entire Row from the shortcut menu to highlight the entire
row when you select an item.
You configure items in a tree control the same way you configure them in a listbox. You also
can change the type of symbol that appears next to each node, and you can configure whether
the user can drag and drop items within the tree control.
You can use an Invoke Node to modify items in the tree control and to gather information
about items, such as to detect which items, if any, the user double-clicked. When you add an
item in the tree control, LabVIEW creates a unique tag for the item. You use this tag to
modify items or to gather information about items programmatically. Right-click the tree
control and select Edit Items from the shortcut menu to modify the tags that LabVIEW
creates for each item.
Refer to the Directory Hierarchy in Tree Control VI in the
labview\examples\general\controls\Tree Control Directory.llb for an example of using a tree
control.
Open example
Tables
Use the table control to create a table on the front panel.
Top
Ring Controls
Ring controls are numeric objects that associate numeric values with strings or pictures. Ring
controls appear as pull-down menus that users can cycle through to make selections.
Ring controls are useful for selecting mutually exclusive items, such as trigger modes. For
example, use a ring control for users to select from continuous, single, and external
triggering.
Right-click a ring control and select Edit Items from the shortcut menu to add items to the
ring control list in the control. The order of the items in the Edit Items page of the Ring
Properties dialog box determines the order of the items in the control. You also can
configure the ring control so users can enter numeric values not already associated with any
entries in the list of items defined for the control.
To enter an undefined value in the ring control at run time, click the control, select <Other>
from the shortcut menu, enter a numeric value in the digital display that appears, and press
the <Enter> key. The undefined value appears in the ring control in angle brackets.
LabVIEW does not add the undefined value to the ring control list.
When you configure the list of items for a ring control, you can assign a specific numeric
value to each item. If you do not assign specific numeric values to the items, LabVIEW
assigns sequential values that correspond to the order of the items in the list, starting with a
value of 0 for the first item.
The data type of an enumerated type control includes information about the numeric
values in the control and their corresponding strings. The data type of a ring control is
numeric only.
The numeric representation of the enumerated type control is an 8-, 16-, or 32-bit
unsigned integer, while ring controls can have additional representations. Right-click
either type of control and select Representation from the shortcut menu to change the
representation of the control.
You cannot allow the user to enter undefined values in enumerated type controls, and
you cannot assign specific numeric values to items in enumerated type controls. If you
need this functionality, use a ring control.
You can edit the items of an enumerated type control only at edit time, while you can
edit ring control items at run time using a Property Node.
When you wire an enumerated type control to the selector terminal of a Case
structure, LabVIEW matches the cases to the string values of items in the control, not
the numeric values. When you use a ring control with a Case structure, LabVIEW
matches cases to the numeric values of items.
When you wire an enumerated type control to the selector terminal of a Case
structure, you can right-click the structure and select Add Case for Every Value to
create a case for the string value of each item in the control. However, when you wire
a ring control to the selector terminal of a Case structure, you must manually enter
each case.
All arithmetic functions except Increment and Decrement treat the enumerated type control
the same as an unsigned integer. Increment changes the last enumerated value to the first
value, and Decrement changes the first enumerated value to the last value. When coercing a
signed integer to an enumerated type, negative numbers change to equal the first enumerated
value, and out-of-range positive numbers change to equal the last enumerated value. Out-ofrange unsigned integers always change to equal the last enumerated value.
If you wire a floating-point value to an enumerated type indicator, LabVIEW coerces the
floating-point value to the closest numeric value in the enumerated type indicator. LabVIEW
handles out-of-range numbers as previously described. If you wire an enumerated control to
any numeric value, LabVIEW coerces the enumerated type value to a numeric value. To wire
an enumerated type control to an enumerated type indicator, the items in the indicator must
match the items in the control. However, the indicator can have more items than the control.
Tip When using enumerated type controls, always make a type definition of the
control. Creating type definitions prevents you from needing to rewrite the code each
time you add or remove an item from an enumerated type control.
Top
Container Controls
Use the container controls located on the Containers and Classic Containers palettes to
group controls and indicators or to display the front panel of another VI on the front panel of
the current VI. (Windows) You also can use container controls to display .NET and ActiveX
objects on the front panel.
Tab Controls
Use tab controls to overlap front panel controls and indicators in a smaller area. A tab control
consists of pages and tabs. Place front panel objects on each page of a tab control and use the
tab as the selector for displaying different pages.
Tab controls are useful when you have several front panel objects that are used together or
during a specific phase of operation. For example, you might have a VI that requires the user
to first configure several settings before a test can start, then allows the user to modify
aspects of the test as it progresses, and finally allows the user to display and store only
pertinent data.
On the block diagram, the tab control is an enumerated type control. Terminals for controls
and indicators placed on the tab control appear as any other block diagram terminal.
Subpanel Controls
Use the subpanel control to display the front panel of another VI on the front panel of the
current VI. For example, you can use a subpanel control to design a user interface that
behaves like a wizard. Place the Back and Next buttons on the front panel of the top-level VI
and use a subpanel control to load different front panels for each step of the wizard.
When you place a subpanel control on the front panel, LabVIEW does not create a terminal
for the control on the block diagram. Instead, LabVIEW creates an Invoke Node on the block
diagram with the Insert VI method selected. To load a VI in the subpanel control, wire a
reference to that VI to the Invoke Node.
Note Because the subpanel control does not have a terminal, you cannot create an
array of subpanel controls, and you cannot create a type definition of a subpanel
control. You can place a subpanel control in a cluster to group the subpanel control
with other controls, but the cluster cannot contain only a subpanel control or controls.
If the front panel of the VI you want to load is open or if you loaded the front panel in
another subpanel control on the same front panel, LabVIEW returns an error, and you cannot
load the front panel in the subpanel control unless the front panel is reentrant. You also
cannot load the front panel of a VI in a remote application instance, and you cannot load front
panels recursively.
If you load a VI that is not running, the VI in the subpanel control loads in edit mode.
LabVIEW displays only the visible area of the front panel of the VI you load in the subpanel
control. After you stop running the VI that contains the subpanel control, LabVIEW clears
the front panel in the subpanel control. You also can use the Remove VI method to unload the
VI in the subpanel control.
Refer to the labview\examples\general\controls\subpanel.llb for examples of using subpanel
controls.
Open example
Top
LabVIEW Object
The LabVIEW Object is the common ancestor data type for all LabVIEW classes. You can
use the LabVIEW Object to create generic methods that can handle all LabVIEW class data
types.
Top
(Mac OS X and Linux) Use the configuration utilities for the instrument to configure VISA
resource names and IVI logical names. Refer to the documentation for the instrument for
more information about the configuration utilities.
The IMAQ session control is a unique identifier that represents the connection to the
hardware.
Waveform Control
Use the waveform control to manipulate individual data elements of a waveform. The
waveform control carries the data, start time, and delta t of a waveform.
Digital Tables
The digital data control and digital waveform control contain data in digital tables. A digital
table can represent data in eight digital data states. The following table describes the digital
data states.
Value
0
1
2
3
4
5
Digital Data
State
0 (Drive Low)
1 (Drive High)
Z (Force Off)
L (Compare
Low)
H (Compare
High)
X (Compare
Unknown)
T (Compare
Off)
V (Compare
Valid)
Description
Forces logic low. Drives to the low voltage level (VOL).
Forces logic high. Drives to the high voltage level (VOH).
Forces logic high impedance. Turns the driver off.
Compares logic low (edge). Compares a voltage level lower than the
low voltage threshold.
Compares logic high (edge). Compares a voltage level higher than
the high voltage threshold.
Compares logic unknown. Does not compare.
Compares logic high impedance (edge). Compares a voltage level
between the low voltage threshold (VOL) and the high voltage
threshold (VOH).
Compares logic valid level (edge). Compares a voltage level either
lower than the low voltage threshold (VOL) or higher than the high
voltage threshold (VOH).
Note You can use the Build Digital Data function to build a digital table.
Compressing Digital Data
You can compress the data in a digital table. Compress digital data when you want to display
two or more serial digital signals with the same bit sets on the same row to better visualize
the data. For example, if you acquire 10 digital waveform samples and nine waveforms are
identical but the tenth waveform differs, compressing the digital data helps you easily find
which waveform is different. Compressing digital data also conserves memory resources.
The following illustration shows two digital data tables, each displaying the same data. The
first table shows uncompressed digital data. The second table shows the same digital data
after compression.
You can use the Digital Waveform VIs and functions to compress, uncompress, and
otherwise manipulate digital data and digital waveforms.
Top
Use the reference number controls located on the Refnum and Classic Refnum palettes to
work with files, directories, devices, and network connections. Use the control refnum to pass
front panel object information to subVIs.
A reference number, or refnum, is a unique identifier for an object, such as a file, device, or
network connection. When you open a file, device, or network connection, LabVIEW creates
a refnum associated with that file, device, or network connection. All operations you perform
on open files, devices, or network connections use the refnums to identify each object. Use a
refnum control to pass a refnum into or out of a VI. For example, use a refnum control to
modify the contents of the file that a refnum is referencing without closing and reopening the
file.
Because a refnum is a temporary pointer to an open object, it is valid only for the period
during which the object is open. If you close the object, LabVIEW disassociates the refnum
from the object, and the refnum becomes obsolete. If you open the object again, LabVIEW
creates a new refnum that is different from the first refnum. LabVIEW allocates memory for
an object that is associated with a refnum. Close the refnum to release the object from
memory.
LabVIEW remembers information associated with each refnum, such as the current location
for reading from or writing to the object and the degree of user access, so you can perform
concurrent but independent operations on a single object. If a VI opens an object multiple
times, each open operation returns a different refnum. LabVIEW automatically closes
refnums for you when a VI finishes running, but it is a good programming practice to close
refnums as soon as you are finished with them to most efficiently use memory and other
resources. Close refnums in the opposite order that you opened them. For example, if you
obtain a refnum to object A and invoke a method on object A to obtain a refnum to object B,
close the refnum to object B first and then close the refnum to object A.
If you open a refnum inside a For Loop or While Loop, close that refnum for each iteration of
the loop because LabVIEW repeatedly allocates memory for the refnum and does not free the
memory until the VI finishes running.
Top