LabView Report
LabView Report
ROLL # 150668
SUBMITTED TO:
Miss. Anum Maqbool
INTRODUCTION TO LABVIEW
The beauty of LabView is its intuitive graphical environment. Creating VI’s is easy
because you can think as if you are making an instrument. In the front panel programming window,
you can envision all the controls that you want on the front panel of your instrument. As you place
them on the front panel, they appear in the block diagram window. Now all you have to do is put
in the logic circuits to execute the commands and wire together your controls and your logic
functions. It has an extensive library of functions for controlling just about any GPIB (general
purpose interface bus) instrument available. This makes controlling and measuring data with the
instruments as easy as plunking down a downloaded VI and providing it with the correct inputs
and outputs.
For these reasons, LabView has become one of the most popular data collection systems
in recent years.Within the framework of LabView, user interfaces can be created, data can be
collected, signals can be generated and transmitted from LabView cards, data can be analyzed and
stored, etc.If LabView does not provide what is needed, C code or MatLab programs can be tied
to it to provide the required functionality.
Benefits
Interfacing to devices:
LabVIEW includes extensive support for interfacing to devices, instruments, camera, and
other devices. Users interface to hardware by either writing direct bus commands (USB, GPIB,
Serial) or using high-level, device-specific, drivers that provide native LabVIEW function nodes
for controlling the device.
National Instruments makes thousands of device drivers available for download on the NI
Instrument Driver Network (IDNet).
Code compiling:
LabVIEW includes a compiler that produces native code for the CPU platform. This aids
performance. The graphical code is translated into executable machine code by interpreting the
syntax and by compiling. 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 compiling time
and provides a consistent interface to various operating systems, graphic systems, hardware
components, etc. The run-time environment makes the code portable across platforms. Generally,
LabVIEW code can be slower than equivalent compiled C code, although the differences often lie
more with program optimization than inherent execution speed
Large libraries:
Many libraries with a large number of functions for data acquisition, signal generation,
mathematics, statistics, signal conditioning, analysis, etc., along with numerous for functions such
as integration, filters, and other specialized abilities usually associated with data capture from
hardware sensors is enormous. In addition, LabVIEW includes a text-based programming
component named MathScript with added functions for signal processing, analysis, and
mathematics. MathScript can be integrated with graphical programming using script nodes and
uses a syntax that is compatible generally with MATLAB.
Parallel programming:
Ecosystem:
Due to the longevity and popularity of the LabVIEW language, and the ability for users to
extend its functions, a large ecosystem of third party add-ons has developed via contributions from
the community. This ecosystem is available on the LabVIEW Tools Network, which is a
marketplace for both free and paid LabVIEW add-ons.
User community:
There is a low-cost LabVIEW Student Edition aimed at educational institutions for learning
purposes. There is also an active community of LabVIEW users who communicate through
several electronic mailing lists (email groups) and Internet forums.
Disadvantage:
LabVIEW is a proprietary product of National Instruments. Unlike common programming
languages such as C or Fortran, LabVIEW is not managed or specified by a third party standards
committee such as American National Standards Institute (ANSI), Institute of Electrical and
Electronics Engineers (IEEE), International Organization for Standardization(ISO), etc.
Slow:
Very small applications still have to start the runtime environment which is a large and
slow task. This tends to restrict LabVIEW to monolithic applications. Examples of this might be
tiny programs to grab a single value from some hardware that can be used in a scripting language
- the overheads of the runtime environment render this approach impractical with LabVIEW.
Non-textual:
G language being non-textual, software tools such as versioning, side-by-side (or diff)
comparison, and version code change tracking cannot be applied in the same manner as for textual
programming languages. There is some additional tool to make comparison and merge of code
with source code control (versioning) like subversion, CVS, Perforce.
No zoom function:
There is no ability to zoom in to (or enlarge) a VI which will be hard to see on a large,
high-resolution monitor, although this feature is under development as of 2016.
Examples
1) Equation:
(A + B) x (A - B)}2-A2
2) Equation :
[(4x2-5)/(x-2)] + [(5y2-x) / {(√8) -(3y)}] + √[(3z-2z)/(4z2)]
Sample Codes
FOR LOOP:-
#include <iostream>
using namespace std; // So the program can see cout and endl
int main()
{
// The loop goes while x < 10, and x increases by one every loop
for ( int x = 0; x < 10; x++ ) {
// Keep in mind that the loop condition checks
// the conditional statement before it loops again.
// consequently, when x equals 10 the loop breaks.
// x is updated before the condition is checked.
cout<< x <<endl;
}
cin.get();
}
WHILE LOOP:-
#include <iostream>
int main()
{
int x = 0; // Don't forget to declare variables