+ All Categories
Home > Documents > Exp1 Basic

Exp1 Basic

Date post: 03-Jun-2018
Category:
Upload: gurvinder-singh
View: 221 times
Download: 0 times
Share this document with a friend

of 12

Transcript
  • 8/11/2019 Exp1 Basic

    1/12

    Experiment No.1: Components of LabVIEW

    Objective:To open, and expore t!e components of LabVie".

    T!eor#

    LabVIEW is a graphical programming language that uses icons instead of lines oftext to create applications. In contrast to text-based programming languages,where instructions determine program execution, LabVIEW uses data flowprogramming, where data determine execution. In LabVIEW, you build a userinterface by using a set of tools and objects. he user interface is !nown as thefront panel. "ou then add code using graphical representations of functions tocontrol the front panel objects. he bloc! diagram contains this code. If organi#edproperly, the bloc! diagram resembles a flowchart. "ou can purchase se$eral

    add-on software toolsets for de$eloping speciali#ed applications. %ll the toolsetsintegrate seamlessly in LabVIEW..LabVIEW is integrated fully for communication with hardware such as &'I(, V)I,')I, *+-, *+-/0, and plug-in data ac1uisition de$ices. LabVIEW also hasbuilt-in features for connecting your application to the Internet using the LabVIEWweb ser$er and software standards such as2'3I' networ!ing and %cti$e).4sing LabVIEW, you can create -bit compiled applications that gi$e you thefast execution speeds needed for custom data ac1uisition, test, measurement,and control solutions. "ou also can create stand-alone executables and sharedlibraries, li!e 5LLs, because LabVIEW is a true -bit compiler.

    LabVIEW contains comprehensi$e libraries for data collection, analysis,presentation, and storage. LabVIEW also includes traditional programde$elopment tools. "ou can set brea!points, and single-step through the programto ma!e debugging and de$elopment easier. LabVIEW also pro$ides numerousmechanisms for connecting to external code or software through 5LLs, sharedlibraries, %cti$e), and more. In addition, numerous add-on tools are a$ailable fora $ariety of application needs.

    Virt$a Instr$mentsLabVIEW programs are called $irtual instruments 6VIs7. VIs contain three main

    components8the front panel, the bloc! diagram, and the icon and connectorpane. he front panel is the user interface of the VI. he following exampleshows a front panel.

    1

  • 8/11/2019 Exp1 Basic

    2/12

    "ou build the front panel with controls and indicators, which are the interacti$einput and output terminals of the VI, respecti$ely. 2ontrols are !nobs, pushbuttons, dials, and other input de$ices. Indicators are graphs, LE5s, and otherdisplays. 2ontrols simulate instrument input de$ices and supply data to the bloc!diagram of the VI. Indicators simulate instrument output de$ices and display datathe bloc! diagram ac1uires or generates.

    %fter you build the front panel, you add code using graphical representations offunctions to control the front panel objects. he bloc! diagram contains thisgraphical source code. 9ront panel objects appear as terminals, shown at left, on

    the bloc! diagram. "ou cannot delete a terminal from the bloc! diagram. heterminal disappears only after you delete its corresponding object on the frontpanel. (loc! diagram objects include terminals, subVIs, functions, constants,structures, and wires, which transfer data among other bloc! diagram objects.

    he following example shows a bloc! diagram and its corresponding front panel.

    2

  • 8/11/2019 Exp1 Basic

    3/12

    %fter you build a front panel and bloc! diagram, build the icon and the connectorpane so you can use it in another VI. %VI within another VI is called a subVI. %subVI corresponds to a subroutine in text-based programming languages. E$eryVI displays an icon, shown at left, in the upper right corner of the front panel and

    bloc! diagram windows. %n icon is a graphical representation of a VI. It can

    contain text, images, or a combination of both. If you use a VI as a subVI, theicon identifies the subVI on the bloc! diagram of the VI.

    "ou also need to build a connector pane, shown at left, to use the VI as a subVI.

    he connector pane is a set of terminals that corresponds to the controls andindicators of that

    VI, similar to the parameter list of a function call in text-based programminglanguages. he connector pane defines the inputs and outputs you can wire tothe VI so you can use it as a subVI. % connector pane recei$es data at its inputterminals and passes the data to the bloc! diagram code through the front panelcontrols and recei$es the results at its output terminals from the front panelindicators.

    he power of LabVIEW lies in the hierarchical nature of the VI. %fter you create aVI, you can use it as a subVI on the bloc! diagram of a high-le$el VI. here is nolimit on the number of layers in the hierarchy. 4sing subVIs helps you manage

    changes and debug the bloc! diagram1uic!ly.

    3

  • 8/11/2019 Exp1 Basic

    4/12

    %roced$re

    LabVIEW Environment

    When you launch LabVIEW, the following dialog box appears.

    he LabVIEW dialog box includes the following components:

    2lic! the Ne" VI button to create a new VI. 2lic! the arrow next to the button

    to create another type of LabVIEW object, such as a control.

    2lic! the Open VI button to open an existing VI. 2lic! the arrow next to the

    button to open recently opened files.

    2lic! the &'( )o$tions button to launch the 5%; +olution Wi#ard, which

    helps you find solutions for common 5%; applications.

    2lic! the )earc! Exampes button to open a help file that lists and lin!s to all

    a$ailable LabVIEW example VIs.

    2lic! the LabVIEW T$toria button to open the interacti$e LabVIEW Tutorial.

    4se this tutorial to learn basic LabVIEW concepts.

    4

  • 8/11/2019 Exp1 Basic

    5/12

    *ront %ane Toobar

    4se the toolbar buttons to run and edit a VI. he following toolbar appears on thefront panel.

    2lic! the +$n button to run the VI. While the VI runs, the button changes to thefollowing if the VI is a high-le$el VI.

    he +$n button often appears bro!en, shown at left, when you create or edit aVI. his button indicates that the VI is bro!en and cannot run. 2lic! this button todisplay the Error ist window, which lists all errors.

    2lic! the +$n Contin$o$s# button to run the VI until you abort or pause it. "oualso can clic! the button again to disable continuous running.

    While the VI runs, the 'bort Exec$tion button appears. 2lic! this button to stopthe VI immediately.

    5

  • 8/11/2019 Exp1 Basic

    6/12

    oc- &iaram Toobar

    When you run a VI, buttons appear on the bloc! diagram toolbar that you can

    use to debug the VI. he following toolbar appears on the bloc! diagram.

    2lic! the /i!i!t Exec$tion button to see the flow of data through the bloc!diagram. 2lic! the button again to disable execution highlighting.

    2lic! the )tep Into button to single-step into a loop, subVI, and so on. +ingle-stepping through a VI steps through the VI node to node. Each node blin!s todenote when it is ready to execute. (y stepping into the node, you are ready to

    single-step inside the node.

    2lic! the )tep Over button to step o$er a loop, subVI, and so on. (y steppingo$er the node, you execute the node without single-stepping through the node.

    2lic! the )tep O$t button to step out of a loop, subVI, and so on. (y stepping outof a node, you complete single-stepping through the node and go to the next

    node.

    he Warnin button appears when there is a potential problem with the bloc!diagram, but it does not stop the VI from running. "ou can enable the Warnin

    6

  • 8/11/2019 Exp1 Basic

    7/12

    button by selecting Toos0Options and selecting &eb$in from the top pull-down menu.

    en$s

    he menus at the top of a VI window contain items common to otherapplications, such as Open, )ave, Cop#, and %aste, and other items specific toLabVIEW. +ome menu items also list shortcut !ey combinations. +ome menuitems are una$ailable while a VI is running.

    4se the *ie menu primarily to open, close, sa$e, and print VIs.

    4se the Edit menu to search for and modify components of a VI.

    4se the Operate menu to run, abort, and change other execution options for theVI.

    4se the Toos menu to communicate with instruments and 5%; de$ices,compare VIs, build applications, enable the Web +er$er, and configure LabVIEW.

    4se the ro"se menu to na$igate through the VI and its hierarchy.

    4se the Windo" menu to display LabVIEW windows and palettes.

    4se the /ep menu to $iew information about palettes, menus, tools, VIs, andfunctions, to $iew step-by-step instructions for using LabVIEW features, toaccess the LabVIEW manuals, and to $iew the LabVIEW $ersion number and

    information about computer memory.

    %aettes

    LabVIEW has graphical, floating palettes to help you create and run VIs. hethree palettes include the Toos, Contros, and *$nctions palettes. "ou canplace these palettes anywhere on the screen.

    Toos %aette

    "ou can create, modify, and debug VIs using the tools located on the floatingToos palette. he Toos palette is a$ailable on the front panel and the bloc!diagram. % tool is a special operating mode of the mouse cursor. When youselect a tool, the cursor icon changes to the tool icon. 4se the tools to operateand modify front panel and bloc! diagram objects.

    7

  • 8/11/2019 Exp1 Basic

    8/12

    +elect Windo"0)!o" Toos %aette to display the Toos palette. "ou can placethe Toos palette anywhere on the screen. 'ress the perating tool to change the $alues of a control or select the text

    within a control. he >perating tool changes to the following icon when itmo$es o$er a text control, such as a digital or string control.

    4se the 'ositioning tool to select, mo$e, or resi#e objects. he 'ositioning

    tool changes to one of the following icons when it mo$es o$er a corner of a

    resi#able object.

    4se the Labeling tool to edit text and create free labels. he Labeling tool

    changes to the following icon when you create free labels.

    4se the Wiring tool to wire objects together on the bloc! diagram.

    8

  • 8/11/2019 Exp1 Basic

    9/12

    4se the >bject +hortcut ?enu tool to access an object shortcut menu with the

    left mouse button.

    4se the +crolling tool to scroll through windows without using scrollbars.

    4se the (rea!point tool to set brea!points on VIs, functions, nodes, wires,

    and structures to pause execution at that location.

    4se the 'robe tool to create probes on wires on the bloc! diagram. 4se the

    'robe tool to chec! intermediate $alues in a VI that produces 1uestionable or

    unexpected results.

    4se the 2olor 2opy tool to copy colors for pasting with the 2oloring tool.

    9

  • 8/11/2019 Exp1 Basic

    10/12

    4se the 2oloring tool to color an object. It also displays the current

    foreground and bac!ground color settings.

    Contros and *$nctions %aettes

    he Contros and *$nctions contain subpalettes of objects you can use tocreate a VI. When you clic! a subpalette icon, the entire palette changes to thesubpalette you selected. o use an object on the palettes, clic! the object andplace it on the front panel or bloc! diagram.

    4se the na$igation buttons on the Contros and *$nctions palettes to na$igateand search for controls, VIs, and functions. "ou also can right-clic! a VI icon onthe palette and select Open VI from the shortcut menu to open the VI.

    Contros %aette4se the Contros palette to place controls and indicators on the front panel. he

    Contros palette is a$ailable only on the front panel. +elect Windo"0)!o"Contros %aette or right-clic! the front panel wor!space to display the Controspalette. "ou also can display the Contros palette by right-clic!ing an open areaon the front panel. ac! down the Contros palette by clic!ing the pushpin on the

    top left corner of the palette.

    10

  • 8/11/2019 Exp1 Basic

    11/12

    *$nctions %aette

    4se the *$nctions palette to build the bloc! diagram. he *$nctions palette isa$ailable only on the bloc! diagram. +elect Windo"0)!o" *$nctions %aetteor right-clic! the bloc! diagramwor!space to display the *$nctions palette."oualso can display the *$nctions palette by right-clic!ing an open area on thebloc! diagram. ac! down the *$nctions palette by clic!ing the pushpin on thetop left corner of the palette.

    )avin VIs

    +elect )ave, )ave 's, )ave ', or )ave "it! Options from the *ie menu tosa$e VIs as indi$idual files or group se$eral VIs together and sa$e them in a VIlibrary. VI library files end with the extension .llb. @ational Instrumentsrecommends that you sa$e VIs as indi$idual files, organi#ed in directories,especially if multiple de$elopers are wor!ing on the same project. LabVIEW usesnati$e file dialogs for loading and sa$ing. "ou can disable this feature byselecting Toos0Options and selecting isceaneo$s from the top pull-downmenu.

    11

  • 8/11/2019 Exp1 Basic

    12/12

    ($estions:

    1. Write t!e main components of Virt$a instr$ments.

    2. W!at is t!e main roe of front pane and boc- diaram3

    4. Write t!e name of t!e !ard"ares to "!ic! LabVIEW can comm$nicate.

    12


Recommended