0% found this document useful (0 votes)
670 views41 pages

labVIEW Lab Manual

The document describes an experiment in LabVIEW that aims to apply logical and Boolean operations. It discusses Boolean controls and functions like AND, OR, NOT, etc. The experiment involves implementing Boolean logic gates in LabVIEW including AND, OR, XOR, and converting between Boolean and numeric data types.

Uploaded by

vertika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
670 views41 pages

labVIEW Lab Manual

The document describes an experiment in LabVIEW that aims to apply logical and Boolean operations. It discusses Boolean controls and functions like AND, OR, NOT, etc. The experiment involves implementing Boolean logic gates in LabVIEW including AND, OR, XOR, and converting between Boolean and numeric data types.

Uploaded by

vertika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

EXPERIMENT 1

AIM: Introduction to LabVIEW environment and numeric control.

THEORY:

• LabVIEW SOFTWARE-LabVIEW (Laboratory Virtual Instrument Engineering


Workbench) is a graphical programming environment which has become prevalent
throughout research labs, academia and industry. It is a powerful and versatile analysis and
instrumentation software system for measurement and automation. Its graphical programming
language called G programming is performed using a graphical block diagram that compiles
into machine code and eliminates a lot of the syntactical details. LabVIEW offers more
flexibility than standard laboratory instruments because it is software based
• FRONT PANEL-The front panel is the interactive user interface for the VI. It is named a
front panel because it stimulates the front panel of a physical instrument.
One of the most powerful features that LabVIEW offers engineers and scientists is its
graphical programming environment to design custom virtual instruments by creating a
graphical user interface on the computer screen are- Operate the instrumentation program ,
Control selected hardware ,Analyze acquired data , Display results.
The front panel can include knobs, push buttons, graphs and various other controls (which are
user inputs) and indicators (which are program outputs).

• BLOCK DIAGRAM WINDOW- The block diagrams accompany the program for the front
panel. Front panel objects appear as terminals on the block diagram and the components
wired together. After the front panel is built, codes are added using graphical representations
of functions in the block diagram to control the front panel objects. The block diagram
contains the graphical source code composed of nodes, terminals, and wires.

• TOOL PALETTE- Tool palette is available on both the front panel and the block diagram.
We can create, modify, and debug VIs using the tools located on the floating Tools palette.
These tools are used to modify and program/design front panel and block diagram window
according to the task to be performed.

1
Fig. 1.1

• CONTROL PALETTE- The Controls palette is available only on the front panel. The
Controls palette contains the controls and indicators which you can use to create the front
panel. The Controls palette can be accessed from the front panel by selecting View»Controls
Palette or by right-clicking an open space on the front panel window to display the Controls
palette. The Controls palettes contain subpalettes of objects which you can use to create a VI.
When you click a subpalette icon, the entire palette changes to the subpalette you selected. To
use an object on the palettes, click the object and place it on the front panel.

Fig. 1.2
• FUNCTION PALETTE- The Functions palette contains the sub VIs, functions, and
constants that are available only on the block diagram. It can be access from the block
diagram by selecting View»FunctionsPaletteThe VIs and functions located on the Functions
palette depend on the palette view currently selected. The VIs and functions are located on
subpalettes based on the types of VIs and functions.

2
Fig.1.3

• FRONT PANEL CONTROLS AND INDICATORS-We can build the front panel with
controls and indicators, which are the interactive input and output terminals of the VI,
respectively. Controls are knobs, push buttons, dials and other input devices. Indicators are
graphs, LEDs and other displays. Controls simulate instrument input devices and supply data
to the block diagram of the VI. Indicators simulate instrument output devices and display data
the block diagram acquires or generates.

• BLOCK DIAGRAM-Block diagram objects include terminals, subVIs, functions, constants,


structures and wires to transfer data among other block diagram objects.

TERMINALS: Terminals are entry and exit ports that exchange information between the
front panel and block diagram. Terminals are analogous to parameters and constants in text-
based programming languages. Types of terminals include control or indicator terminals and
node terminals. Control and indicator terminals belong to front panel controls and indicators.

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. Nodes can be functions, subVIs or

3
structures. Structures are process control elements, such as Case structures, For loops, or
While loops. The Add and Subtract functions in the previous figure are function nodes.

FUNCTIONS: Functions are the fundamental operating elements of LabVIEW. Functions do


not have front panels or block diagrams but do have connector panes. Double-clicking a
function only selects the function. A function has a pale yellow background on its icon.

SUBVIs: SubVIs are VIs that you build to use inside of another VI or that you access on the
Functions palette. Any VI has the potential to be used as a subVI. When you double-click a
subVI on the block diagram, its front panel and block diagram appear.

WIRES: 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 thicknesses, depending on their data
types. A broken wire appears as a dashed black line with a red X in the middle Broken wires
occur for a variety of reasons, such as when you try to wire two objects with incompatible
data types.

NUMERIC CONTROL: numeric control in LabVIEW is one of the functions in function palette
which is used to perform arithmetic/numeric operations. It contain many functions like addition,
subtraction, divide, square and many other as shown in figure below:

Fig 1.4 Numeric Functions

4
EXERCISE 1

1. Z = X+Y

Fig.1.5

2.

Fig.1.6

5
3.

Fig.1.7

4.

Fig 1.8

6
Exercise 2. Draw a VI for gauge meter.

Fig: 1.9

Exercise 3 Implement a Virtual Instrument for conversion of temperature from Celsius to Fahrenheit

Celsius to Fahrenheit: (°C × 9/5) +32 = °F

Conclusion: The given experiment has been performed.

7
EXPERIMENT 2

AIM: Application of logical and Boolean operations in Lab VIEW.

APPARATUS REQUIRED: Computer system, LabVIEW Software

THEORY:

BOOLEAN CONTROL: Boolean is function from function palette which has functions like AND,
OR, NOT, etc. as shown in the given figure.

Booleans have only two possible values: True or False and are indicated by green data wires.

Fig 2.1

8
Palette
Description
Object
Computes the logical AND of the inputs. Both inputs must be Boolean values,
And numeric values, or error clusters. If both inputs are TRUE, the function returns
TRUE. Otherwise, it returns FALSE.
Returns TRUE if all the elements in Boolean array are TRUE or if Boolean
And Array array is empty. Otherwise, the function returns FALSE. This function accepts
Elements an array of any size but returns only a single value based on all values in
Boolean array.
Boolean Converts a Boolean array to an integer or a fixed-point number by
Array To interpreting the array as the binary representation of the number. The first
Number element of the array corresponds to the least significant bit in the number.
Boolean To Converts a Boolean FALSE or TRUE value to a 16-bit integer with a value of
(0,1) 0 or 1, respectively.
Performs arithmetic on one or more numeric, array, cluster, or Boolean inputs.
To select the operation (Add, Multiply, AND, OR, or XOR), right-click the
Compound
function and select Change Mode from the shortcut menu. When you select
Arithmetic
this function from the Numeric palette, the default mode is Add. When you
select this function from the Boolean palette, the default mode is OR.
Computes the logical exclusive or (XOR) of the inputs. Both inputs must be
Boolean values, numeric values, or error clusters. If both inputs are TRUE or
Exclusive Or
both inputs are FALSE, the function returns FALSE. Otherwise, it returns
TRUE.
False
Use this constant to provide a value of FALSE to the block diagram.
Constant
Negates x and then computes the logical OR of y and the negated x. Both
Implies inputs must be Boolean values, numeric values, or error clusters. If x is TRUE
and y is FALSE, the function returns FALSE. Otherwise, it returns TRUE.
Computes the logical negation of the input. If x is FALSE, the function returns
Not
TRUE. If x is TRUE, the function returns FALSE.
Computes the logical NAND of the inputs. Both inputs must be Boolean
Not And values, numeric values, or error clusters. If both inputs are TRUE, the function
returns FALSE. Otherwise, it returns TRUE.
Computes the logical negation of the logical exclusive or (XOR) of the inputs.
Not Exclusive Both inputs must be Boolean values, numeric values, or error clusters. If both
Or inputs are TRUE or both inputs are FALSE, the function returns TRUE.
Otherwise, it returns FALSE.
Computes the logical NOR of the inputs. Both inputs must be Boolean values,
Not Or numeric values, or error clusters. If both inputs are FALSE, the function
returns TRUE. Otherwise, it returns FALSE.
Converts an integer or fixed-point number to a Boolean array. If you wire an
integer to number, Boolean array returns an array of 8, 16, 32, or 64
Number to elements, depending on the number of bits in the integer. If you wire a fixed-
Boolean point number to number, the size of the array that Boolean array returns
Array equals the word length of the fixed-point number. The 0th element of the array
corresponds to the least significant bit of the two's complement representation
of the integer.
Computes the logical OR of the inputs. Both inputs must be Boolean values,
Or numeric values, or error clusters. If both inputs are FALSE, the function
returns FALSE. Otherwise, it returns TRUE.

9
Exercise 1. Design a VI for finding if the number is even or odd.

Fig 2.1

Exercise 2. Draw a VI to generate waveform

10
Fig 2.2

Exercise 3. Draw a VI for 1x4 DEMUX

Fig 2.3

11
Exercise 6. Draw a VI for 4x1 MUX

Fig 2.4

Conclusion: The given experiment has been performed.

12
EXPERIMENT 3

AIM: Introduction and implementation of string functions.

APPARATUS REQUIRED: computer system, Lab VIEW software.

THEORY:

Strings: A string is a sequence of displayable or non-displayable ASCII characters. Controlling


instruments by sending texts commands to the instrument and returning data values in the form of
either ASCII or binary string, which you then convert to numeric values. Storing numeric data to
disk.
Concatenated string contains the concatenated input strings in the order you wire them to the node
from top to bottom.

Result string contains the input string with one or all occurrences of search string replaced with
replace string. If replace string is empty, result string contains input string with search string deleted.

String Functions:

Fig 3.1

13
EXERCISE 1

Fig 3.2

EXERCISE 2. Design a VI to display your name and perform the following operation on strings-

a. Calculate length of the string.


b. Replace surname by your name.
c. Combine string with full string “My branch is EIE”.
d. Insert name before surname.

14
Fig: Block Diagram

15
Fig: 3.3

16
EXPERIMENT 4

AIM: Introduction and Implementation of sub VI.

APPARATUS REQUIRED: Computer system, LabVIEW-9.

THEORY:

Sub VI

Within LabVIEW, program modularity means creating smaller sections of code known as subVIs.
SubVIs are the same as VIs. They contain front panels and block diagrams, but you call them from
within a VI. A subVI is similar to a subroutine in text-based programming languages.

When subVI is created and when it is used, an icon within block diagram that represents the subVI.

With the help of subVIs we can:

• Customize the icon for the subVI


• Configure the terminals
• Use it within another VIs repeatedly

Fig. Icon of sub VI

17
EXERCISE:

1. Design a VI for 1 bit adder.

Fig 4.1 1 BIT FULL ADDER

2. Design a VI for 1 bit adder using Sub VI.

Fig. 4.2 1 BIT FULL ADDER USING SUBVI

18
3. Design a VI for 4bit adder using sub VI.

Fig. 4.3: 4 BIT FULL ADDER

19
4. Design a VI for compare two input data.

Fig 4.4

Fig 4.5 Program using sub VI

CONCLUSION: The given experiment has been performed.

20
EXPERIMENT 5

AIM: Introduction and implementation of loops and arrays using Lab View.

APPARATUS REQUIRED: Computer system, LabVIEW-9.

THEORY

‘FOR’ LOOP:

Executes its sub diagram n times, where n is the value wired to the count (N) terminal. The iteration
(i) terminal provides the current loop iteration count, which ranges from 0 to n-1.

For Loop Tunnel Inputs–

Loop tunnels allow you to pass data through the For Loop. You can change the tunnel mode to
handle data that passes through the For Loop in different ways, as listed in the following table.

21
‘WHILE’ LOOP:

Repeats the code within its sub diagram until a specific condition occurs. A While Loop always
executes at least one time.

1. Sub diagram—Contains code that the While Loop executes once per iteration.

2. Iteration Terminal (i)—Provides the current loop iteration count. The loop count
always starts at zero for the first iteration. If the iteration count exceeds
2,147,483,647, or 231-1, the iteration terminal remains at 2,147,483,647 for all
further iterations. If you need to keep count of more than 2,147,483,647 iterations,
you can use shift registers with a greater integer range.

3. Conditional Terminal—Evaluates a Boolean input value to determine whether to


continue executing the While Loop. To specify whether the loop stops for a TRUE
or FALSE Boolean value, configure the continuation behavior of the loop. You also
can determine when the loop stops by wiring an error cluster to the conditional
terminal.

Arrays: Arrays group data elements of the same type. An array consists of elements and
dimensions. Elements are the data that make up the array; a dimension is the length, height
or depth of an array. An array can have one or more dimensions.
An array uses an index so you can readily access any particular element. The index is zero
based, which means it is in the range 0 to n-1. where n is the number of elements in the
array.
Array Functions:

1.Array Size:

The Array Size Function returns the number of elements in an array it is wired to.

22
2. Initialize Array:

Initialize Array crates an array of dimension size elements containing the element value.

3 Build Array

Build Array links multiple arrays. It appends elements to an array.

And it concatenates multiple arrays

4, Array Subset

Array Subset returns a portion of an array starting at index and containing length elements.

23
EXERCISE 1 Design a VI to print Fibonacci series.

Fig 5.1

EXERCISE 2. Design a VI to check if the number is prime or not.

Fig 5.2

EXERCISE 3.A strain gauge is used to control the operation of motor. Motor should run in
clockwise direction if input strain is greater than 1 psi and clockwise is less than 0.5 psi and
stops if strain is in between 1psi and 0.5 psi.

P>1 LED1=0 LED2=1;

0.5< P < 1 LED1=LED2=0;

P< 0.5 LED1=1 LED2=0

24
Fig 5.3

Exercise 4. Draw a VI for Factorial.

n! = n × (n-1) × (n-2) × (n-3) × …. × 3 × 2 × 1

Fig 5.4

25
Fig. 5.5

26
Fig 5.6

CONCLUSION: The given experiment has been performed.

27
EXPERIMENT 6

AIM: Create a VI to display any information using case structure.

APPARATUS REQUIRED: Computer system, LabVIEW

THEORY:

Ring controls: are numeric objects that associate numeric values with strings or pictures. Ring
controls appear as pull-down menus that users can cycle through to make selections.

Ring controls are useful for selecting mutually exclusive items, such as trigger modes. For example,
use a ring control for users to select from continuous, single, and external triggering.

Right-click a ring control and select Edit Items from the shortcut menu to add items to the ring
control list in the control. The order of the items in the Edit Items page of the Ring Properties
dialog box determines the order of the items in the control. You also can configure the ringcontrol so
users can enter numeric values not already associated with any entries in the list of items defined for
the control.

CASE STRUCTURE: A case structure has two or more sub diagrams or cases. Only one sub
diagram is visible at a time. An input value determines which sub diagram executes. The case
structure is similar to switch or if. then. Else statements in text based programming languages. The
case selector label at the top of the case structure contains the name of the selector value that
corresponds to the case in the center and decrement and increment arrows on each side. Wire an
input value, or selector, to the selector terminal to determine which case executes.

Exercise 1. a) Design a VI to convert km to cm.

b) Design a VI to convert m to km with help of ring control and case structure.

Fig 6.1

28
Fig 6.2

Exercise 2. Design a VI to convert m to km with help of ring control and case structure.

Fig 6.3

Exercise 3. Draw a VI to find if the number is even or odd and display even in output if even and
odd if output is odd.

Fig 6.4

CONCLUSION: The given experiment has been performed.

29
EXPERIMENT 7
AIM: Introduction to NI ELVIS (Educational Laboratory Virtual Instrumentation Suite)

APPARATUS: NI ELVIS, piezoelectric sensor, jumper wire etc.

THEORY: The purpose of this laboratory is to provide an introduction to the NI Elvis design and
prototyping environment. Basic operations provided by Elvis like digital Multimeter, function
generator, oscilloscope and bode analyzer are explained. Passive RC high pass and second order low
pass filter circuits are characterized using NI Elvis.

Fig 7.1: NI ELVIS

Fig 7.2: NI myDAQ 20-Position Screw Terminal I/O Connector

30
Signal Name Reference Direction Description

AUDIO IN — Input Audio Input—Left and right audio


inputs on a stereo connector

AUDIO OUT — Output Audio Output—Left and right audio


outputs on a stereo connector

+15V/–15V AGND Output +15 V/–15 V power supplies

AGND — — Analog Ground—Reference terminal


for AI, AO, +15 V, and –15 V

AO 0/AO 1 AGND Output Analog Output Channels 0 and 1

AI 0+/AI 0–; AGND Input Analog Input Channels 0 and 1


AI 1+/AI 1–

DIO <0..7> DGND Input or Digital I/O Signals—General-purpose


Output digital lines or counter signals

DGND — — Digital Ground—Reference for the DIO


lines and the +5 V supply

5V DGND Output 5 V power supply

Fig7.3 Connections for DMM Measurements

31
Signal Name Reference Direction Description

HI (V ) COM Input Positive terminal for voltage,


resistance, and diode measurements

COM — — Reference for all DMM measurements

HI (A) COM Input Positive terminal for current


measurements
(Fused: F 1.25 A 250 V Fast-Acting)

Table 2. DMM Signal Descriptions

The National Instruments Educational Laboratory Virtual Instrumentation Suite (NI ELVIS) is a
LabVIEW and computer based design and prototyping environment. NI ELVIS consists of a custom-
designed bench top workstation, a prototyping board, a multifunction data acquisition device, and
LabVIEW based virtual instruments. This combination provides an integrated, modular
instrumentation platform that has comparable functionality to the DMM, Oscilloscope, Function
Generator, and Power Supply found on the laboratory workbench.

Block diagram and front panel :-

Fig 7.4

CONCLUSION: The given experiment has been performed

32
EXPERIMENT 8

AIM:- Analog data acquisition using NI ELVIS. II

APPARATUS: NI ELVIS, jumper wire , piezoelectric sensor etc.

THEORY:

Analog Input (AI) : There are two analog input channels on NI myDAQ. These channels can be
configured either as general-purpose high-impedance differential voltage input or audio input. The
analog inputs are multiplexed, meaning a single analog-to-digital converter (ADC) is used to sample
both channels. In general-purpose mode, you can measure up to ±10 V signals. In audio mode, the
two channels represent left and right stereo line level inputs. Analog inputs can be measured at up to
200 kS/s per channel, so they are useful for waveform acquisition. Analog inputs are used in the NI
ELVISmx Oscilloscope, Dynamic Signal Analyzer, and Bode Analyzer instruments.

Analog Output (AO) : There are two analog output channels on NI my DAQ. These channels can
be configured as either general-purpose voltage output or audio output. Both channels have a
dedicated digital-to-analog converter (DAC), so they can update simultaneously. In general-purpose
mode, you can generate up to ±10 V signals. In audio mode, the two channels represent left and right
stereo outputs.

Block diagram and front panel:-

Fig 8.1

33
Fig 8.2

Fig 8.4

CONCLUSION: The given experiment has been performed.

34
EXPERIMENT 9

AIM: Digital data acquisition using NI ELVIS

APPARATUS: NI ELVIS, jumper wire.

THEORY:

Digital Input/output (DIO): There are eight DIO lines on NI myDAQ. Each line is a Programmable
Function Interface (PFI), meaning that it can be configured as a general-purpose software-timed
digital input or output, or it can act as a special function input or output for a digital counter. Refer to
Digital I/O (DIO) and Counters/Timers section for more information about the counter on NI
myDAQ.

Block diagram and front panel :-

Fig 9.1

CONCLUSION: The given experiment has been performed.

35
EXPERIMENT 10

AIM: Implement flat sequence and motor control,

APPARATUS: NI ELVIS, jumper wire, resistance, motor etc.

Block diagram and front panel:

Flat Sequence Structure: Consists of one or more sub diagrams, or frames, that execute
sequentially. Use the Flat Sequence structure to ensure that a sub diagram executes before or after
another sub diagram.

Data flow for the Flat Sequence structure differs from data flow for other structures. Frames in a Flat
Sequence structure execute from left to right and when all data values wired to a frame are available.
The data leaves each frame as the frame finishes executing. This means the input of one frame can
depend on the output of another frame.

When you add or delete frames in a Flat Sequence structure, the structure resizes automatically.

You attempt to control the data flow of your VI by establishing data dependency or using flow-
through parameters.

Fig 10.1

CONCLUSION: The given experiment has been performed.

36
EXPERIMENT 11

Objective: - Implement Data acquisition and Telemetry (Remote Sensing).

Apparatus Required: NI ELVIS, jumper wire, piezoelectric sensor etc.

Theory: -

Lab view includes a set of VI’s that let you configure, acquire data from and send data to DAQ
devices, often one device can perform a variety of functions: analog to digital conversion, digital to
analog conversions and digital I/O.

Fig 11.1

Lab VIEW File I/O When conducting experiments with equipment it is important to record data for
analysis and calibration of instruments. Lab VIEW has several functions for writing data to files –
both continuous writing (online, while the VI runs) and batch (offline) writing. Lab VIEW has also
functions for reading data in such log-files. These functions are available on the Programming > File
I/O palette. File I/O operations pass data to and from files. Use the File I/O VIs and functions located
on the Programming » File I/O palette to handle all aspects of file I/O,

Web publishing tool –

Web publishing tools are applications that are used to design and build websites for either
the Internet or an Intranet. They range from simple text editors that can generate web application
code to highly sophisticated and feature-rich web authoring packages.

37
Some web publishing tools must be installed on a workstation. Others are server-based and are
accessed via a web-interface. Web Publishing Tools are also called web authoring tools.

This tutorial provides an overview of current web publishing application software. It is intended for
individuals and small business owners who wish to establish a new website or want to upgrade an
existing site. In general, the goal is to create websites that are attractive, functional and
maintainable.

Block diagram and front panel:

Fig 11.2

Fig 11.3

38
Fig 11.3

Fig 11.4

39
Fig 11.5

CONCLUSION: The following experiment has been performed.

40
41

You might also like