Contents
3.1 Virtual Instrumentation ..................................................................................................................... 1
3.1.1 What is virtual Instrument ..........................................................................................................2
3.1.2 Difference between Traditional Instruments and Virtual Instruments .......................................2
3.1.3 Graphical programming ............................................................................................................. 3
3.1.4 Advantages ................................................................................................................................. 4
3.1.5 Functions .................................................................................................................................... 4
3.1.6 Application ................................................................................................................................. 4
3.1.7 Questions ....................................................................................................................................5
3.2 LabVIEW .......................................................................................................................................... 5
3.2.1 Components of LabVIEW ..........................................................................................................6
3.2.1.1 FRONT PANEL .................................................................................................................. 7
3.2.1.2 Block Diagram .................................................................................................................... 7
3.2.1.3 Icon ......................................................................................................................................9
3.2.3 FOR LOOP AND WHILE LOOP ......................................................................................................9
3.2.3.1 While Loop Structure: .........................................................................................................9
3.2.3.2 For loop structure ................................................................................................................9
3.2.4 Graphs and charts .................................................................................................................... 10
3.2.4.1 Modes of Charts ................................................................................................................ 10
3.2.5 Sequence Structure .................................................................................................................. 11
3.2.6 Case structure .......................................................................................................................... 12
3.2.7 Questions ..................................................................................................................................13
3.1 Virtual Instrumentation
Traditional hardware instrumentation systems are made up of pre-defined hardware components (hard
wired), such as digital multimeters and oscilloscopes that are completely specific to their stimulus,
analysis, or measurement function. Because of their hard-coded function, these systems are more
limited in their versatility than virtual instrumentation systems. The primary difference between
hardware instrumentation and virtual instrumentation is that software is used to replace a large
amount of hardware. Conventional electronic instrument are hard wired. Ex: CRO, multimeter,
spectrum analyzer.
Different instrument for different measurement were used comprising of signal conditioning circuit,
output displayed on panel or record data. Computers in field of instrumentation enable the display of
measurement data on virtual instrument panel: front panel. The panel has display as well as control
buttons (soft control buttons) for operation control & change settings.
Typical instruments are box shaped having front panel to display and control.
3.1.1 What is virtual Instrument
Virtual Instrumentation is the use of customizable software and modular measurement
hardware to create user-defined measurement systems, called virtual instruments. It can be
defined as computer software that a user would employ to develop a computerized test and
measurement system.
Virtual instruments are the device which are configured from independent hardware
components by using appropriate software & performs custom instrumentation function
Virtual Instrumentation
Computer software
Computerized test measurement systems
A synthetic instrument is a kind of virtual instrument that is purely software defined. A synthetic
instrument performs a specific synthesis, analysis, or measurement function on completely generic,
measurement agnostic hardware. Virtual instruments can still have measurement specific hardware,
and tend to emphasize modular hardware approaches that facilitate this specificity. Hardware
supporting synthetic instruments is by definition not specific to the measurement, nor is it necessarily
(or usually) modular.
3.1.2 Difference between Traditional Instruments and Virtual Instruments
3.1.3 Graphical programming
Old applications were written in textual based programming languages such as C, PASCAL,
BASIC. Results in program source code of big size, difficult to modify and understand by
other programmers, unreadable by non-programmers. Graphical programming methods
provide user with a graphical environment to use the instrument easily. Graphical
programming languages provide a different method of coding. Instead of the high level
statements in procedural languages, like C and Object-Oriented languages like C++ or Java,
graphical languages are coded by selecting objects, connecting them, and adding
functionality. Visual blocks connections are used to code instead of texts making it easy for
non coders to implement algorithms.
3.1.4 Advantages
Measurement system has the following advantages:
Modular design and graphical blocks makes easy to understand code & functionality
Possible to measure large number of points and different places.
Complex processing of data and measurement information
Local or remote data storing
Remote transmission of data through wired or wireless media.
Statistics and forecast accomplishment
Flexible: possibility of extension or adding new functions to the instrument by simple
modification of software.
Possibility of adding new functions for process testing.
3.1.5 Functions
Monitoring of the process & operation in industry
Design testing and measurement
Indicating the function
3.1.6 Application
Monitoring of the process & operation in industry
Design testing and measurement in process control industry
Data acquisition with GUI and data connectivity
Robotics control
Simulation and test of mathematical modeling
3.1.7 Questions+
Five Marks Question:
Differentiate between virtual instrument and traditional instruments?+
Differentiate between graphical programming and text-based programming.
Ten Marks Question:
Explain block diagram of virtual instrument
3.2 LabVIEW
What is LabVIEW: Software+ hardware
LabVIEW is a graphical programming environment engineers use to develop automated research,
validation, and production test systems. LabVIEW (Laboratory Virtual Instrument Engineering
Workbench) is the first implementation of graphical programming. It provides
a powerful and integrated environment for the development of various instrumental
applications. An efficient LabVIEW application is designed without unnecessary
operations, with minimal occupation including code, data, block diagram, front
panel, and GUI updates. It is an instrumental software system and a competitive analysis tool
used for measurement and automation. The tool is utilized by using a programming language
named “G” (Graphical programming language). Using the graphical programming language
eliminates the use of text-based/syntax-based coding practice. It eliminates human errors in
data collection and process operations. It reduces data transcription errors and more
reliable data available makes better quality control of products and new discoveries.
LabVIEW programs are also called virtual instruments (VIs), because their
appearance and operation imitate physical instruments. It contains a comprehensive
set of VIs and functions for acquiring, analyzing, displaying, and storing data, as
well as tools to help you troubleshoot your code. It also has built-in features for
connecting user’s applications to the Web using the LabVIEW Web Server. It is used
to manage large and professional applications and also integrated project
management tools, integrated graphical debugging tools, and standardized source
code control integration. LabVIEW provides the tools required for most applications
and is also an open development environment.
Graphical user interface of LabVIEW
Block diagram: programming logic and data flow in LabVIEW
3.2.1 Components of LabVIEW
In this section, we will try to understand the components that are available within a virtual
instrument. The LabVIEW program consists of single or multiple virtual instruments, which are
commonly abbreviated as (VI’s). It is pronounced as “Vee's eye”.
A virtual instrument (VI) has three main components, they are :
Front panel
Block diagram
Icon
3.2.1.1 FRONT PANEL
A front panel is nothing but an interactive interface for the user. It displays the entire panel where
the users will be able to select different options and execute the process. Further, the front panel
has push buttons, graphs, knobs, indicators, and other options. The data can be keyed in by using
a mouse or keyboard. The results can be viewed on the screen.
Controls and Indicators: The controls simulate the input devices and supply the data to the block
diagram of the VI. The common controls are knobs, pushbuttons, dials, and other input devices.
The indicators Simulate output devices and display data that is acquired or generated by the block
diagram. The common indicators are graphs, Light Emitting Diodes(LEDs), meters, and other
output devices.
While creating a new program, the user will have to decide the inputs and outputs which will be
available. Then, place the cursor on the gray area in the front panel and right-click. A new
window will appear, i.e. Control window will popup known as control palette.
Front panel with control palette
3.2.1.2 Block Diagram
This is the second component within the Virtual Instrument. This is an important area where the
underlying code goes into the program. Using the inputs and outputs, the program is created
graphically. The users will be able to select “objects” from the functions window.
A block diagram is nothing but VI’s source code. It is actually programmed using
LabVIEW’s programming language, i.e. “G”. It is the actual executable program. The
block diagram’s components are lower-level VI’s, constants, program executable control
structures, built-in functions available in function palette.
The user will be able to draw wires and connect with the objects and define the data flow.
For example, the below screenshot displays a block diagram
Block diagram with function palette
Tool Palette
A tool is a special operating mode of the mouse cursor. The cursor corresponds
to the icon of the tool selected in the Tools palette.
Using Tool Palette users can create, modify and debug Virtual Instruments.
The tool palette is available on both the front panel and the Block Diagram.
Different tools available are as follows :
Operating tool button: For text selection or for changing the values of controls.
Positioning Tool: For resizing, selecting, and positioning.
Labelling Tool: For free labels and editing text.
Object shortcut Menu Tool: For opening the shortcut menu of an object.
Controls Palette:
The Controls Palette is available only on the Front panel.
It consists of various controls and indicators which are required by the user
while building the front panel.
FUNCTION PALETTE
It is available only on the Block Diagram and is used to build Block Diagram.
Different function palettes include :
Numeric
Array
Time and Dialog
Waveform
3.2.1.3 Icon
The next important component the user has to understand is “icon”.
This component is essential for the users to use a VI as a subroutine in another block
diagram of another VI. For this to happen, it needs an “icon”. A VI that is in the above
case is called as “Sub VI”.
The below picture depicts an icon where few inputs are connected to an icon which in
return can be connected to another new level, i.e., another VI in this case.
3.2.3 FOR LOOP AND WHILE LOOP
3.2.3.1 While Loop Structure:
The while loop structure is on execution/operational mode until and unless a stop
condition is achieved.
The while loop structure runs in the background until and unless the user has clicked on a
STOP button.
Let’s understand this structure in detail by considering an example, i.e., while loop structure
will be stopped after reaching a value which is equal to 50
– Have Iteration Terminal
– Always Run at least Once
– Run According to Conditional Terminal
3.2.3.2 For loop structure
A for loop structure is defined as a program that is executed for a designated number of
times. For example, if the For loop structure is set to ‘15’ then the program will be
executed for 15 times.
The following block diagram shows the set up for loop structure.
Create constant so that the input can be provided to N
Create an indicator for output of i.
Create a “wait timer” within the while loop.
The below diagram shows the variables that we have created (i.e. Constant as N, output
variable as “i”)
– Have Iteration Terminal
– Run According to input N of Count Terminal
3.2.4 Graphs and charts
Graphs and charts are one of the most essential tools to represent data, and they are making trends
in different aspects. They are widely used in various sectors to convey the information visually
and to make sense of data. A chart is a graphical representation of data in symbols
whereas graphs portray the relationship between different data in less space.
Difference between Waveform Graphs and Waveform Charts
Waveform Graphs Waveform Charts
The waveform graph shows one or more plots of
The chart displays one or more plots of data that
even measurements.
contains a constant value.
It plots only single-valued function with points
It displays the plot that includes any number of
that are evenly distributed along the x-axis.
points in it.
Waveform graphs are good at outside of the
Waveform charts are good to use inside the loop.
Loop.
3.2.4.1 Modes of Charts
Strip chart
It is a default mode which displays data scrolling from left to right continuously. Here the old
data is shown on the left and new one on the right side.
Scope chart
This mode of the chart is similar to the function of the oscilloscope in which the sport runs from
the left side of the window to right. The image gets cleared and the spot appears on the left when
it reaches the right end.
Sweep chart
In sweep chart mode the data is overwritten as you see in the ECG image. New data appears on
the left which is separated from the right by a red vertical line.
Modes of chart
3.2.5 Sequence Structure
A sequence of a structure is used especially when the program needs to be executed in a
linear process (especially in sequential order).
Within LabVIEW, it is quite hard to take control of the execution order. If a calculation is
happening in a linear fashion, i.e., the next calculation is actually dependant on the
current input, then the process will be executed in sequential order.
But, if the calculations are happening in parallel, it gets complex and the process cannot
be managed in a sequential structure. So, most of the calculations are actually forced to
take up a sequential structure approach.
Let’s see the same below in the form diagram:
An example of flat sequence
As per the graphical representation, in order to have the calculation completed, we need to have
the values available for the variable “x” and variable “y”. Once the system has both the values,
then as per the sequence, the addition calculation will be executed and the output is displayed.
Within Sequence structure, we have two different subtypes available, and they are:
Flat sequence structure
In a flat sequence structure, all the frames are available in the block diagram. If there are a lot of
frames, then the structure may take a considerable amount of space.
Stacked sequence structure
In a stacked sequence structure, all the frames are in sequential order, but they are stacked on top
of each other like a case structure.
3.2.6 Case structure
Case structures are widely used in the scenarios where the program or the users have to take a
decision. The decision is categorized into two options, i.e. True or False.
At any point of execution, only one condition (or case, i.e. True or False) will be executed.
The case structure functionality is explained with a block diagram below:
Firstly, draw the cases so that it has a true value and also a false value.
This can be selected from the main menu of case structure within LabVIEW.
Within this explanation, we will be calculating the log value and we want the case
structure to monitor only for positive values.
The true condition block diagram is shown below where the user will have an option to
enter a value in ‘X’ from the front end of LabVIEW ( which can be seen on the left-hand
side of the block diagram).
False condition case block diagram is shown below:
Execute the above program in LabVIEW by entering a positive value from the front end of
LabVIEW and after that, enter a negative value from the front end of the LabVIEW. In this case,
the result of a true condition case structure is displayed in the front panel of LabVIEW
3.2.7 Questions
Two Marks Question:
What are the components of LabVIEW?
What is difference between for loop and while loop?
Five Marks Question:
Differentiate between Graph and charts?
Write short note on sequence and case structure.
Ten Marks Question:
Explain in detail the components of LabVIEW. What are different data types in
LabVIEW.