Sei sulla pagina 1di 5

Ginanjar Suwasono Adi

103998009
Department of EECS

HW 1 LabVIEW Simulation
(Generating Sine and White Gaussian
Waveforms)
Introduction
LabVIEW (short for Laboratory Virtual Instrumentation Engineering Workbench)
is a platform and development environment for a visual programming language from
National Instruments. The graphical language is named "G". Originally released for
the Apple Macintosh in 1986, LabVIEW is commonly used for data acquisition,
instrument control, and industrial automation on a variety of platforms including
Microsoft Windows, various flavors of UNIX, Linux, and Mac OS X. The latest
version of LabVIEW is version LabVIEW 2011. The code files have the extension
.vi, which is an abbreviation for Virtual Instrument. LabVIEW offers lots of
additional Add-Ons and Toolkits.
I. Dataflow Programming
The programming language used in LabVIEW, also referred to as G, is a dataflow
programming language. Execution is determined by the structure of a graphical block
diagram (the LV-source code) on which the programmer connects different functionnodes 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. Multi-processing
and multi-threading hardware is automatically exploited by the built-in scheduler,
which multiplexes multiple OS threads over the nodes ready for execution.
II. Graphical Programming
LabVIEW ties the creation of user interfaces (called front panel) into the
development cycle. LabVIEW programs/subroutines are called virtual instruments
(VIs). Each VI has three components: a block diagram, a front panel, and a connector
panel. The last is used to represent the VI in the black diagrams of other, 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 through
the connector pane. This implies each VI can be easily tested before being embedded
as a subroutine into a larger program. The graphical approach also allows nonprogrammers to build programs simply by dragging and dropping virtual
representations of lab equipment with which they are already familiar. The LabVIEW
programming environment, with the included examples and the documentation,
makes it simple to create small applications. This is benefit on one side, but there is
also a certain danger of underestimating the expertise needed for good quality G
programming. For complex algorithm or large-scale code, it is important that the
programmer possess an extensive knowledge of the special LabVIEW syntax and the
topology of its memory management. The most advanced LabVIEW development
systems offer the possibility of building stand-alone applications. Furthermore, it is
possible to create distributed applications, which communicate by a client/server
scheme, and are therefore easier to implement due to the inherently parallel nature of

G-code.
Experimental Method
In this section we create and design two different waveforms which are Sine and
White Gaussian waveforms in LabVIEW. Firtly, we need to create project and start
with LabVIEW Virtual Instrument. There are several steps to make this comes true
which are explained in the procedure bellow.
1. Create a project

2. Open a new VI
a. File >> New
b. Create New list, select VI >> Blank VI >> OK

3. Front panel and Block Diagram are created

(a) Front Panel


(b) Block Diagram panel
4. Now we make schematic for sine waveform in Block Diagram panel
I.
Create a while loop in Block Diagram panel and create control in the
loop condition.
II.
We make a right click on Block Diagram panel then, choose Signal
Processing >> Wfm Generation >> Sine Wfm placed sine generator
block in the inside of while loop.
III.
Make a graph with make a right click on front panel then, choose Graph
>> Waveform Graph (block diagram for this graph will be created
automatically in Block Diagram panel)
IV.
Go on to Block Diagram panel, place all blocks inside while loop. We
need to make connection between Sine Wfm and Waveform Graph by
wiring signal out pin at Sine Wfm block to Waveform Graph block.
V.
Set frequency of sine waveform by right clicking frequency pin at Sine
Wfm block then choose Create >> Constant (default frequency is 10
but, we can change it as what is required).
VI.
Make a sampling info by right clicking sampling info pin at Sine Wfm
block then choose Create >> Control (default sampling info is 1000
but, we can change it as what is required).
VII. We also can add an amplitude constant on the graph by right clicking
amplitude pin at Sine Wfm block then choose Create >> Constant
(default amplitude is 1 but, we can change it as what is required).
5. Picture bellow is the result of schematic block that we set for generating sine
waveform in the Block Diagram panel.

6. For White Gaussian waveform we do the same step like point 4 by changing
Sine Wfm with Gaussian Wfm. Picture bellow is the result of schematic
block that we set for generating White Gaussian waveform in the Block
Diagram panel.

Result and Discussion


In this part, we will compare and analyze about the result of generating sine and
White Gaussian waveforms. On the first picture we see the output of generating sine
waveform which appears on Front Panel graph.

This sine waveform has setting Fs (frequency sampling) = 1000; Amplitude = 4;


Frequency = 10. However, what we see on the graph is a waveform in the time
domain (x axis). As we know frequency has a strong relationship with time. When we
look on the basic formula that f =1/T (where f is frequency in Hz and T is time in
second, respectively) so, if we set 10 Hz on the frequency side there will be one sine
waveform on 0.1 second. On the result of the graph we can see that there are 10 sine
waveforms which are periodically going through the range 0 to 1 second.
On the second picture bellow, we get the outcomes of generating White Gaussian
waveform.

This White Gaussian Noise has setting Fs (frequency sampling) = 1000; Frequency =
1. It is quite interesting that the amplitude of this waveform has various peaks. When
we see on the sine graph, the amplitude and the wavelength of the waveform is static,

but here both parameters are dramatically changing all of the time and cant be
predictable while we started simulation.
Conclusion
There are some points that we can sum up the simulation result which we have
done. Firstly, LabVIEW is the software that allows non-programmers to build
programs simply by dragging and dropping virtual representations of lab equipment.
Secondly on simulation result, there is a big different between sine and White
Gaussian waveforms. We get static waveform of sine graph that the result is based on
setting we set. On the other hand, we cannot predict what the outcomes of the
waveform when we create White Gaussian Noise.

Potrebbero piacerti anche