Exposure to Labview Environment
Recently i gave lecture on LabVIEW. I observed from the audience that they are not familiar with it or no exposure to it. So i would like to share the basics and insight of LabVIEW environment compared with other simulation software in Engineering fields. There are lot more to learn about labVIEW its advantages. There are plenty of applications for Engineering students at academic level.
Basics of LabVIEW
LabVIEW short for Laboratory Virtual Instrumentation Engineering Workbench is a platform and development environment for a visual programming language from National Instruments. LabVIEW is commonly used for data acquisition and instrument control. The programming language used in LabVIEW, called G, is a dataflow language.
LabVIEW ties the creation of user interfaces (called front panels) into the development cycle. LabVIEW programs subroutines are called Virtual Instruments (VIs). Each VI has three components namely Block diagram, Front panel and Connector pane
The later may represent the VI as a sub VI in block diagrams of calling VIs. Controls and indicators on the front panel allows an operator to input data into or extract data from a running virtual instrument. However, the front panel can also serve as a programmatic interface.
The graphical approach also allows non-programmers to build programs by simply dragging and dropping virtual instrument representations of the lab equipment with which they are already familiar. The LabVIEW programming environment, with the included examples and the documentation, makes it simpler to create small applications, many libraries with a large number of functions for data acquisition, signal generation, mathematics, statistics, signal conditioning, analysis, etc., along with numerous graphical interface elements are provided in several LabVIEW package options.
VIRTUAL INSTRUMENTS
LabVIEW programs are called virtual instruments or VIs, because their appearance and operation imitate physical instruments, such as oscilloscopes and multimeters. Every VI uses functions that manipulate input from the user interface or other sources and displays that information or moves it to other files or other computers.
A VI contains the following three components,
o Front panel
o Block diagram
o Icon and connector pane
The Front panel serves as the user interface. The Icon and the connector pane identify the interface to the VI so that one VI can be used in another VI. In general, a VI within another VI is called a sub VI. A sub VI corresponds to a subroutine in text based programming languages. The Block diagram contains the graphical code of VI used.
When a LabVIEW application is created, it is started at the top-level VI and inputs and outputs for the application are defined. Then a sub VI is constructed to perform the smaller tasks within the top-level VI. This modular approach is one of the strengths of LabVIEW. Hence it is possible to create complicated applications that are hierarchal in nature and reuse common elements within an application. The use of sub VI makes application easy to understand, debug and maintain.
The basic LabVIEW environment elements are the menus at the top of the front panel and block diagram windows, toolbar and free floating palettes like tools palette and controls palette.
The Tools Palette is available on the front panel and block diagram. A tool is a special operating mode of the mouse cursor. The cursor corresponds to the icon of the tool selected in the palette. The tools are used to operate and modify the front panel and block diagram objects. If automatic tool selection is enabled and the cursor is moved over the objects on the front panel or block diagram, LabVIEW automatically selects the corresponding tools from the tools palette. The tools palette can be also be used to modify the contents of the front panel or the block diagram. Each icon on the tools palette changes the behaviour of the cursor on LabVIEW so that operations like positioning, operating and editing tasks on VIs can be performed.
A Front Panel is built by placing controls and indicators from the controls palette. Each palette icon represents a sub palette, which contains control. A control is a front panel object that the user manipulates to interact with the VI.
In terms of performance, LabVIEW includes a compiler that produces native code for the CPU platform. The graphical code is translated into executable machine code by interpreting the syntax and by compilation. The LabVIEW syntax is strictly enforced during the editing process and compiled into the executable machine code when requested to run or upon saving. In the latter case, the executable and the source code are merged into a single file. The executable runs with the help of the LabVIEW run-time engine, which contains some precompiled code to perform common tasks that are defined by the G language. The run-time engine reduces compile time and also provides a consistent interface to various operating systems, graphic systems, hardware components, etc. The LabVIEW Professional Development System allows creating stand-alone executables and the resultant executable can be distributed an unlimited number of times. The run-time engine and its libraries can be provided freely along with the executable.
Simple examples of controls are buttons, slides, dials and text boxes. An indicator is also a front panel object that displays the data to the user. Examples of indicators are graphs, thermometers, gauges. When control or indicator is placed in front panel, the corresponding terminal is automatically created in block diagram.
ADVANTAGES OF LABVIEW
o LabVIEW is a data flow and graphic based language, which is very suitable for designing a man-machine interface.
o The modular structure is one of the biggest advantages of the virtual instrumentation because it offers the possibility of hierarchy on the grades of complexity.
o As a user of LabVIEW one does not have to worry about configuration and control of the components within DAQ boards.
o LabVIEW identifies each board by a device number ant therefore one can have as a many devices as many as the computer can accept on their expansion slots.
o It has also reduced the complicated usage of Programming logic Controls (PLC’s) and other coding languages such as Pascal, C, FORTRAN etc…
One benefit of LabVIEW over other development environments is the extensive support for accessing instrumentation hardware. Drivers and abstraction layers for many different types of instruments and buses are included or are available for inclusion. These present themselves as graphical nodes. The abstraction layers offer standard software interfaces to communicate with hardware devices. The provided driver interfaces save program development time. The sales pitch of National Instruments is, therefore, that even people with limited coding experience can write programs and deploy test solutions in a reduced time frame when compared to more conventional or competing systems.
Another benefit of the LabVIEW environment is the platform independent nature of the G code, which is (with the exception of a few platform-specific functions) portable between the different LabVIEW systems for different operating systems (Windows, MacOSX and Linux) when compared to more conventional or competing systems.
National Instruments is increasingly focusing on the capability of deploying LabVIEW code onto an increasing number of targets including devices like Phar Lap OS based LabVIEW real-time controllers, PocketPCs, PDAs, FieldPoint modules and into FPGAs on special boards.