版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、National Instruments Confidential1LabVIEW Introduction CourseSemester National Instruments11500 N. Mopac ExpresswayAustin, Texas 78759(512) 683-01002Graphical Programming for Test, Measurement, and Control Rapid application development with Express VIs and easy-to-use graphical environment Interacti
2、ve measurement assistants and powerful redesigned DAQ interface for connecting to all types of I/O Expanded targeting options from Real-Time to FPGA to PDA Localized in French, German, and Japanese (Korean documentation)3 Readers of Electronic Design name invention of LabVIEW as one of the Top 50 Mi
3、lestones for the Electronics Industry LabVIEW 6.1 receives IAN Automation Excellence Award of 2002 Design News awards LabVIEW 6i Best Computer Productivity Tool of 2000 LabVIEW 6i chosen the “Best of the Best” in the software category by readers of Evaluation EngineeringLabVIEW Awards4May 2003Januar
4、y 2002August 2000March 1998February 1996August 1993September 1992January 1990October 1986April 1983 LabVIEW 7 Express VIs, I/O Assistants, FPGA/PDA targets LabVIEW 6.1 Enhanced networking capabilities, analysis LabVIEW 6i Internet-ready measurement intelligence LabVIEW 5.0 ActiveX, Multithreading La
5、bVIEW 4.0 Added professional tools, improved debugging LabVIEW 3.0 Multiplatform version of LabVIEW LabVIEW for Windows LabVIEW 2.0 for Macintosh LabVIEW 1.0 for Macintosh LabVIEW project beginsNI LabVIEW: A History of Innovation5 Third-Party Software Wolfram Research Mathematica Microsoft Excel The
6、 MathWorks MATLAB and Simulink MathSoft MathCAD Electronic Workbench MultiSim Texas Instruments Code Composer Studio Ansoft RF circuit design software Microsoft Access Microsoft SQL Server Oracle Leveraging Commercial Technologies Communication Protocols Ethernet CAN DeviceNet USB IEEE 1394 RS-232 G
7、PIB RS-4856PC, Mac, Linux, SunLabVIEW EverywhereNetworked I/OPC BoardsWorkstationHandheldEmbedded(FPGA)Industrial Computer (PXI)WirelessSensorTektronix Open Windows Oscilloscopes7The LabVIEW FamilyNI LabVIEWGraphical Programming Software for Measurement and AutomationLabVIEW Real-Time ModuleLabVIEW
8、FPGA ModuleLabVIEW PDA ModuleLabVIEW Datalogging andSupervisory Control Module8Acquire, Analyze, and PresentNearly all test, measurement, and control applications can be divided into 3 main components: the ability to acquire, analyze, and present data. LabVIEW is the easiest, most powerful tool for
9、acquiring, analyzing, and presenting real-world data.9Acquire with LabVIEWLabVIEW can acquire data using the following devices and more:GPIB, Serial, Ethernet, VXI, PXI InstrumentsData Acquisition (DAQ)PCI eXtensions for Instrumentation (PXI)Image Acquisition (IMAQ)Motion ControlReal-Time (RT) PXIPL
10、C (through OPC Server)PDAModular InstrumentsLabVIEW is tightly integrated with all NI hardware, in addition to connecting to thousands of I/O devices from hundreds of different vendors.10Analyze with LabVIEWLabVIEW includes the following tools to help you analyze your data:More than 400 measurement
11、analysis functions for Differential Equations, Optimization, Curve Fitting, Calculus, Linear Algebra, Statistics, etc.12 new Express VIs specifically designed for measurement analysis, including filtering and spectral analysisSignal Processing VIs for Filtering, Windowing, Transforms, Peak Detection
12、, Harmonic Analysis, Spectrum Analysis, etc.Powerful measurement analysis is built in to the LabVIEW development environment. 11Present with LabVIEWLabVIEW includes the following tools to help you present your data:On your machine Graphs, Charts, Tables, Gauges, Meters, Tanks, 3D Controls, Picture C
13、ontrol, 3D Graphs (Windows Only), Report Generation (Windows Only)Over the Internet Web Publishing Tools, Datasocket (Windows Only), TCP/IP, VI Server, Remote Panels, EmailEnterprise Connectivity Toolset SQL Tools (Databases), Internet Tools (FTP, Telnet, HTML)Presentation with LabVIEW can be done o
14、n your PC or over a network, or you can take advantage of additional applications such as DIAdem.12Course MapIntroduction to LabVIEWRepetition & LoopsModular ProgrammingVI CustomizationData Acquisition& WaveformsInstrument ControlArraysPlotting DataClustersDecision Making in a VIStrings and
15、File I/O13Course Goals Understand front panels, block diagrams, and connectors/icons Use the programming structures and data types that exist in LabVIEW Use various editing and debugging techniques Create and save your own VIs so you can use them as subVIs Display and log your data Create applicatio
16、ns that use plug-in data acquisition (DAQ) boards Create applications that use GPIB and serial port instrumentsThis course prepares you to:14Course Non-Goals Every built-in LabVIEW object, function, or library VI Analog-to-digital (A/D) theory The detailed operation of the serial port or GPIB bus Ho
17、w to develop an instrument driverIt is not the purpose of this course to discuss the following:15Lesson 1Introduction to LabVIEWTOPICSLabVIEW EnvironmentFront PanelBlock DiagramDataflow ProgrammingLabVIEW Help and ManualsDebugging a VI16Virtual Instruments (VIs)Front Panel Controls = Inputs Indicato
18、rs = OutputsBlock Diagram Accompanying “program” for front panel Components wired together17LabVIEW Dialog Box18Creating a new VI FileNew VI to open a blank VI FileNew to open the New dialog box and configure a VI template, global variable, control, etc19Template Browser20MenuFile Edit Operate Tools
19、 Browse Window Help21Front Panel WindowFront Panel ToolbarGraphLegendBooleanControlWaveformGraphIconPlotLegendScaleLegendWaveformGraphOwned Label22Block Diagram WindowWire DataGraphTerminalSubVIWhile LoopStructureBlock Diagram ToolbarDivideFunctionNumeric ConstantTiming FunctionBoolean Control Termi
20、nal23Front Panel and Block Diagram ToolbarsRun button Continuous Run buttonAbort buttonPause/Continue button Execution Highlighting button Step Into button Step Over button Step Out buttonWarning indicatorEnter buttonBroken Run buttonFont ringAlignment ringDistribution ringResize ringReorder ringCon
21、text Help ButtonAdditional Buttons on the Block Diagram Toolbar24Tools Palette LabVIEW automatically selects the tool needed Available on the front panel and the block diagram A tool is a special operating mode of the mouse cursor Use the tools to operate and modify front panel and block diagram obj
22、ects To show the tools palette, select WindowShow Tools Palette25Front Panel Controls PaletteControls PaletteContains the most commonly used controlsAll Controls PaletteShows all controls26Block Diagram Functions PaletteFunctions PaletteContains the Express VIs (interactive VIs with configurable dia
23、log page) and the most commonly used functionsAll Functions PaletteShows all functions27Palette Tools Graphical, floating palettes Subpalettes can be converted to floating palettes Use Palette Options to change palette view from Express to AdvancedSearch Palette OptionsClick pushpin to tack down pal
24、etteUp to OwningPalette28Searching for Controls, VIs, and Functions Press the search button to perform text searches of the palettes Click and drag an item from the search window to the block diagram or double-click an item to open the owning palette29Customize Control & Function Palette Keep vi
25、.lib in the LabVIEW 7.0 directory Place items in user.lib or instr.lib to have them appear in the Controls and Functions palettesPrograms National InstrumentsLabVIEW 7.030Build the front panel with controls (inputs) and indicators (outputs)NumericControl NumericIndicator Owned LabelsIncrementButtons
26、BooleanControl BooleanIndicator Creating a VI Front Panel31 Shortcut Menus for Front Panel ObjectsRight-click the label to access its shortcut menuRight-click the digital display to access its shortcut menu 32Property PageRight-click a control or indicator on the front panel and select Properties fr
27、om the shortcut menu to access the property dialog box for that object33NodesWiresControlTerminals Block DiagramFront PanelIndicator TerminalsCreating a VI Block Diagram34Express VIs, VIs and Functions Express VIs: interactive VIs with configurable dialog page Standard VIs: modularized VIs customize
28、d by wiring Functions: fundamental operating elements of LabVIEW; no front panel or block diagram35Block Diagram NodesIcon Expandable Node Expanded Node Function Generator VI Same VI, viewed three different ways Yellow field designates a standard VI Blue field designates an Express VI36Block Diagram
29、 Terminals Terminals are entry and exit ports that exchange information between the panel and diagram Terminals are analogous to parameters and constants in text-based programming languages Right-click and toggle View As Icon to change the icon view37Wiring the Block Diagram ScalarNumericBooleanStri
30、ng2D Array1D ArrayDynamic38Wiring Techniques Hot Spot Automatic Wiring Use Context Help Window when wiring Right-click wire and select Clean Up Wire Tip Strips Automatic wire routing Right-click terminals and select Visible ItemsTerminalsView the terminal connections to a function39 Block diagram ex
31、ecutes dependent on the flow of data; block diagram does NOT execute left to right Node executes when data is available to ALL input terminals Nodes supply data to all output terminals when doneDataflow Programming40Context Help To display the Context Help window, select HelpShow Context Help, press
32、 the keys, or press the Show Context Help Window button in the toolbar Move cursor over objectto display help Connections:Required boldRecommended normalOptional - dimmedSimple/Detailed Context Help Lock Help More Help41LabVIEW Help Click the More Help button in the Context Help window Select HelpVI
33、, Function, & How-To Help Click the sentence Click here for more help in the Context Help window.Contains detailed descriptions of most palettes, menus, tools, VIs, and functions, step-by-step instructions for using LabVIEW features, links to the LabVIEW Tutorial, PDF versions of all the LabVIEW
34、 manuals and Application Notes, and technical support resources.42NI Example Finder To find an example, select HelpFind Examples Web-integrated Search by keyword, example type, hardware type, etc.43Debugging TechniquesFinding ErrorsClick on broken Run button. A window showing the error appearsExecut
35、ion HighlightingClick on Execution Highlighting button; data flow is animated using bubbles. Values are displayed on wires.44Debugging TechniquesProbeRight-click on wire and select probe and it shows data as it flows through the wire segmentBreakpointsRight-click on wire and select Set Breakpoint; p
36、ause execution at the breakpoint.Conditional ProbeCombination of a breakpoint and a probe. Right-click on wire and select custom probe.45Debugging TechniquesStep Into, Over, and Out buttons for Single SteppingClick on Step Into button to enable single steppingOnce Single Stepping has begun, the butt
37、on steps into nodesClick on Step Over button to enable single stepping or to step over nodesClick on Step Out button to step out of nodes46Summary Virtual instruments (VIs) have three main parts the front panel, the block diagram, and the icon and connector pane The front panel is the user interface
38、 of a LabVIEW program and the block diagram is the executable code The block diagram contains the graphical source code composed of nodes, terminals, and wires Use Express VIs, standard VIs and functions on the block diagram to create your measurement code. For the most common requirements, use Expr
39、ess VIs with interactive configuration dialogs to define your application. Floating Palettes: Tools Palette, Controls Palette (only when Front Panel Window is active), and Functions Palette (only when Block Diagram Window is active) There are help utilities including the Context Help Window and LabV
40、IEW Help47Summary Place controls (inputs) and indicators (outputs) in the front panel window Use the Operating tool to manipulate panel objects. Use the Positioning tool to select, move, and resize panel objects. Use the Wiring tool to connect diagram objects Control terminals have thicker borders t
41、han indicator terminals All front panel objects have property pages and shortcut menus Wiring is the mechanism to control dataflow and produce LabVIEW programs Broken Run arrow means a nonexecutable VI Various debugging tools and options available such as setting probes and breakpoints, execution hi
42、ghlighting, and single stepping48Tips Common keyboard shortcuts Access Tools Palette with -right-click Increment/Decrement faster using key ToolsOptions selection set preferences in LabVIEW VI Properties (File menu)Windows Sun Linux MacOSRun a VI Find object Activate Context Help windowRemove all br
43、oken wiresClose the active windowToggle btwn Diagram/Panel Window49Lesson 2Modular ProgrammingTOPICSSubVIsIcon and Connector PaneUsing SubVIsCreating a SubVI from sections of a VI50LabVIEW HierarchySubVI51SubVIsFunction Pseudo Codefunction average (in1, in2, out)out = (in1 + in2)/2.0;SubVI Block Dia
44、gramCalling Program Pseudo Codemainaverage (point1, point2, pointavg)Calling VI Block Diagram52Icon/ConnectorAn icon represents a VI in other block diagramsA connector passes data to and receives data from a subVI through terminalsIconConnectorterminalsterminals53SubVI Example Calculating Slope A VI
45、 within another VI is called a subVI To use a VI as a subVI, create an icon and a connector pane after building the front panel and block diagram54Creating the Icon Icon: graphical representation of a VI Right-click in the icon pane (Panel or Diagram) Always create a black and white iconDefault Icon
46、Create a custom icon55Creating the ConnectorRight-click the icon (Front Panel only)56Creating the Connector - continuedClick withwiring tool57The Connector PaneTerminal colors match the data types to which they are connectedClick the terminal to see its associated front panel object58Using a VI as a
47、 SubVIAll Functions Select a VI Drag icon onto target diagram59Help and Classifying TerminalsClassify inputs and outputs:Required Error if no connectionRecommended Warning if no connectionOptional No effect if no connection60Create SubVI Option Enclose area to be converted into a subVI Select Create
48、 SubVI from the Edit Menu61Summary VIs can be used as subVIs after you make the icon and connector Icon created using Icon Editor Connector defined by choosing number of terminals Load subVIs using the Select a VI option in the All Functions palette or dragging the icon onto a new diagram Online hel
49、p for subVIs using the Show Context Help option Descriptions document functionality Use Create SubVI feature to easily modularize the block diagram62Lesson 3Repetition and LoopsTOPICSWhile LoopsFor LoopsAccessing Previous Loop Data63While LoopsLabVIEW While Loop Flow Chart Pseudo CodeRepeat (code);U
50、ntil Condition met;End;64While Loops1. Select While Loop2. Enclose code to be repeated3. Drop or drag additional nodes and then wire65Select the Loop ConditionClick the Conditional Terminal with the Operating tool to define when the loop stopsDefault: Stop if TrueIteration TerminalConditional Termin
51、al66Structure Tunnels Tunnels feed data into and out of structures. The tunnel is a block that appears on the border; the color of the block is related to the data type wired to the tunnel. When a tunnel passes data into a loop, the loop executes only after data arrive at the tunnel. Data pass out o
52、f a loop after the loop terminates. 67For LoopsLabVIEW For Loop Flow Chart Pseudo CodeN=100;i=0;Until i=N: Repeat (code; i=i+1);End;68For Loops In Structures subpalette of Functions palette Enclose code to be repeated and/or resize and add nodes inside boundary Executes diagram inside of loop a pred
53、etermined number of timesCount terminal(Numerical input)Wait Until Next ms Multiplefunction69Wait FunctionsWait Until Next ms MultipleFunctionsTime & Dialog palette70Wait FunctionsWait (ms)FunctionsTime & Dialog paletteTime DelayFunctionsTime & Dialog palette71Numeric Conversion Numerics
54、 default to double-precision (8 bytes) or long integer (4 bytes) LabVIEW automatically converts to different representations For Loop count terminal always converts to a long integer Gray coercion dot on terminal indicates conversion72Numeric Conversion LabVIEW chooses the representation that uses m
55、ore bits. If the number of bits is the same, LabVIEW chooses unsigned over signed. To choose the representation, right-click on the terminal and select Representation. When LabVIEW converts floating-point numerics to integers, it rounds to the nearest integer. LabVIEW rounds x.5 to the nearest even
56、integer. For example, LabVIEW rounds 2.5 to 2 and 3.5 to 4.73Accessing Previous Loop Data Shift Register Available at left or right border of loop structures Right-click the border and select Add Shift Register Right terminal stores data on completion of iteration Left terminal provides stored data
57、at beginning of next iterationBefore LoopBeginsFirst IterationSecondIteration LastIteration Initial ValueValue 1Value 1Value 2Value 2Value 3Value 3InitialValue74Additional Shift Register ElementsLatest valueis passed toright terminalRight-click the left terminal to add new elementsPrevious values ar
58、e available at the left terminalsRight-click the border for a new shift register1 loop ago2 loops ago3 loops ago75Feedback NodesAppears automatically in a For Loop or While Loop if you wire the output of a subVI, function, or group of subVIs and functions to the input of that same VI, function, or g
59、roup. Stores data when the loop completes an iteration, sends that value to the next iteration of the loop, and transfers any data type76Feedback Node Wire from output to input to automatically create a feedback node Place a feedback node from the FunctionsStructures palette77Initialized Shift Regis
60、ters & Feedback NodesRun Once VI stops execution Run AgainOutput = 5Output = 5Output = 5Output = 578Uninitialized Shift Registers & Feedback NodesRun Once VI stops execution Run AgainOutput = 8Output = 4Output = 4Output = 879Summary Two structures to repeat execution: While Loop and For Loop Loop timing controlled using Wai
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 新生儿洗澡护理操作指南
- 矿山开采企业受限空间作业管理制度(职责分工+作业准入+检查考核)
- 绿色理念下食品企业文化建设研究论文
- 2026年甜品烘焙(提拉米苏)试题及答案
- 2027年短视频剪辑师聘用协议(成片修改次数)
- 2025年价格鉴证师职业能力水平评价考试(价格鉴证理论与实务)历年参考题库含答案详解(5卷集合)
- 2027年储能系统服务合同(紧急联系人表)
- 2027跨境电商保税仓储管理合同
- 2027年跨境电商税务咨询合同(税务清单与合规要求)
- 2027年劳动合同兼职版(自由职业)
- 传世瑰宝《渔樵问对》原文(最-全版)及译文(一)
- 海南选调生笔试真题及答案解析(近年高频版)
- 消化性溃疡基层诊疗指南(2023年)解读课件
- 人体及动物生理学课后习题及答案
- 2026年防汛安全知识培训课件
- 线缆组件轻量化设计
- 2025年中国安全生产科学研究院招聘笔试预测试题及答案
- 2026年广东省高中学业水平考试春季高考语文试卷(含答案)
- 2025年湖北日报传媒集团(湖北日报社)专项招聘25人笔试试题附答案解析
- 施工安全管理制度不健全(3篇)
- 三星电视机UA46D5000PR使用说明书
评论
0/150
提交评论