ECL 223 Introduction To Lab View: Department of Physics, University of Colombo Electronics & Computing Laboratary Ii
ECL 223 Introduction To Lab View: Department of Physics, University of Colombo Electronics & Computing Laboratary Ii
ECL 223
Group - 11- B
Name - W.Y.Madushani
Index - 13153
Partner - K.N.M.D.M.Kosgahakumbura
Date - 2017/05/25
1
ABSTRACT
The main objective of this experiment was to get familiarized with the software Lab
VIEW. Another objective was to investigate how to use the Lab VIEW software for
virtual Instrumentation. Six different experiments were done in the practical. In this
experiment, few applications of LabVIEW are discussed, under that numeric controllers
and indicators, Celsius to Fahrenheit and Kelvin convertors, Simulation of a Boolean
function, Graduated bars and meters, Matrix operations, a signal processing system, is
being discussed.
In the first experiment basic idea was gained how to work in front panel and block
diagram. There indicators and controllers were used and their difference was studied. And
the difference between run command and run continuously command was studied.
In the 2nd experiment while loop was used for the first time and also the stop button.
There, the difference between text-based language functions and LabVIEW function was
studied. And the way of functioning the program was studied by using highlight
execution button.
In the third experiment logic gates were used and a certain Boolean function was
simulated with LabVIEW.
By the fourth experiment for loop was used and the way of fixing a numerical constant
for it was studied. And the wait function also used there.
The next step was some mathematical approach, there matrix was made and the way of
extracting a sub matrix was studied and some algebraic operations were performed.
In the final step a signal was simulated and waveform graphs were used with them.
Uniform white noise waveform was added to generate a noise signal and filter also used
for filter the signal.
2
TABLE OF CONTENTS
1 INTRODUCTION ........................................................................................................ 6
2 THEORY ...................................................................................................................... 7
3 METHODOLOGY ....................................................................................................... 9
3.1 Experiment 1 ......................................................................................................... 9
3.2 Experiment 2 ......................................................................................................... 9
3.3 Experiment 3 ....................................................................................................... 10
3.4 Experiment 4 ....................................................................................................... 10
3.5 Experiment 5 ....................................................................................................... 10
3.6 Experiment 6 ....................................................................................................... 10
4 RESULT AND ANALYSIS ....................................................................................... 12
5 DISCUSSION ............................................................................................................. 16
6 CONCLUSION........................................................................................................... 17
7 REFERENCES ........................................................................................................... 18
3
TABLE OF FIGURES
Figure 4.1:block diagram and corresponding front panel for adding two numbers........... 12
Figure 4.2:-Temperature converting program which made by three thermometers .......... 12
Figure 4.3:logic gate simulator .......................................................................................... 13
Figure 4.4:counter made with Meter, Gauge and slide ...................................................... 14
Figure 4.5:Matrix solving program .................................................................................... 14
Figure 4.6: output of signal generator with noise generator and filter on front panel ....... 15
Figure 4.7:Wave simulator with noise generator and filter in block diagram ................... 15
4
LIST OF TABLE
5
1 INTRODUCTION
LabVIEW stands for Laboratory Virtual Instrument Engineering Workbench is a
graphical programing language developed by national instruments. Unlike high level
languages, like C and Object-Oriented languages like C++ or Java, which require a
thorough understanding of programming and require extensive coding, Graphical
programming languages use graphical icons and drag and drop methods to create
applications which are very user friendly. LabVIEW uses data flow programming where
the flow of data determines the execution
LabVIEW consists of mainly two program parts. These two parts are:
1. Front Panel - The component program on which the external displays, inputs is
done. This part can be used as a user interface.
2. Block Diagram - This part consists of the internal parts of the circuit. This also
can be called the virtual „source code‟ of the application. All the internal
designing is done here. Using these two parts, a Virtual Instrument can be
designed and made.
6
2 THEORY
Front Panel
Front panel serves as the user interface. The programming code can be added using
graphical representation of functions to control the front panel objects. In the front panel
there is control pallet. The basic implementation of the code using the graphical tools will
be done in front panel.
Control Palette
Control Palette is available only on the front panel. Control palette contains the controls
and indicators as well which can be used to build the front panel. indicators can be placed
anywhere on front panel by selecting Window Shoe controls palette or by right
clicking on the front panel work space.
Block Diagram
Block diagram contains the source code which defines the functions of the VI. The
speciality here is that source code is not a text based code, it consists of graphical icons
and it resembles a flow chart.
After of building of the front panel, user had to add code using graphical representations
of functions to control the front panel objectives. The block diagram has this source code
and each object created in front panel is having the separate block. Then the data flow of
code can be drawn by connecting these elements using wires. After of creating any VI, it
can simulate once by clicking RUN button and can execute continuously to update
outputs in real-time by clicking RUN CONTINUOUSLY button.
Function Palette
Function palette is available only on the block diagram and it can be accessed simply by
right clicking the block diagram window or selecting windowshow functions palette.
User can place function palette in anywhere of the screen
Terminals
Terminals are entry and exit ports that exchange information between the front panel and
block diagram. Types of terminals include control or indicator terminals and node
terminals. Control and indicator terminals belong to front panel controls and indicators.
Data points you enter into the front panel controls (a and b in the previous front panel)
enter the block diagram through the control terminals. The data points then enter the Add
and Subtract functions. When the Add and Subtract functions complete their calculations,
they produce new data values. The data values flow to the indicator terminals, where they
update the front panel indicators (a+b and a–b in the previous front panel).
7
Nodes
Nodes are objects on block diagram that have inputs and(or) outputs and perform
operations when a VI executes. They are analogous to statements, operators, functions
and subroutines in text-based languages.
For Loop
It executes a sub diagram a set number of times. The value of the count terminal,
indicates how many times to repeat the sub diagram. The iteration terminal
contains the number of completed iterations. This iteration count is always starts
at 0. Both the count and iteration terminals are in range 0 to 231 -1. If wire a
floating number to count terminal, LabVIEW rounds it and convert it to its range.
If wire 0 to the count terminal, the loop does not execute.
While Loop
It executes a sub diagram until the conditional terminal receives a specific Boolean value.
Default process of the conditional terminal is “Stop If True”. Hence the While Loop
executes its sub diagram until the conditional terminal receives TRUE value. User can
change the behavior of the conditional terminal as “Continue If True” by right-clicking
the terminal. In this condition the Loop executes its sub diagram until the conditional
terminal receives FALSE value. Important thing is While Loop always executes at least
one time. The VI does not run if user do not wire the conditional terminal. The iteration
terminal of the Loop shown the number of completed iterations. Iteration count also starts
from 0 and during the first iteration terminal will returns 0.
8
3 METHODOLOGY
3.1 Experiment 1
3.2 Experiment 2
9
3.3 Experiment 3
A VI was constructed to simulate positive logic two input AND, OR, NOR, XOR,
and XNOR gates. There was only two common inputs to all gates and the output
of each gate has been displayed separately.
Then a VI was constructed to simulate the Boolean function
F=(̅̅̅̅̅̅̅̅̅̅̅̅
̅ .(CB+ ̅C+ ̅ A)) observations were noted down.
3.4 Experiment 4
3.5 Experiment 5
3.6 Experiment 6
10
And connected the output of the signal generator to waveform graph to display the
signal. Then enclosed the block diagram components in a while loop and added a
wait function to delay the execution of the loop.
Then uniform white noise waveform was added as another signal generator to
generate a noise signal. And superimposed the noise signal with the original sin
signal to add some noise to the original signal, and displayed the resulting signal
in a separate Waveform graph.
After that the signal with noise was connected to filter (low pass) and displayed
the filtered signal in another wave graph. And placed a control to change the
lower cut off frequency of the filter.
Then two spectral measurements have been used to perform spectral
measurements on both noisy signal and the filtered signal. And the output was
displayed in two separate waveform graphs.
Finally ran the VI and observed the effect of changing the lower cut-off frequency
of the filter.
11
4 RESULT AND ANALYSIS
Experiment 1
Figure 4.1:block diagram and corresponding front panel for adding two numbers
Experiment 2
12
Experiment 3
Table 4.1:Results of Experiment 3
A B C F
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 0
13
Experiment 4
Experiment 5
14
Experiment 6
Figure 4.6: output of signal generator with noise generator and filter on front panel
Figure 4.7:Wave simulator with noise generator and filter in block diagram
15
5 DISCUSSION
The main purpose about this practical was to study about the way of handling LabVIEW
for different purposes .In this practical there were 6 experiments.
First experiment was mainly a study about the difference between indicators and
controllers in the block diagram. Controllers and Indicators are used as inputs and outputs
for the VI respectively. There are several differences between the icons of controllers and
indicators. The arrow mark can be observed in the right side of the controllers and in the
left side of the indicators. Then the difference between run command and run
continuously command was studied, when the user execute the program with run
command it runs only one time but with run continuously command, the program is
running continuously till the user command it for stop.
In second experiment while loops and foor loops are used to run the same section of code
again and again. They are the most common execution structures which can be used to
run the same section of code several times in LabVIEW. The difference between For
Loop and While Loop is that For Loop executes a given number of times. But While
Loop stops executing only if the value at the conditional terminal exists. The Iteration
Terminal which is in the loop is an output terminal that counts the number of completed
iterations. This count always starts from zero for the both While and For loops.
In experiment 4, Graduated Bar, Meter, Gauge, Wait function and For Loop are the main
constructors and functions that used to create this VI. When the iteration time value and
the delay time added to the loop iteration terminal and to the wait function it starts work.
Wait function is used to control the iteration time of the loop. When the given numerical
constant to the wait function is higher, then the iteration time will increase. When the VI
is running Graduated Bar, Meter and Gauge starts to increase it‟s value from 0 to 100. All
of these three indicators have scaled up to 110. But the scale value doesn‟t increase from
0 to 110, because the loop count constant is set to 100. Then the loop will run only 100
times.
In the 6th experiment was used simulate signal then a noise signal was generated and it
was superimposed with the original signal and resulting signal was displayed in a
waveform graph. There are filters as well which can be used to filter the original signal
from superimposed signal. When the filter is given a fixed value, it removes the signals
(noise signals) above that frequency
16
6 CONCLUSION
LabVIEW is a graphical programming language designed for interfacing with
measurement and control devices.
For loops and while loops also can be used to perform actions according to the
user‟s preference.
LabVIEW can be used to do calculations like addition, subtraction,
multiplications, division.
Run button will execute a program only once while the Run Continuously button
until the user disallows it.
The wait function can be used to make a delay when running on loops.
Matrix multiplication and extraction of sub-matrices and Generating signals,
superimposing of signals, filtering signals, obtaining Fourier transformations of
signals can be done easily by using this software.
17
7 REFERENCES
Anon, (2017). [online] Available at:
http://www.scilab.org/scilab/interoperability/connection_applications/labview [Accessed
23 May 2017].
Ni.com. (2017). LabVIEW System Design Software - National Instruments. [online]
Available at: http://www.ni.com/labview/ [Accessed 23 May 2017].
Mindmajix. (2017). Introduction of Repetition And Loops in LabVIEW - Mindmajix.
[online] Available at: http://mindmajix.com/labview/introduction-repetition-and-loops-in-
labview [Accessed 23 May 2017].
18
APPENDIX – A
19