labview proficiency workshop 1

72
Workshop 1 of 7 Welcome!

Upload: syakira-lurve-hana

Post on 22-Oct-2014

156 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: LabVIEW Proficiency Workshop 1

Workshop 1 of 7

Welcome!

Page 2: LabVIEW Proficiency Workshop 1

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 [email protected]

Page 3: LabVIEW Proficiency Workshop 1

5,100 employees More than 1,000 products 600 Alliance Partners

Dr. James Truchard

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

Corporate headquarters in Austin, TX

More than 40 international branches

Fortune’s 100 Best Companies

to Work For Twelve

Consecutive Years

Page 4: LabVIEW Proficiency Workshop 1

Diversity of Applications

ElectronicsSemiconductors Computers

No Industry > 10% of Revenue

AdvancedResearch Petrochemical

FoodProcessing Textiles

AutomotiveTelecom

ATE Military/Aerospace

Page 5: LabVIEW Proficiency Workshop 1

Lego Mindstorms NXT

Page 6: LabVIEW Proficiency Workshop 1

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/

Page 7: LabVIEW Proficiency Workshop 1

LabVIEW Certification

Page 8: LabVIEW Proficiency Workshop 1

Free Weekly LabVIEW Workshop

7 Workshops

x

1 hour Proficiency + 1 hour CLAD

=

2 months of workshops

(with weekly sessions)

Page 9: LabVIEW Proficiency Workshop 1

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)

Page 10: LabVIEW Proficiency Workshop 1

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

Page 11: LabVIEW Proficiency Workshop 1

Today's Topics

What is LabVIEW?

LabVIEW Environment LabVIEW Project

Parts of a VI

Menus & Palettes

Configurations

LabVIEW Data Types

LabVIEW Data Flow

Page 12: LabVIEW Proficiency Workshop 1

Today's Topics

What is LabVIEW?

LabVIEW Environment LabVIEW Project

Parts of a VI

Menus & Palettes

Configurations

LabVIEW Data Types

LabVIEW Data Flow

Page 13: LabVIEW Proficiency Workshop 1

Laboratory Virtual Instrumentation Engineering Workbench

What is LabVIEW?

Page 14: LabVIEW Proficiency Workshop 1

• Compiled graphical development environment

• Development time reduction of four to ten times

• Tools to acquire, analyze, and present your data

What is LabVIEW?

Page 15: LabVIEW Proficiency Workshop 1

Measurement and automation application

Page 16: LabVIEW Proficiency Workshop 1
Page 17: LabVIEW Proficiency Workshop 1

Start»All Programs»National Instruments LabVIEW 2009

Start from a blank VI:New»Blank VI

Start from an example:Examples»Find Examples…

»

or

Open and Run LabVIEW

Page 18: LabVIEW Proficiency Workshop 1

Today's Topics

What is LabVIEW?

LabVIEW Environment LabVIEW Project

Parts of a VI

Menus & Palettes

Configurations

LabVIEW Data Types

LabVIEW Data Flow

Page 19: LabVIEW Proficiency Workshop 1

Use LabVIEW Projects to:• Group LabVIEW files and non-LabVIEW files

• Create build specifications (i.e. stand-alone applications)

• Deploy or download files to targets (i.e. FPGA target)

19

Project Explorer Right Click!

Page 20: LabVIEW Proficiency Workshop 1

Virtual Instrument (VI)

A LabVIEW Program

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

Page 21: LabVIEW Proficiency Workshop 1

VI

Front Panel Block DiagramIcon and Connector

Pane

Page 22: LabVIEW Proficiency Workshop 1

1. Front PanelUser interface (UI)

– Controls = inputs– Indicators = outputs

2. Block DiagramGraphical 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)

Page 23: LabVIEW Proficiency Workshop 1

1. Front PanelUser interface (UI)

– Controls = inputs– Indicators = outputs

2. Block DiagramGraphical source code

– Data travels on wires from control terminals through functions to indicator terminals

– Blocks execute by data flow3. Icon/Connector Pane

• Graphical representation of a VI• Means of connecting VIs (subVIs)

Virtual Instrument (VI)?

Page 24: LabVIEW Proficiency Workshop 1

Answer: a LabVIEW program

1. Front PanelUser interface (UI)

– Controls = inputs– Indicators = outputs

2. Block DiagramGraphical 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)?

* Conn. pane available from FP only

Page 25: LabVIEW Proficiency Workshop 1

Demonstration: Creating a new VI

Page 26: LabVIEW Proficiency Workshop 1

Front Panel Front panel Toolbar

Page 27: LabVIEW Proficiency Workshop 1

Controls Palette

• Contains Controls and Indicators.

• Customize the view.

Front Panel

Page 28: LabVIEW Proficiency Workshop 1

Demonstration: Front Panel Controls Palette

Page 29: LabVIEW Proficiency Workshop 1

Front Panel Controls and IndicatorsNumeric Boolean

String

Page 30: LabVIEW Proficiency Workshop 1

Demonstration: Front Panel Controls and Indicators

Page 31: LabVIEW Proficiency Workshop 1

Shortcut Menus and Properties DialogRight Click!

Page 32: LabVIEW Proficiency Workshop 1

Demonstration: Front Panel Shortcut Menus & Properties Dialog

Page 33: LabVIEW Proficiency Workshop 1

Front Panel Toolbar

Run

Run Continuously

Abort

Pause

Text Settings

Align Objects

Distribute Objects

Resize Objects

Reorder

Context Help

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

Page 34: LabVIEW Proficiency Workshop 1

Block Diagram Block Diagram Toolbar

Page 35: LabVIEW Proficiency Workshop 1

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 text- based programming languages

Control Indicator

Constants

Page 36: LabVIEW Proficiency Workshop 1

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

Page 37: LabVIEW Proficiency Workshop 1

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

Page 38: LabVIEW Proficiency Workshop 1

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

Page 39: LabVIEW Proficiency Workshop 1

Demonstration: Block Diagram Terminal

Page 40: LabVIEW Proficiency Workshop 1

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

Block Diagram

Scalar1D Array2D Array

DBL Integer Numeric Numeric String

Page 41: LabVIEW Proficiency Workshop 1

• 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

Block Diagram: Wiring Tips

Page 42: LabVIEW Proficiency Workshop 1

Numeric Controls and Functions(Front Panel) From the

Controls»Modern»Numeric subpalette, select the Numeric Control icon.

(Block Diagram) From the Functions»Programming»Numeric subpalette, select the Add icon.

Page 43: LabVIEW Proficiency Workshop 1

Mathematical Operations(Block Diagram) From the Functions»Mathematics»Integration and

Differentiation subpalette, select the Derivative x(t).vi

Page 44: LabVIEW Proficiency Workshop 1

Boolean Controls and Functions(Front Panel) From the

Controls»Modern»Boolean subpalette, select the Push Button icon.

(Block diagram) From the Function»Programming»Boolean subpalette, select the OR icon.

Page 45: LabVIEW Proficiency Workshop 1

String Controls and Functions(Front Panel) From the

Controls»Modern»String subpalette, select the String Control icon.

(Block diagram) From the Function»Programming»String subpalette, select the Concatenate icon.

Page 46: LabVIEW Proficiency Workshop 1

Demonstration : Using the Functions and Controls Palette

Page 47: LabVIEW Proficiency Workshop 1

Block Diagram Toolbar

Run

Run Continuously

Abort

Pause

Highlight Execution

Retain Wire Values

Step In

Step Over

Step Out

Text Settings

Align Objects

Distribute Objects

Resize Objects

Reorder

Clean Up Block Diagram

Context Help

Block Diagram

Page 48: LabVIEW Proficiency Workshop 1

Demonstration: Searching for controls, VIs, Functions.

Page 49: LabVIEW Proficiency Workshop 1

Tools PaletteOperating 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.

Page 50: LabVIEW Proficiency Workshop 1

Tools PaletteOperating 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.

Page 51: LabVIEW Proficiency Workshop 1

Tools PaletteOperating 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.

Page 52: LabVIEW Proficiency Workshop 1

Tools PaletteOperating 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.

Page 53: LabVIEW Proficiency Workshop 1

Tools PaletteObject 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

Page 54: LabVIEW Proficiency Workshop 1

Tools PaletteObject 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

Page 55: LabVIEW Proficiency Workshop 1

Tools PaletteObject 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

Page 56: LabVIEW Proficiency Workshop 1

Tools PaletteObject 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

Page 57: LabVIEW Proficiency Workshop 1

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.

Page 58: LabVIEW Proficiency Workshop 1

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.

Page 59: LabVIEW Proficiency Workshop 1

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.

Page 60: LabVIEW Proficiency Workshop 1

Today's Topics

What is LabVIEW?

LabVIEW Environment LabVIEW Project

Parts of a VI

Menus & Palettes

Configurations

LabVIEW Data Types

LabVIEW Data Flow

Page 61: LabVIEW Proficiency Workshop 1

Common Data Types Found in LabVIEW

Page 62: LabVIEW Proficiency Workshop 1

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

Page 63: LabVIEW Proficiency Workshop 1

Today's Topics

What is LabVIEW?

LabVIEW Environment LabVIEW Project

Parts of a VI

Menus & Palettes

Configurations

LabVIEW Data Types

LabVIEW Data Flow

Page 64: LabVIEW Proficiency Workshop 1

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

Page 65: LabVIEW Proficiency Workshop 1

Data Flow

Which code segment would execute first??

Page 66: LabVIEW Proficiency Workshop 1

Try it yourself : Creating a simple VI

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

Page 67: LabVIEW Proficiency Workshop 1

Homework

Page 68: LabVIEW Proficiency Workshop 1

Homework

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

Page 69: LabVIEW Proficiency Workshop 1

Homework

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

Page 70: LabVIEW Proficiency Workshop 1

Homework

Pass a word from a string control to a string indicator

Page 71: LabVIEW Proficiency Workshop 1

Homework

Turn 2 LEDs on using push buttons.

Page 72: LabVIEW Proficiency Workshop 1

Thank you!

Visit ni.com/utm to get this

presentation slide