In the tutorial we will learn some of the basic tips and tricks needed while working with LabView. These tricks will make it easier for you to use LabView, i.e. I will tell you how to do simple moves to arrange and sort blocks in a front panel, also what to do if there is no help key in the menu of a block. As it is just an informative tutorial, you should only keep in mind the points discussed in it and there is no exercise but the implementation of the tricks.
Introduction to front panel in labview
Whenever you open an existing VI in LabView or create a new one, two different windows will pop up. One of them is known as ‘Block diagram window’ and the other is ‘Front panel window’. The programmer is supposed to draw their respective block diagram using both of them as we have discussed, in quite a detail, in all the previous tutorials.
Controls and indicators are all present in the control palette of the front panel. On the other hand a complete block diagram including wires, icons, functions, possibly subVIs (to be discussed in upcoming tutorials), and other LabVIEW objects are all present on the block diagram window. At the upper right corner of the front panel and block diagram windows, there is an icon in every VI, and this icon is nothing but the graphical representation of the VI.
Front panel labview
- Whenever, one opens a new or existing VI, the front panel window as well as the block diagram window of the VI appears. The front panel window, as we have discussed before, is the user interface for the VI. Below is the shown the front panel of a LabView program (VI)
Figure 1: Front panel
- At the very right corner of this panel an icon is visible as we have discussed previously.
Control Palette in labview
- Right click anywhere on the front panel, a dropdown menu will appear. This menu is known as control palette, as shown below.
Figure 2: Control palette
We have already used most of the indicators and controls in this panel in our previous tutorials. Below is the list of all the controls and indicators available on the control palette.
- String and paths
- Array matrix and clusters
- List tables and trees
- Ring and enum
- Variants and classes
Above are only few of all the blocks available in the control palette. We have already used most of them, and the remaining will be used in the upcoming tutorials. Now, let’s come to the main purpose of the tutorial. We are going to discuss some quick and easy tricks of front panel just to clear things up a little about VI’s. Firstly, we will talk about the reorder ability of front panel.
Free labels in labview
- As we have seen previously, that we can add labels to a block. In front panel we can also add free labels besides a block or a Boolean button, or a simple on off switch. Right click on the front panel and at the upper right corner of the control palette there is a search bar as shown in the figure below.
Figure 3: Search bar
- In the search bar type ‘free labels’ and select function and then place a label next to the key and name it properly, as shown in the figure below.
Figure 4: Free labels
- Place 2 free labels for both states (On and off) of the Boolean switch. The resulting block diagram will look like the one shown below.
Figure 5: switch with labels
Grouping ability of elements in labview
When you place a series of blocks connected with each other, or you simply decorate a button or a key with on and off labels (free labels). As we have done in the section above. Now, if we want to move these blocks from one place to the other then we will be required to move every block separately. But using the tip of grouping will save you time. Select all the blocks you want to move by hovering over the blocks, as shown below.
Figure 6: Blocks selection
From the top right corner, click on the reorder button and from the drop down menu select Group, this will group all the selected blocks together and now when you move the blocks they will all move together and save your time.
Locking and unlocking elements in labview
Once you have placed all the components in their desired or expected location, you can restrict their movement by using the lock button in present in the dropdown menu of reorder button, this lock key will not allow you to move the locked blocks in the future unless you unlock them from unlock button, see the figure below.
Figure 7: Locking the blocks
You can unlock the blocks in the future by selecting the locked blocks and pressing the button below the lock button shown in figure 7
Alignment of blocks in labview
- We can also align the blocks in minimum time using the following tips and make our block diagram look elegant. Let’s suppose you place a few blocks on your front panel randomly as shown in the figure below.
Figure 8: Unaligned blocks
- Now if you want to align all the blocks to one side, select all the blocks and from the upper bar select align object and then select align to left or align to right according to the requirement . Refer to the figure below.
Figure 9: steps for alignment
Figure 10: Aligned blocks
- Now, if you want to maintain the space between consecutive blocks from top to bottom, there is also a trick available for this too. Select the blocks to be oriented, from the top bar select distribute objects and then select
Figure 11: Steps to distribute objects
Figure 12: Distributed objects
The tricks discussed in this tutorial are just to improve your programming skills while working with LabView, they are to be considered to do efficient programming in lesser time. All of the tricks cannot be mentioned in one tutorial and there is a lot in LabView to learn about. Try to explore the front panel as well as block diagram and learn more tricks on your own to increase your pro-efficiency with LabView