Download presentation
1
LabVIEW an Introduction
Alan Holloway
2
What is LabVIEW LabVIEW is a graphical programming language that uses icons instead of lines of text to create applications. In contrast to text-based programming languages, where instructions determine program execution, LabVIEW uses dataflow programming, where data determine execution. Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
3
Using LabVIEW In LabVIEW, you build a user interface by using a set of tools and objects. The user interface is known as the front panel. You then add code using graphical representations of functions to control the front panel objects. The block diagram contains this code. If organized properly, the block diagram resembles a flowchart. Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
4
Virtual Instruments (VI)
LabVIEW programs are called virtual instruments, or VIs, because their appearance and operation imitate physical instruments, such as oscilloscopes and multimeters.
5
Front Panel The front panel is the user interface of the VI. You build the front panel with controls and indicators, which are the interactive input and output terminals of the VI, respectively. Controls are knobs, push buttons, dials, and other input devices. Indicators are graphs, LEDs, and other displays. Controls simulate instrument input devices and supply data to the block diagram of the VI. Indicators simulate instrument output devices and display data the block diagram acquires or generates Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
6
LabVIEW front panel Getting started with LabVIEW http://www.ni.com
Introduction to LabVIEW in 3 Hours
7
Block diagram After you build the front panel, you add code using graphical representations of functions to control the front panel objects. The block diagram contains this graphical source code. Front panel objects appear as terminals on the block diagram. You cannot delete a terminal from the block diagram. The terminal disappears only after you delete its corresponding object on the front panel.
8
Block diagram Every control or indicator on the front panel has a corresponding terminal on the block diagram. Additionally, the block diagram contains functions and structures from built-in LabVIEW VI libraries. Wires connect each of the nodes on the block diagram, including control and indicator terminals, functions and structures. Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
9
Front panel & corresponding block diagram
Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
10
Tools palette The Tools palette is available on the front panel and the block diagram. A tool is a special operating mode of the mouse cursor. When you select a tool, the cursor icon changes to the tool icon. Use the tools to operate and modify front panel and block diagram objects. Select View»Tools Palette from the taskbar to display the Tools palette. Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
11
Controls palette The Controls palette is only available on the front panel. The Controls palette contains the front panel controls and indicators you use to create the user interface. Select View» Controls Palette or right-click the front panel workspace to display the Controls palette. Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
12
Functions palette The Functions palette is available only on the block diagram. The Functions palette contains the objects you use to program your VI, such as arithmetic, instrument I/O, file I/O, and data acquisition operations. Select View» Functions Palette from the taskbar or right-click the block diagram workspace to display the Functions palette. Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
13
Status Toolbar Click the Run button to run the VI. While the VI runs, the Run button appears with a black arrow if the VI is a top-level VI, meaning it has no callers and therefore is not a subVI. While the VI runs, the Abort Execution button appears. Click this button to stop the VI immediately. Note: Avoid using the Abort Execution button to stop a VI. Either let the VI complete its data flow or design a method to stop the VI programmatically Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
14
Elements of typical programs
A - Loops While loop For loop B - Decision making & file I/O Case structure (if statement) Event structure C - Functions & sub VIs Built in LabVIEW functions Creating sub VI's Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
15
Loops Nearly all programs involve some sort of loop where all or sections of the program must be repeated. Both the While and For Loops are located on the Functions»Structures palette. The For Loop differs from the While Loop in that the For Loop executes a set number of times. A While Loop stops executing the subdiagram only if the value at the conditional terminal exists. Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
16
Drawing loops 1 Select the structure required
2 Enclose the code to be repeated (looped) 3 Wire the appropriate loop conditions Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
17
Loops While loops Runs until the stop condition is met
Always runs at least once Counts number of iterations
18
Loops For loop Runs according to input N number of iterations
Counts the number of iterations
19
LabVIEW Functions What types of function are available Analysis
Signal processing Statistics Advanced math & formulae Storage File I/O Zip ARM specific Simulation Read digital I/O +Many more!
20
Decision making The case structure has one or more subdiagrams, or cases, one of which executes when the structure executes. The value wired to the selector terminal determines which case to execute and can be Boolean, string, integer or enumerated type. Right-click the structure border to add or delete cases. Use the Labeling tool to enter value(s) in the case selector label and configure the value(s) handled by each case. Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
21
Case statement Boolean - True/False Numeric 0,1,2,3 …..n
String "Alan", "Mark", "Graham" etc Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
22
While loop executes every 250ms
Timing It may be necessary to add some sort of timing to your program. You can add a timing delay using the Wait Until Next ms Multiple Function Waits until the value of the millisecond timer becomes a multiple of the specified millisecond multiple. While loop executes every 250ms Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
23
Summary Controls are inputs and indicators are outputs.
LabVIEW programs are called virtual instruments (VIs). Controls are inputs and indicators are outputs. Each VI contains three main parts: Front panel – How the user interacts with the VI Block diagram – The code that controls the program Icon/connector – The means of connecting a VI to other VIs Getting started with LabVIEW Introduction to LabVIEW in 3 Hours
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.