Jump to content

Front Panel: Difference between revisions

From LabVIEW Wiki
mNo edit summary
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{underconstruction}}
{{TOCright}}
{{TOCright}}
The '''Front Panel''' of a [[VI]] contains the [[User Interface]] of the VI.  The front panel can be simple with only a few inputs, ([[Controls|controls]]) and outputs ([[Indicators|indicators]]) for a SubVI or complex with many controls, indicators, and decoration for an application interface.  The [[Controls Palette]] or [[Quick Drop]] is used to select the type of control, indicator, or decoration to add to the front panel.  By default the size and position of the front panel will dictate its running size and position
The '''Front Panel''' of a [[VI]] contains the [[User Interface]] of the VI.  The front panel can be simple with only a few inputs, ([[Controls|controls]]) and outputs ([[Indicators|indicators]]) for a SubVI or complex with many controls, indicators, and decoration for an application interface.  The [[Controls Palette]] or [[Quick Drop]] is used to select the type of control, indicator, or decoration to add to the front panel.  By default the size and position of the front panel will dictate its running size and position
Line 6: Line 5:


=== Adding Controls/Indicators ===
=== Adding Controls/Indicators ===
{|
====Via [[Controls Palette]]====
|-
|Via [[Controls Palette]]
# Right-Click on a blank space on the Front Panel  
# Right-Click on a blank space on the Front Panel  
# Navigate through the [[Controls Palette]] to find the desired Control or Indicator
# Navigate through the [[Controls Palette]] to find the desired Control or Indicator
# Click on the Control or Indicator.  A dotted outline of it appears.  
# Click on the Control or Indicator.  A dotted outline of it appears.  
# Click on the Front Panel to place.
# Click on the Front Panel to place.
|- style="text-align:center;"
<gallery mode="slideshow">
|
<gallery mode=nolines widths=50px>
File:Front Panel-Adding a Control.png|Step 1
File:Front Panel-Adding a Control.png|Step 1
File:Front Panel-Adding a Control-Select.png|Step 2
File:Front Panel-Adding a Control-Select.png|Step 2
Line 21: Line 16:
File:Front Panel-Adding a Control-Placed.png|Step 4
File:Front Panel-Adding a Control-Placed.png|Step 4
</gallery>
</gallery>
|-
 
| Via [[Quick Drop]]
====Via [[Quick Drop]]====
# While on the Front Panel, press ''Ctrl-Space''. The Quick Drop Window will appear.  
# While on the Front Panel, press ''Ctrl-Space''. The Quick Drop Window will appear.  
# Type the name (or shortcut) of the Control or Indicator.
# Type the name (or shortcut) of the Control or Indicator.
# Click on Front Panel to place.
# Click on Front Panel to place.
|- style="text-align:center;"
<gallery mode="slideshow">
|
<gallery mode=nolines widths=50px>
File:Front Panel-Adding a Control-Quick Drop.png|Step 1
File:Front Panel-Adding a Control-Quick Drop.png|Step 1
File:Front Panel-Adding a Control-Quick Drop-Select.png|Step 2
File:Front Panel-Adding a Control-Quick Drop-Select.png|Step 2
File:Front Panel-Adding a Control-Quick Drop-Placed.png|Step 3
File:Front Panel-Adding a Control-Quick Drop-Placed.png|Step 3
</gallery>
</gallery>
== Changing Front Panel Color ==
=== During Edit Time ===
During edit time the Front Panel color can be set using the [[Tools Palette]], Set Color tool.
=== Changing Dynamically ===
While the [[VI]] is running, the color can be changed dynamically by using the [[Pane class/Pane Color property]].  This will mean that the [[Pane]]'s reference will be required.  Use the [[Panel class/Panes() property|Panel class/Panes[] property]] to obtain an array of references to all of the panes owned by a Front Panel.  If only one pane exists, there will be only one element in the array.
== Best Practices ==
=== Organization ===
*For simple [[VI|VIs]], it is best practice to place inputs ([[Control|controls]]) on the left side of the front panel and outputs ([[Indicator|indicators]]) on the right side of the front panel in a manner that matches their position on the [[Connector Pane]].
*For complex UIs see the page on [[User Interface|User Interfaces]].
== Tips and tricks ==
=== General ===
* Press '''Ctrl''' and drag to make more space on the front panel (press '''Esc''' to abort).
* Press '''Alt+Ctrl''' and drag to remove space on the front panel (press '''Esc''' to abort).
* Press '''Ctrl''' and drag while using the '''Positioning''' tool to duplicate objects.
* Drag a block diagram constant to the front panel to create a control.
* Drag a front panel control into a control refnum to quickly create a typed reference.
[[Image:Simply creating a control reference.png|center|thumb|300px|Simply creating a control reference]]
* Right-click the application instance name on the status bar to quickly switch between application instances.
[[Image:switching application instances.png|center|thumb|300px|Switching application instances]]
* Press '''Shift''' before moving an object, to restrict the direction to horizontally or vertically, respectively.
* Use the '''arrow''' keys to move selected objects.
** Press '''Shift''' to increase the movement speed.
{| align="center"
| [[Image:Before moving a selection.png|center|thumb|200px|Before moving a selection]]
| [[Image:After moving a selection - shift unused.png|center|thumb|200px|After moving a selection - shift unused]]
| [[Image:After moving a selection while holding down shift.png|center|thumb|200px|After moving a selection while holding down shift]]
|-
|}
|}


=== Organization Best Practices ===
=== Navigation ===
For simple [[VI|VIs]], it is best practice to place inputs ([[Controls|controls]]) on the left side of the front panel and outputs ([[Indicators|indicators]]) on the right side of the front panel in a manner that matches their position on the [[Connector Pane]].
* Scroll on the horizontal scroll bar to scroll left and right.
* Scroll on the vertical scroll bar to scroll up and down.
* Press '''Shift''' while scrolling to scroll faster.
* Select '''Tools > Navigation Window''' to display an overview of the front panel or block diagram.
* Press '''Ctrl+T''' to split the screen between the front panel and block diagram. Press '''Ctrl+Z''' to undo this operation. (It may be convenient to disable this feature under '''Tools > Options > Menu Shortcuts''' because '''Ctrl+T''' and '''Ctrl+R''' are very close on the keyboard.)
 
=== Documentation ===
* Double-click any open space on the front panel to place a [[free label]].
* Use the '''Set Color''' tool to change the background color of free labels.
** Choose the "T" option on the color picker for a transparent color.
* In the [[VI Properties dialog]], select '''Documentation''' to add a link to an external HTML or compiled help file.
* Select '''File > Print''' to print VI documentation into various output formats.
* Use the [[system label]] (formally known as dialog label) from the controls palette, to label elements on the front panel. The background color of this label will automatically adjust to the background color of the owner (it is not transparent).
[[Image:Dialog label example.png|thumb|center|400px|Dialog label example]]


For complex UIs see the page on [[User Interface|User Interfaces]].
=== Connector pane ===
* Always leave some extra unused terminals on the connector pane of a VI to allow for later extensions without breaking existing code.
 
== Resizing Objects ==
* When placing an object, keep dragging to resize it as it is placed.
* When resizing an object, hold '''Ctrl''' to resize from the center.
* When resizing an object, hold '''Shift''' to resize proportionally to its original size.
* Temporarily disable the alignment grid by pressing '''G'''.
** Press '''G''' again to re-enable the alignment grid.
 
== Searching ==
* Select a control and press '''Ctrl+F''' to open the '''Find''' dialog with the selected element as search parameter.
* In the '''Search Results''' dialog, press '''Ctrl+G''' to go to the next match and '''Shift+Ctrl+G''' to go to the previous match.


== Advanced==
== Advanced==
Line 47: Line 97:
Front panel methods and be accessed via a [[Panel refnum data type|panel refnum]] and an [[Invoke Node]] using the [[VI Server]].  See [[Panel class#Methods|Panel Methods]].
Front panel methods and be accessed via a [[Panel refnum data type|panel refnum]] and an [[Invoke Node]] using the [[VI Server]].  See [[Panel class#Methods|Panel Methods]].


== Minimize a caller VI while a subVI is running. ==
== History ==
If you would like to minimize the caller VI, for example if you have a main VI that does essentially nothing while the subVI that it calls is executing, you need to reference your calling VI. So upon calling your subVI the first action would be to open a reference to your calling VI and size its front panel appropriately by using the VI Property Node. Then when exiting the subVI after completing execution you can restore the calling VI's front panel to its original size and close the reference.


Under Windows 98/2000 you can effect the above behavior with a couple of simple calls to the user32.dll API. First you get a handle to the window of the calling VI (or other Window) and then call either:
{| class="wikitable"
 
! Version
ShowWindow()
! Change(s)
 
|-
or
|[[File:LV8-2013.png|frameless|border|64x64px|LabVIEW 2011|link=LabVIEW 2011]]
 
|In [[LabVIEW 2011]] the default background color of the Front Panel was changed to a lighter shade of gray "to complement the appearance of the controls and indicators on both the [[Controls Palette/Modern|Modern]] and [[Controls Palette/Silver|Silver]] palettes."<ref>"LabVIEW 2011 Features and Changes" by [[NI]] (http://zone.ni.com/reference/en-XX/help/371361H-01/lvupgrade/labview_features/)</ref>
AnimateWindow()
|}
 
The info on making the calls can be found for free at Microsoft at:


http://msdn.microsoft.com/library/default..../ShowWindow.asp
== See Also ==
* [[VI]]
* [[Block Diagram]]
* [[Pane]]


or by going to http://msdn.microsoft.com and search on ShowWindow or AnimateWindow.
== References ==


[[Category:User interface]]
[[Category:User interface]]
[[Category:LabVIEW fundamentals]]
[[Category:LabVIEW fundamentals]]
[[Category:VI]]
[[Category:Front Panel]]
[[Category:CLAD]]

Latest revision as of 05:26, 6 June 2020

The Front Panel of a VI contains the User Interface of the VI. The front panel can be simple with only a few inputs, (controls) and outputs (indicators) for a SubVI or complex with many controls, indicators, and decoration for an application interface. The Controls Palette or Quick Drop is used to select the type of control, indicator, or decoration to add to the front panel. By default the size and position of the front panel will dictate its running size and position

Creating a Front Panel

Adding Controls/Indicators

Via Controls Palette

  1. Right-Click on a blank space on the Front Panel
  2. Navigate through the Controls Palette to find the desired Control or Indicator
  3. Click on the Control or Indicator. A dotted outline of it appears.
  4. Click on the Front Panel to place.

Via Quick Drop

  1. While on the Front Panel, press Ctrl-Space. The Quick Drop Window will appear.
  2. Type the name (or shortcut) of the Control or Indicator.
  3. Click on Front Panel to place.

Changing Front Panel Color

During Edit Time

During edit time the Front Panel color can be set using the Tools Palette, Set Color tool.

Changing Dynamically

While the VI is running, the color can be changed dynamically by using the Pane class/Pane Color property. This will mean that the Pane's reference will be required. Use the Panel class/Panes[] property to obtain an array of references to all of the panes owned by a Front Panel. If only one pane exists, there will be only one element in the array.

Best Practices

Organization

  • For simple VIs, it is best practice to place inputs (controls) on the left side of the front panel and outputs (indicators) on the right side of the front panel in a manner that matches their position on the Connector Pane.
  • For complex UIs see the page on User Interfaces.

Tips and tricks

General

  • Press Ctrl and drag to make more space on the front panel (press Esc to abort).
  • Press Alt+Ctrl and drag to remove space on the front panel (press Esc to abort).
  • Press Ctrl and drag while using the Positioning tool to duplicate objects.
  • Drag a block diagram constant to the front panel to create a control.
  • Drag a front panel control into a control refnum to quickly create a typed reference.
Simply creating a control reference
  • Right-click the application instance name on the status bar to quickly switch between application instances.
Switching application instances
  • Press Shift before moving an object, to restrict the direction to horizontally or vertically, respectively.
  • Use the arrow keys to move selected objects.
    • Press Shift to increase the movement speed.
Before moving a selection
After moving a selection - shift unused
After moving a selection while holding down shift

Navigation

  • Scroll on the horizontal scroll bar to scroll left and right.
  • Scroll on the vertical scroll bar to scroll up and down.
  • Press Shift while scrolling to scroll faster.
  • Select Tools > Navigation Window to display an overview of the front panel or block diagram.
  • Press Ctrl+T to split the screen between the front panel and block diagram. Press Ctrl+Z to undo this operation. (It may be convenient to disable this feature under Tools > Options > Menu Shortcuts because Ctrl+T and Ctrl+R are very close on the keyboard.)

Documentation

  • Double-click any open space on the front panel to place a free label.
  • Use the Set Color tool to change the background color of free labels.
    • Choose the "T" option on the color picker for a transparent color.
  • In the VI Properties dialog, select Documentation to add a link to an external HTML or compiled help file.
  • Select File > Print to print VI documentation into various output formats.
  • Use the system label (formally known as dialog label) from the controls palette, to label elements on the front panel. The background color of this label will automatically adjust to the background color of the owner (it is not transparent).
Dialog label example

Connector pane

  • Always leave some extra unused terminals on the connector pane of a VI to allow for later extensions without breaking existing code.

Resizing Objects

  • When placing an object, keep dragging to resize it as it is placed.
  • When resizing an object, hold Ctrl to resize from the center.
  • When resizing an object, hold Shift to resize proportionally to its original size.
  • Temporarily disable the alignment grid by pressing G.
    • Press G again to re-enable the alignment grid.

Searching

  • Select a control and press Ctrl+F to open the Find dialog with the selected element as search parameter.
  • In the Search Results dialog, press Ctrl+G to go to the next match and Shift+Ctrl+G to go to the previous match.

Advanced

Properties

Front panel properties and be accessed via a panel refnum and a Property Node using the VI Server. See Panel Properties.

Methods

Front panel methods and be accessed via a panel refnum and an Invoke Node using the VI Server. See Panel Methods.

History

Version Change(s)
LabVIEW 2011 In LabVIEW 2011 the default background color of the Front Panel was changed to a lighter shade of gray "to complement the appearance of the controls and indicators on both the Modern and Silver palettes."[1]

See Also

References