You are on page 1of 16

Chapter 2

LabVIEW
Dr. Minhhuy Le
606-A4, EEE, Phenikaa Uni.
huy.leminh@phenikaa-uni.edu.vn

1
Outline

Chapter 2
1. LabVIEW Programming Development
2. Loops and Waveform Graphs
3. Data Files and Character Strings
4. Important Programming Structures: cases, shift registers...

Minhhuy Le, EEE, Phenikaa Uni. 2


Outline

Sensor DAQ Algorithm DAQ Output

Display

Load data
Save data

PC

Minhhuy Le, EEE, Phenikaa Uni. 3


2.1 LabVIEW Programming Development

Graph-based programming:
Graphical icons

Create VI
Create Project:
Includes many VIs

VI: Virtual Instrument

Minhhuy Le, EEE, Phenikaa Uni. 4


2.1 LabVIEW Programming Development
Switching: Ctrl + E
Graph-based programming:
Graphical icons

Front panel (interface) & Block


diagram (code)

Front panel: knobs, switches,


numeric, graphs, charts...

Block diagram: wire, functions


(VIs)...

Minhhuy Le, EEE, Phenikaa Uni. 5


2.1 LabVIEW Programming Development
Graphic-based
example
“Plus” operator
Text-based example (function)

#include<iostream.h> Variables
#include<stdlib.h>
Variables
Int main()
{
Int a, b; // Variable
cout << “Enter a, b”; Numeric:
cin >> a >> b; control
cout << (a+b) // “Plus” Numeric:
} indicator
Minhhuy Le, EEE, Phenikaa Uni. 6
2.1 LabVIEW Programming Development

➢ Front panel
▪ Controls Palette
▪ Controls, Indicators

➢ Block diagram
▪ Terminals
▪ Variables & Constant
▪ Nodes
▪ Functions palette
▪ Search for Controls, VIs &
Functions

Minhhuy Le, EEE, Phenikaa Uni. 7


2.1 LabVIEW Programming Development Front panel

Right-click on
Front panel ->
Controls pallet

Minhhuy Le, EEE, Phenikaa Uni. 8


2.1 LabVIEW Programming Development Front panel

Right-click on Front panel ->


Controls pallet
Numeric: control & indicator
can be switched (right-click)

Minhhuy Le, EEE, Phenikaa Uni. 9


2.1 LabVIEW Programming Development Front panel

Front panel (user interface): simulate instrument devices


• Controls: knobs, push buttons, numeric, ... -> Input
• Indicators: graphs, LEDS, numeric, ... -> Output

Minhhuy Le, EEE, Phenikaa Uni. 10


2.1 LabVIEW Programming Development Block diagram

Block diagram (G-code): program the front panel objects


• Terminals, variables, constants, (nodes) functions, structures, wires
• subVIs
Variables
Block diagram Front panel

Minhhuy Le, EEE, Phenikaa Uni. 11


2.1 LabVIEW Programming Development Block diagram
For Loop

Wires Indicator
Control terminals
terminals

Constant

Structure Node
(function)

Minhhuy Le, EEE, Phenikaa Uni. 12


2.1 LabVIEW Programming Development Block diagram

Terminals: Inputs or outputs


Controls = Inputs
Variables
Indicators = Outputs
Constants = Fixed values
Wires Indicator
Control terminals
Nodes: terminals
build-in functions (+,-,*,/...)
Or Vis (functions)

Constant

Structure Node
(function)

Minhhuy Le, EEE, Phenikaa Uni. 13


2.1 LabVIEW Programming Development Block diagram

Right-click
on Block
diagram
-> Functions
-> Search

Toolbox
functions
Or load VIs
Minhhuy Le, EEE, Phenikaa Uni. 14
2.1 LabVIEW Programming Development Block diagram

View Variable as Icon


Select variable -> Right
click -> View as icon Un-tick

Minhhuy Le, EEE, Phenikaa Uni. 15


2.2 Loops and Waveform Graphs Summary

Summary:
• Common tools and IDE of LABVIEW
• Front panel, block diagram, functions pallet, controls pallet

Minhhuy Le, EEE, Phenikaa Uni. 16

You might also like