You are on page 1of 20

Department of Electronics and

Communication Engineering
#LabVIEW:
Introduction
Features of LabVIEW
Getting started with LabVIEW

# PCI- 6014 DAQ Card


# Lab Experiments:
1. Digital Storage Oscilloscope
2. PID Controller
3. Robotic Arm
4. Lissajious Pattern
5. Implementation of Boolean Expression
Introduction: -

LabVIEW (Laboratory Virtual Instrumentation Engineering


Workbench) is a platform and development environment for a visual
programming language. The graphical language is named ‘G’. LabVIEW is
commonly used for simulation, data acquisition, instrument control,
measurement analysis, and data presentation.

The programming language used in LabVIEW, called "G", is a


dataflow language. Execution is determined by the structure of a graphical
block diagram (the LV-source code) on which the programmer connects
different function-nodes by drawing wires. These wires propagate variables
and any node can execute as soon as all its input data become available.
Since this might be the case for multiple nodes simultaneously, G is
inherently capable of parallel execution

LabVIEW ties the creation of user interfaces (called front panels) into
the development cycle. LabVIEW programs/subroutines are called virtual
instruments (VIs) because their appearance & operation imitate as physical
instruments. Each VI has three components: a block diagram, a front panel
and a connector pane. The latter may represent the VI as a subVI in block
diagrams of calling VIs. Controls and indicators on the front panel allow 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. Thus a
virtual instrument can either be run as a program, with the front panel
serving as a user interface, or, when dropped as a node onto the block
diagram, the front panel defines the inputs and outputs for the given node
through the connector pane. This implies each VI can be easily tested before
being embedded as a subroutine into a larger program.

Features of LabVIEW:

The graphical approach also allows non-programmers to build


programs by simply dragging and dropping virtual 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.

Programmers with a background in conventional programming often


show a certain reluctance to adopt the LabVIEW dataflow scheme, claiming
that LabVIEW is prone to race conditions. In reality, this stems from a
misunderstanding of the data-flow paradigm. The aforementioned data-flow
(which can be "forced", typically by linking inputs and outputs of nodes)
completely defines the execution sequence, and that can be fully controlled
by the programmer. Thus, the execution sequence of the LabVIEW graphical
syntax is as well-defined as with any textually coded language such as C,
Visual BASIC etc. Furthermore, LabVIEW does not require type definition
of the variables; the wire type is defined by the data-supplying node.
LabVIEW supports Polymorphism in that wires automatically adjust to
various types of data.

Getting Started with LabVIEW Virtual Instruments:

LabVIEW programs are called virtual instruments, or VIs, because


their appearance and operation imitate physical instruments, such as
oscilloscopes and multimeters. LabVIEW contains a comprehensive set of
tools for acquiring, analyzing, displaying, and storing data, as well as tools to
help you troubleshoot your code. In LabVIEW, you build a user interface, or
front panel, with controls and indicators. Controls are knobs, push buttons,
dials, and other input devices. Indicators are graphs, LEDs, and other
displays. After you build the user interface, you add code using VIs and
structures to control the front panel objects. The block diagram contains this
code. Use LabVIEW to communicate with hardware such as data
acquisition, vision, and motion control devices and GPIB, PXI, VXI, RS-
232, and RS-485 instruments.

Building a Virtual Instrument

In the following exercises, you will build a VI that generates a signal


and displays that signal in a graph. When you complete the exercises, the
front panel of the VI will look similar to the front panel shown in the below
figure.
Opening a New VI from a Template

LabVIEW provides templates containing information from which you


can build your VI. These templates help you get started with LabVIEW.
Complete the following steps to create a VI that generates a signal and
displays it on the front panel.

1. Launch LabVIEW.
2. In the LabVIEW dialog box, shown in Figure, click the New button to
display the New dialog box.

3. Select VI from Template»Tutorial (Getting Started)»Generate and


Display in the Create new list. This template VI generates and displays a
signal.

Notice that previews of the template VI appear in the Front panel preview
and the Block Diagram preview sections. Figure below shows the New
dialog box and the Generate and Display template VI.
4. Click the OK button to open the template. You also can double-click the
name of the template VI in the Create new list to open the template.
5. Examine the front panel of the VI.
The user interface, or front panel, appears with a gray background and
includes controls and indicators. The title bar of the front panel indicates that
this window is the front panel for the Generate and Display VI.
Note If the front panel is not visible, you can display the front panel by
selecting Window»Show Front Panel.
6. Examine the block diagram of the VI. The block diagram appears with a
white background and includes VIs and structures that control the front panel
objects. The title bar of the block diagram indicates that this window is the
block diagram for the Generate and Display VI.
Note If the block diagram is not visible, you can display the block diagram
by selecting Window»Show Block Diagram.
7. In the front panel toolbar, click the Run button, shown at left. Notice that
a sine wave appears on the graph.
8. Stop the VI by clicking the STOP button, shown at left, on the front
panel.
Adding a Control to the Front Panel

Controls on the front panel simulate the input devices on a physical


instrument and supply data to the block diagram of the VI. Many physical
instruments have knobs you can turn to change an input value. Complete the
following steps to add a knob control to the front panel.

1. If the Controls palette, shown in Figure below, is not visible on the front
panel, select Window»Show Controls Palette or right-click the front panel
workspace to display it.

2. Move the cursor over the icons on the Controls palette to locate the
Numeric Controls palette. Notice that when you move the cursor over icons
on the Controls palette, the name of that subpalette appears in the gray space
above all the icons on the palette. When you idle the cursor over any icon on
any palette, the full name of the subpalette, control, or indicator appears.

3. Click the Numeric Controls icon to access the Numeric Controls palette.

4. Select the knob control on the Numeric Controls palette and place it on
the front panel to the left of the waveform graph. You will use this knob in a
later exercise to control the amplitude of a signal.

5. Select File»Save As and save this VI as Acquiring a Signal.vi to an easily


accessible location.

Controls Palette:

The Controls palette is available only on the front panel. The


Controls palette contains the controls and indicators you use to create the
front panel. The controls and indicators are located on subpalettes based on
the types of controls and indicators.
Functions Palette

The Functions palette is available only on the block diagram. The


Functions palette contains the VIs and functions you use to build the block
diagram. The VIs and functions are located on subpalettes based on the types
of VIs and functions.Select Window»Show Functions Palette or right-click
the block diagram workspace to display the Functions palette.

Context Help Window:

The Context Help window displays basic information about


LabVIEW objects when you move the cursor over each object. Objects with
context help information include VIs, functions, constants, structures,
palettes, properties, methods, events, and dialog box components. You also
can use the Context Help window to determine exactly where to connect
wires to a VI or function.

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 display that information or move
it to other files or other computers. A VI contains the following three
components:
• Front panel—Serves as the user interface.

• Block diagram—Contains the graphical source code that defines the


functionality of the VI.

• Icon and connector pane—Identifies the VI so that you can use the VI in
another VI. A VI within another VI is called a subVI. A subVI corresponds
to a subroutine in text-based programming languages.
The VI in Figure shows several primary block diagram objects—terminals,
functions, and wires.

Figure: - Example of a Block Diagram and Corresponding Front Panel

Terminals

The terminals represent the data type of the control or indicator. You
can configure front panel controls or indicators to appear as icon or data type
terminals on the block diagram. By default, front panel objects appear as
icon terminals. For example, a knob icon terminal shown at left represents a
knob on the front panel. The DBL at the bottom of the terminal represents a
data type of double-precision, floating-point numeric. A DBL terminal,
shown at left, represents a double-precision, floating-point numeric control
or indicator.

Terminals are entry and exit ports that exchange information between
the front panel and block diagram. Data you enter into the front panel
controls (a and b in Figure) enter the block diagram through the control
terminals. The data then enter the Add and Subtract functions. When the Add
and Subtract functions complete their internal calculations, they produce new
data values. The data flow to the indicator terminals, where they exit the
block diagram, reenter the front panel, and appear in front panel indicators
(a+b and a-b in Figure).
Nodes:
Nodes are objects on the block diagram that have inputs and/or
outputs and perform operations when a VI runs. They are analogous to
statements, operators, functions, and subroutines in text-based programming
languages. The Add and Subtract functions in Figure are nodes.

Wires
You transfer data among block diagram objects through wires. In
Figure, wires connect the control and indicator terminals to the Add and
Subtract functions. Each wire has a single data source, but you can wire it to
many VIs and functions that read the data. Wires are different colors, styles,
and thickness, depending on their data types. A broken wire appears as a
dashed black line with a red X in the middle.

Structures
Structures are graphical representations of the loops and case
statements of text-based programming languages. Use structures on the
block diagram to repeat blocks of code and to execute code conditionally or
in a specific order.
PCI-6014 DAQ CARD:
AIM: Design and testing of Digital Storage Oscilloscope using
LabVIEW for two input channels.

APPARATUS:
1.LabVIEW software
2. DAQ Card
3. Power Supply
4. Function Generator

PROCEDURE:

1.Make the connections as per the connection diagram shown below.

2. Connect the Function Generator output to the PCI- pin slots according to
the diagram given.

3. Create an VI program for Dual Channel Oscilloscope.

4. Run the Program by clicking the => (run) button on the Front Panel.

5. Observe the waveforms displayed on the Front Panel window & store
the following parameters DC voltage, AC voltage, amplitude, frequency.
DAQ CARD

Pins

68 + input
SIGNAL M CH-1 34 - input
PC
67 AI GND
DISPLAY

33 + input
SIGNAL
CH-2 32 - input

66 AI GND
Front Panel of Oscilloscope

Block Diagram of Oscilloscope


AIM: Simulation of PID controller schemes using LabVIEW.

APPARATUS: LabVIEW software.

THEORY: Introduction:
Proportional, Integral, and Derivative controller or PID is a
standard feedback loop component in industrial control applications. It
measures an "output" of a process and controls an "input", with a goal of
maintaining the output at a target value, which is called the "set point". An
example of a PID application is the control of a process temperature,
although it can be used to control any measurable variable, which can be
affected by manipulating some other process variable.
The Controller compares a measured value from a process
(typically and industrial process) is as follows:
The difference (or "error" signal) is then used to calculate a new
value for a manipulatable input to the process that brings the process'
measured value back to its desired set point. Unlike simpler control
algorithm, the PID controller can adjust process outputs based on the history
and rate of change of the error signal, which gives more accurate and stable
control. (It can be shown mathematically that a PID loop will produce
accurate, stable control in cases where a simple proportional control would
either have a steady state error or would cause the process to oscillates).
PID controllers do not require advanced mathematics to design and can be
easily adjusted (or "tuned") to the desired application, unlike more
complicated control algorithms based on optimal control theory.

PROPORTONAL BAND
The control algorithm that generates a linear control output
proportional to deviation is called proportional action. In proportional action
the amount of change in the measured valve (or deviation) is expressed in
percent of span that is required to cause the control output to change from 0
to 100% is called the proportional band.
P= Kp [SP-PV] + P0

INTEGRAL TIME
With P action the measured valve will not necessarily become equal to
the set the point, and a deviation will usually be present. The control
algorithm that applies changes in output as long as a deviation exits, so as to
bring the deviation to zero, is called integral action. When integral action is
used, the parameter that determines how fast the output will change in
correspondence to some amount of deviation is referred to as integral time,
and shorter the integral time, stronger the integral action (the greater the
output rate of change). I action is usually used together with P action as P1
action, and due only to 1 became equal to that due only to P action.
P=1/Ti [SP-PV] + Po

DERIVATIVE TIME:
If the controlled object has a large time constant or dead time, with P
or PI action alone there will be cases where the response will be slow,
overshoot will occur, and the control system will be unstable. In order to
achieve faster response and more stable operation cases one uses derivation
action (D action) to apply an output component proportional to the input
(deviation) rate of change. D action must always be used with P action time
required with PD action. If a ramp input (constant rate of change input) is
applied, for the output due to P action alone to become equal to that due to D
action alone. The longer the derivation time, the stronger the derivation
action.
P=Td d/dt [SP-PV]+Po

This software is organized to explain all the control action available for the
proportional control (P), proportional plus integral control (PI), proportional
plus derivative control (PD) and proportional plus integral plus derivative
control (P+I+D).
Note: Temperature process is generally a very slow process compared to
other process. Usually proportional integral and derivative control is pre-
ferred for temperature control.
a. For ‘P’ Control:
For controlling the ‘P’ Value, keep the ‘I’ and ‘D’ value ‘0’ (zero).
b. For ‘PI’ Control:
For controlling the ‘PI’ value, keep the ‘D’ value as ‘0’ (zero)
c. For ‘PID’ control:
For controlling the ‘PID’ value, SET all the values.
PROCEDURE:
1.Creat an VI program for PID Controller using LabVIEW.

2. Select the Set point

3.As per requirement set the Kp, Ki & Kd values for controlling.

4.Observe the graph & record the observe data.

Front Panel of PID Controller


Block Diagram of PID Controller.
AIM: Design & develop a Robotic Arm having three degree of freedom
For pick and Place operation.

SOFTWARE REQUIRED: LabVIEW.

PROCEDURE:

1.Open the Robotic. VI program from “LabVIEW Experiments” folder.

2. Run the Program by clicking the => (run) button on the Front Panel.

3. Observe the 3-D movement of arm, claw, joints etc separately and
than by combining all.

Fig: Front Panel of Robotic. VI


Fig: Block Diagram of Robotic. VI