0% found this document useful (0 votes)
23 views8 pages

SIP LAB REPORT-01 EC23B1065 (Rohit)

The document outlines a laboratory exercise focused on using LabVIEW for creating Virtual Instruments (VIs) to calculate the sum and average of input values. It covers various functionalities including the use of structures, debugging tools, and hybrid programming with MathScript. The experiment concludes with a summary of key operations learned, such as signal generation and control flow in LabVIEW.
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)
23 views8 pages

SIP LAB REPORT-01 EC23B1065 (Rohit)

The document outlines a laboratory exercise focused on using LabVIEW for creating Virtual Instruments (VIs) to calculate the sum and average of input values. It covers various functionalities including the use of structures, debugging tools, and hybrid programming with MathScript. The experiment concludes with a summary of key operations learned, such as signal generation and control flow in LabVIEW.
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/ 8

SENSING AND INSTRUMENTION

PRACTICE
EC2010

JANUARY 20, 2025


Rohit Kumar
EC23B1065
Expt. 1
Introduction to LabView
Objective:- To offer an initial hands-on experience in
building a VI.

1. To find sum and average VI example using Graphical


Programming
In this example, two inputs and two outputs are needed, one output generating
the sum and the other generating the average of the two input values. We can
create the inputs by locating two numeric controls on the front panel. Each
numeric control automatically places a corresponding terminal icon on the
block diagram. We label the two inputs as x and y and the two outputs as sum
and average using the Labeling tool from the Tools Pale e. We now place an
Add function and a Divide function. Now, we enter the divisor, in this case, 2,
in a Numeric Constant and connect it to the y terminal of the Divide function
using the Wiring tool. To achieve proper data flow, we wire functions,
structures and terminal icons on a block diagram using the Wiring tool. Here,
the functionality of the VI is tested by taking 10 and 13 as inputs of x and y
respectively. Upon running the VI by choosing Run, we obtained the outputs
as 23 and 11.5 for sum and average respectively. Now, we select the nodes on
the block diagram to be included in the SubVI. Then, we choose Edit →Create
SubVI to insert a new SubVI icon. This SubVI performs the same function as
the original Sum and Average VI.

2. To find sum and average VI using Structures and SubVIs


In this example, we use a VI to show the sum and average of two input
values, which are altered in a continuous fashion. If the average of the two
inputs becomes greater than a preset threshold value, a LED warning light
turns on. Here for the inputs, we consider two Knobs. We adjust the size of the
knobs by using the Positioning tool. We can modify knob proper es such as
precision and data type by choosing Proper es from the shortcut menu. Now,
we label two inputs as IN1 and IN 2 respectively. For the first knob, we
change the data type from double precision to byte. In the Data Range tab, a
default value needs to be specified. Here we consider the default value to be
0. Default value can be set by right-clicking on the control and choosing Data
Operations →Make Current Value Default from the shortcut menu. We
perform similar kind of adjustments for the second knob except that the data
type of second knob to be double precision to demonstrate the difference in
the outcome. For output, we place numeric indicator, round LED and gauge.
Now to compare the average output of the SubVI with a threshold value we
locate a Greater or Equal? Func on. We now create a wire branch on the wire
between the Average terminal of the SubVI and its indicator via the Wiring
tool and extend this wire to the x terminal of the Greater or Equal? function.
At y terminal of the Greater or Equal? function we place a numeric constant.
We now enter 9 in the numeric constant and wire the round LED, labelled as
Warning, to the x>=y? terminal of this function to provide a Boolean value.
We enclose the objects in while loop to run VI continuously. Now, we create
Stop button in order to terminate the loop. To check the functionality of VI,
we click on run button on tool bar and adjust the values of knobs and check
for the output.

3. Debugging VIs using Probe Tool


We use the Probe Tool to see what data is being passed while VI is running. A
probe is placed on wire by using Probe Tool. Using probe we can observe the
the intermediate values on probe window.
4. Profile Tool
Profile Tool helps in gathering ming and memory usage related informa on.
We must ensure to stop the VI before opening the Profile window.

5. Programming in the LabVIEW MathScript Window


The MathScript feature allows us to include .m files that can be created
using any text editor. We type the .m file textual code in the script tab of
LabVIEW MathScript Window, which can be selected in Tools. Here we
have written the code to find the average of vector x and saved it as
average.m. To run the program, we click on the Run script button.
These are the following operations on a complex number z:

>>conj(z) % computes the conjugate of z


>> angle(z) % computes the phase of z
>> real(z) % computes the real part of z
>> imag(z) % computes the imaginary part of z
>> abs(z) % computes the magnitude of z
6. Signal Display
We use two tools namely, Waveform Graph and XY Graph to display
data(graphical format) acquired at constant and non-constant rate
respectively.
7. Hybrid Programming
LabView MathScript feature can be used to perform hybrid programming,
which is a combination of textual .m files and graphical objects. We build the
program of finding average using LabVIEW MathScript node.

8. Building a periodic signal generation system using Hybrid


Programming
Here, we build a simple periodic signal generation system in hybrid mode
which involves genera ng a periodic signal in textual mode and displaying it in
graphical mode. Here, we can modify the signal shape(sine, square, triangle,
sawtooth), frequency and amplitude. For building the block diagram, we write
a .m file code to generate the waveforms using .m file functions. To change
the amplitude and frequency wee use the controls named Amplitude and
Frequency. Another input named Waveform Type is controlled by Enum
Control. This is used for selecting the waveform type. Using this control we
can select multiple inputs. We can create Enum control from the front panel by
selecting Controls → Modern → Ring & Enum → Enum. We now insert each
item in edit item tab, which can be found in Enum Proper es. Enum Proper es
can be obtained by right clicking on Enum control. A er insertion, the
corresponding item number is shown in digital display. This number is the
output of the Enum Control. Now, we display the graphs using Waveform
Graph.

Result:-
From this experiment, I have learnt the basic operations that can
be performed on LabVIEW such as finding Sum and average VI,
its sub VI, inserting it into a physical system and showing some
warning based on threshold using control flow, probe tool,
profile tool, programming of sum and average Math script,
signal display and signal genera on.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy