hw1_labview

download hw1_labview

of 5

Transcript of hw1_labview

  • 8/10/2019 hw1_labview

    1/5

    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. he graphical language is named !"!. #riginally released for

    the $pple %acintosh in &'* LabVIEW is commonly used for data ac+uisition*

    instrument control* and industrial automation on a variety of platforms including

    %icrosoft Windo,s* various flavors of -NI* Linu/* and %ac #0 . he latest

    version of LabVIEW is version LabVIEW 12&&. he code files have the e/tension

    3.vi4* ,hich is an abbreviation for 3Virtual Instrument4. LabVIEW offers lots ofadditional $dd5#ns and oolkits.

    I. Dataflow Programming

    he programming language used in LabVIEW* also referred to as "* is a dataflo,

    programming language. E/ecution is determined by the structure of a graphical block

    diagram (the LV5source code) on ,hich the programmer connects different function5

    nodes by dra,ing ,ires. hese ,ires propagate variables and any node can e/ecute as

    soon as all its input data become available. 0ince this might be the case for multiple

    nodes simultaneously* " is inherently capable of parallel e/ecution. %ulti5processing

    and multi5threading hard,are is automatically e/ploited by the built5in scheduler*

    ,hich multiple/es multiple #0 threads over the nodes ready for e/ecution.

    II. Graphical Programming

    LabVIEW ties the creation of user interfaces (called front panel) into the

    development cycle. LabVIEW programs6subroutines are called virtual instruments

    (VIs). Each VI has three components7 a block diagram* a front panel* and a connector

    panel. he last is used to represent the VI in the black diagrams of other* calling Vis.

    8ontrols and indicators on the front panel allo, an operator to input data into or

    e/tract data from a running virtual instrument. 9o,ever* the front panel can also serve

    as a programmatic interface. hus a virtual instrument can either be run as a program*

    ,ith the front panel serving as a user interface* or* ,hen dropped as a node through

    the connector pane. his implies each VI can be easily tested before being embeddedas a subroutine into a larger program. he graphical approach also allo,s non5

    programmers to build programs simply by dragging and dropping virtual

    representations of lab e+uipment ,ith ,hich they are already familiar. he LabVIEW

    programming environment* ,ith the included e/amples and the documentation*

    makes it simple to create small applications. his is benefit on one side* but there is

    also a certain danger of underestimating the e/pertise needed for good +uality 3"4

    programming. :or comple/ algorithm or large5scale code* it is important that the

    programmer possess an e/tensive kno,ledge of the special LabVIEW synta/ and the

    topology of its memory management. he most advanced LabVIEW development

    systems offer the possibility of building stand5alone applications. :urthermore* it is

    possible to create distributed applications* ,hich communicate by a client6serverscheme* and are therefore easier to implement due to the inherently parallel nature of

    "inan;ar 0u,asono $di

    &2

  • 8/10/2019 hw1_labview

    2/5

    "5code.

    Experimental Method

    In this section ,e create and design t,o different ,aveforms ,hich are 0ine and

    White "aussian ,aveforms in LabVIEW. :irtly* ,e need to create pro;ect and start

    ,ith LabVIEW Virtual Instrument. here are several steps to make this comes true,hich are e/plained in the procedure bello,.

    &. 8reate a pro;ect

    1. #pen a ne, VI

    a. File >> New

    b. Create New list* select VI >> lan! VI >> "#

    lock =iagram are created

  • 8/10/2019 hw1_labview

    3/5

    (a) :ront ?anel (b) >lock =iagram panel

    @. No, ,e make schematic for sine ,aveform in >lock =iagram panel

    I. 8reate a ,hile loop in >lock =iagram panel and create control in the

    loop condition.

    II. We make a right click on >lock =iagram panel then* choose $ignal

    Proce%%ing >> &fm Generation >> $ine &fm placed sine generatorblock in the inside of ,hile loop.

    III. %ake a graph ,ith make a right click on front panel then* choose Graph

    AA &a'eform Graph (block diagram for this graph ,ill be created

    automatically in >lock =iagram panel)

    IV. "o on to >lock =iagram panel* place all blocks inside ,hile loop. We

    need to make connection bet,een $ine &fm and &a'eform Graph by

    ,iring %ignal outpin at $ine &fmblock to &a'eform Graphblock.

    V. 0et fre+uency of sine ,aveform by right clicking fre(uenc)pin at $ine

    &fmblock then choose Create AA Con%tant (default fre+uency is &2

    but* ,e can change it as ,hat is re+uired).

    VI. %ake a sampling info by right clicking %ampling infopin at $ine &fm

    block then choose Create AA Control (default sampling info is &222

    but* ,e can change it as ,hat is re+uired).

    VII. We also can add an amplitude constant on the graph by right clicking

    amplitude pin at $ine &fm block then choose Create AA Con%tant

    (default amplitude is & but* ,e can change it as ,hat is re+uired).

    B. ?icture bello, is the result of schematic block that ,e set for generating sine

    ,aveform in the >lock =iagram panel.

    . :or White "aussian ,aveform ,e do the same step like point @ by changing

    $ine &fm ,ith Gau%%ian &fm. ?icture bello, is the result of schematic

    block that ,e set for generating White "aussian ,aveform in the >lock

    =iagram panel.

  • 8/10/2019 hw1_labview

    4/5

    *e%ult and Di%cu%%ion

    In this part* ,e ,ill compare and analyCe about the result of generating sine and

    White "aussian ,aveforms. #n the first picture ,e see the output of generating sine

    ,aveform ,hich appears on :ront ?anel graph.

    his sine ,aveform has setting :s (fre+uency sampling) D &222 $mplitude D @

    :re+uency D &2. 9o,ever* ,hat ,e see on the graph is a ,aveform in the time

    domain (/ a/is). $s ,e kno, fre+uency has a strong relationship ,ith time. When ,e

    look on the basic formula thatf =1/T (,heref is fre+uency in 9C and Tis time in

    second* respectively) so* if ,e set &2 9C on the fre+uency side there ,ill be one sine

    ,aveform on 2.& second. #n the result of the graph ,e can see that there are &2 sine

    ,aveforms ,hich are periodically going through the range 2 to & second.

    #n the second picture bello,* ,e get the outcomes of generating White "aussian

    ,aveform.

    his White "aussian Noise has setting :s (fre+uency sampling) D &222 :re+uency D

    &. It is +uite interesting that the amplitude of this ,aveform has various peaks. When,e see on the sine graph* the amplitude and the ,avelength of the ,aveform is static*

  • 8/10/2019 hw1_labview

    5/5

    but here both parameters are dramatically changing all of the time and canFt be

    predictable ,hile ,e started simulation.

    Conclu%ion

    here are some points that ,e can sum up the simulation result ,hich ,e have

    done. :irstly* LabVIEW is the soft,are that allo,s non5programmers to build

    programs simply by dragging and dropping virtual representations of lab e+uipment.0econdly on simulation result* there is a big different bet,een sine and White

    "aussian ,aveforms. We get static ,aveform of sine graph that the result is based on

    setting ,e set. #n the other hand* ,e cannot predict ,hat the outcomes of the

    ,aveform ,hen ,e create White "aussian Noise.