Jump to content

Front Panel

From LabVIEW Wiki
Revision as of 19:10, 8 May 2020 by Q (talk | contribs) (Adding Controls or Indicators)

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.

Organization Best Practices

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.

Advanced

Properties

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

Methods

Front panel methods and be accessed via a panel refnum in the VI Server. See Panel Methods.

Minimize a caller VI while a subVI is running.

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:

ShowWindow()

or

AnimateWindow()

The info on making the calls can be found for free at Microsoft at:

http://msdn.microsoft.com/library/default..../ShowWindow.asp

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