Você está na página 1de 72

Welcome!

Workshop
1 of 7

Who am I?

Loo Hui Ru 4SEW, FKE UTM

NI Penang Digital Hardware Engineer Intern (Summer 2011)


LabVIEW Student Ambassador for UTM Certified LabVIEW Associate Developer loo.hui.ru@ni.com

National Instruments
Leader in data acquisition technology with innovative modular instruments and LabVIEW graphical programming software

Corporate headquarters in Austin, TX

More than 40 international branches 5,100 employees


More than 1,000 products 600 Alliance Partners

Fortunes 100 Best Companies to Work For Twelve Consecutive Years


Dr. James Truchard

Diversity of Applications
No Industry > 10% of Revenue

Telecom

Automotive

Semiconductors

Electronics

Computers

ATE

Military/Aerospace

Advanced Research

Petrochemical

Food Processing

Textiles

Lego Mindstorms NXT

LabVIEW Student Design Competition


Deadline: June 10
Prizes Popular Vote

First Prize: $750 USD Second Prize: $500 USD Third Prize: $250 USD Critic Vote
Grand Prize: $2,000 USD Trip to NI Week 2011 in Austin, TX
http://www.ni.com/studentdesign/

LabVIEW Certification

Free Weekly LabVIEW Workshop


7 Workshops
x 1 hour Proficiency + 1 hour CLAD

=
2 months of workshops

(with weekly sessions)

Workshop Time and Dates


Session 1: Tuesday, 11am to 1pm. (13/3, 20/3, 27/3, 3/4, 17/4, 24/4, 8/5) Session 2: Friday, 3pm to 5pm.

(16/3, 23/3, 30/3, 6/4, 20/4, 27/4, 4/5)

CLAD Examination
FREE (if and only if) :

UTM Students Attend Workshop with 100% attendance Pass Basic Proficiency test Done and submit all the homework and project

Today's Topics

What is LabVIEW?

LabVIEW Environment

LabVIEW Project Parts of a VI Menus & Palettes Configurations

LabVIEW Data Types LabVIEW Data Flow

Today's Topics

What is LabVIEW?

LabVIEW Environment

LabVIEW Project Parts of a VI Menus & Palettes Configurations

LabVIEW Data Types LabVIEW Data Flow

What is LabVIEW?
Laboratory Virtual Instrumentation Engineering Workbench

What is LabVIEW?
Compiled graphical development environment Development time reduction of four to ten times Tools to acquire, analyze, and present your data

Measurement and automation application

Open and Run LabVIEW


StartAll ProgramsNational Instruments LabVIEW 2009

Start from a blank VI: NewBlank VI or Start from an example: ExamplesFind Examples

Today's Topics

What is LabVIEW?

LabVIEW Environment

LabVIEW Project Parts of a VI Menus & Palettes Configurations

LabVIEW Data Types LabVIEW Data Flow

Project Explorer
Use LabVIEW Projects to:
Group LabVIEW files and non-LabVIEW files

Right Click!

Create build specifications (i.e. stand-alone applications) Deploy or download files to targets (i.e. FPGA target)

19

Virtual Instrument (VI)


A LabVIEW Program
Appearance and operation imitate physical instruments eg: oscilloscopes, multimeter, etc

VI Front Panel Block Diagram Icon and Connector Pane

Virtual Instrument (VI)


1. Front Panel User interface (UI) Controls = inputs Indicators = outputs
2. Block Diagram Graphical source code Data travels on wires from control terminals through functions to indicator terminals Blocks execute by data flow 3. Icon/Connector Pane Graphical representation of a VI Means of connecting VIs (subVIs)

Virtual Instrument (VI)?


1. Front Panel User interface (UI) Controls = inputs Indicators = outputs

2. Block Diagram Graphical source code Data travels on wires from control terminals through functions to indicator terminals Blocks execute by data flow
3. Icon/Connector Pane Graphical representation of a VI Means of connecting VIs (subVIs)

Virtual Instrument (VI)?


Answer: a LabVIEW program
1. Front Panel User interface (UI) Controls = inputs Indicators = outputs 2. Block Diagram Graphical source code Data travels on wires from control terminals through functions to indicator terminals Blocks execute by data flow
* Conn. pane available from FP only

3. Icon/Connector Pane Graphical representation of a VI Means of connecting VIs (subVIs)

Demonstration: Creating a new VI

Front Panel

Front panel Toolbar

Front Panel
Controls Palette Contains Controls and Indicators. Customize the view.

Demonstration: Front Panel Controls Palette

Front Panel Controls and Indicators


Numeric Boolean

String

Demonstration: Front Panel Controls and Indicators

Shortcut Menus and Properties Dialog


Right Click!

Demonstration: Front Panel Shortcut Menus & Properties Dialog

Front Panel Toolbar


!!! It is best not to use the Abort button because you run the risk of not closing references or cleaning up memory correctly

Run

Run Continuously

Text Settings

Reorder

Pause

Abort

Align Objects

Distribute Objects

Resize Objects

Context Help

Block Diagram

Block Diagram Toolbar

Block Diagram
Terminals
Block Diagram appearance of front panel objects Entry & exit ports that exchange information between the front panel and block diagram Analogous to parameters and constants in textbased programming languages Control Indicator

Constants

Block Diagram
Nodes
Objects on the block diagram that have inputs and/or outputs and perform operations when a VI runs Analogous to statements, operators, functions, and subroutines in text-based programming languages

Functions

SubVIs

Block Diagram
Functions
Fundamental operating elements of LabVIEW Do not have front panels or block diagrams, but do have connector panes Double-clicking a function only selects the function does not open it like a VI Has a pale yellow background on its icon

Block Diagram
SubVIs
VI that you build to use inside another VI Any VI has potential to become a subVI Double-clicking a subVI will open it (exception: Express Vis- config. window opens) Icon represents subVI in main VI

Demonstration: Block Diagram Terminal

Block Diagram
Wires
Transfer data between block diagram objects Wires are different colors, styles, and thicknesses, depending on data type A broken wire appears as a dashed black line with a red X in the middle
DBL Numeric Integer Numeric
String

Scalar 1D Array 2D Array

Block Diagram: Wiring Tips


Press <Ctrl>-B to delete all broken wires Right-click and select Clean Up Wire to reroute the wire

Use the Clean Up Diagram tool to reroute multiple wires and


objects to improve readability

Select a section of your block diagram Click the Clean Up Diagram button on the block diagram toolbar (or <Ctrl>-U)

41

Numeric Controls and Functions


(Front Panel) From the ControlsModernNumeric subpalette, select the Numeric Control icon. (Block Diagram) From the FunctionsProgrammingNu meric subpalette, select the Add icon.

Mathematical Operations
(Block Diagram) From the FunctionsMathematicsIntegration and Differentiation subpalette, select the Derivative x(t).vi

Boolean Controls and Functions


(Front Panel) From the ControlsModernBoolean subpalette, select the Push Button icon.

(Block diagram) From the FunctionProgrammingBool ean subpalette, select the OR icon.

String Controls and Functions


(Front Panel) From the ControlsModernString subpalette, select the String Control icon.

(Block diagram) From the FunctionProgrammingString subpalette, select the Concatenate icon.

Demonstration :
Using the Functions and Controls Palette

Run Run Continuously Abort Block Diagram

Pause
Highlight Execution Retain Wire Values Step In Step Over Step Out

Block Diagram Toolbar

Text Settings

Align Objects Distribute Objects Resize Objects Reorder Clean Up Block Diagram Context Help

Demonstration: Searching for controls, VIs, Functions.

Tools Palette
Operating Tool: Change the value of a control. Positioning Tool: Change position or resize the objects.

Labeling Tool: Enter text in a control, edit text, create free label. Wiring Tool: Wire objects together in block diagram.

Tools Palette
Operating Tool: Change the value of a control. Positioning Tool: Change position or resize the objects.

Labeling Tool: Enter text in a control, edit text, create free label. Wiring Tool: Wire objects together in block diagram.

Tools Palette
Operating Tool: Change the value of a control. Positioning Tool: Change position or resize the objects.

Labeling Tool: Enter text in a control, edit text, create free label. Wiring Tool: Wire objects together in block diagram.

Tools Palette
Operating Tool: Change the value of a control. Positioning Tool: Change position or resize the objects.

Labeling Tool: Enter text in a control, edit text, create free label. Wiring Tool: Wire objects together in block diagram.

Tools Palette
Object Shortcut Menu tool: access object shortcut menu. Scrolling tool: Scroll through windows

Breakpoint tool: Set brakpoints on Vis, Functions, nodes, wires, and structures to pause execution. Probe tool: Create probes on wires on the block diagram

Tools Palette
Object Shortcut Menu tool: access object shortcut menu. Scrolling tool: Scroll through windows

Breakpoint tool: Set brakpoints on Vis, Functions, nodes, wires, and structures to pause execution. Probe tool: Create probes on wires on the block diagram

Tools Palette
Object Shortcut Menu tool: access object shortcut menu. Scrolling tool: Scroll through windows

Breakpoint tool: Set brakpoints on Vis, Functions, nodes, wires, and structures to pause execution. Probe tool: Create probes on wires on the block diagram

Tools Palette
Object Shortcut Menu tool: access object shortcut menu. Scrolling tool: Scroll through windows

Breakpoint tool: Set brakpoints on Vis, Functions, nodes, wires, and structures to pause execution. Probe tool: Create probes on wires on the block diagram

Tools Palette
Automatic Tool Selection Button: Automatically choose a tool. Color Copy tool: To copy a color to Coloring Tools. Coloring tool: Color an object.

Tools Palette
Automatic Tool Selection Button: Automatically choose a tool. Color Copy tool: To copy a color to Coloring Tools. Coloring tool: Color an object.

Tools Palette
Automatic Tool Selection Button: Automatically choose a tool. Color Copy tool: To copy a color to Coloring Tools. Coloring tool: Color an object.

Today's Topics

What is LabVIEW?

LabVIEW Environment

LabVIEW Project Parts of a VI Menus & Palettes Configurations

LabVIEW Data Types LabVIEW Data Flow

Common Data Types Found in LabVIEW

Polymorphism

Definition: a programming language feature that allows values of different data types to be handled using a uniform interface.

In LabVIEW: the ability of VIs and functions to automatically adapt to accept input data of different data types

i.e. Numeric Functions Useful when performing the same operation on different data types

Today's Topics

What is LabVIEW?

LabVIEW Environment

LabVIEW Project Parts of a VI Menus & Palettes Configurations

LabVIEW Data Types LabVIEW Data Flow

Data Flow

Block diagram execution is dependent on the flow of data Node executes when data is available to ALL input terminals Nodes supply data to all output terminals when done

Data Flow
Which code segment would execute first??

Try it yourself : Creating a simple VI


Create a VI which done the following: X+2Y=Z

Homework

Homework
Include your name, and Homework 1 in a comment box

Homework
Perform: (A + B) * (C 1) show the answer in slide indicator

Homework

Pass a word from a string control to a string indicator

Homework
Turn 2 LEDs on using push buttons.

Você também pode gostar