You are on page 1of 88

LabVIEW

LabVIEW
LabVIEW
LabVIEW
LabVIEW
LabVIEW
VI VI

VI
Chart


While

For
Case



Waveform






Polymorphism?


VI


Waveform

Graph
Chart
XY XY Graph
Intensity Graph

Digital Waveform Graph


3D 3D Graph
I/O

/I/O
I/O

datalog file








Buffers
Triggering
I/OAnalog I/O

Analog I/O
Analog I/O
I/ODigital I/O


PCI-MIO-16E-4





FFT




LabVIEW

VI

LabVIEW
1
virtual instrumention

NI LabVIEW
20 70
PC Microsoft
Windows NI Macintosh LabVIEW2.0
LabVIEW
PC
VXI

VXI
VXI
PXI

IEEE 488 GPIB


2 LabVIEW
LabVIEWLaboratory Virtual instrument Engineering

LabVIEW GPIBVXIRS-232 RS-485


TCP/IPActiveX

LabVIEW

LabVIEW
LabVIEW WindowsUNIXLinuxMacintosh
3 LabVIEW
3 LabVIEW
LabVIEW VIfront panel
block diagram/(icon/connector)

VI
controlindicator
1 VI

()

()

VI VI

While Loop

VI
VI

/
VI VI VIsubVI
VI
LabVIEW
LabVIEW Tools
ControlsFunctions

Tools Palette
VI
Windows Show Tools Palette

Windows Show Help Window


Sub VI

LabVIEW

Operate
Value

Position/Size/Sele
ct

Edit Text

Connect Wire

Object Shortcut
Menu

Scroll Windows

VI

Set/Clear
Breakpoint

Probe Data

Get Color

Set Color

Control Palette

Windows Show Controls Palette

Numeric

Boolean

String & Path

Array & Cluster

List & Table

10

11
12
13
14
15

Graph
Ring & Enum

I/O/ / OLEActiveX

Refnum

Digilog
Controls

Classic

Controls

Activex
ActiveX
Decorations

Select
a
Controls

User
Controls

(Functions Palette)


Windows Show Functions Palette

Structure

Numeric

Boolean

String

()

Array

Cluster

Comparison

Time & Dialog

File I/O
/
Data
Acquisition

Waveform

Analyze

Instrument I/O
/

Motion & Vision

Mathematics

Communication

Application
Control

Graphics & Sound

Tutorial

Report
Generation

Advanced

GPIB(488488.2)VXI
VISA

TCPDDEActiveX OLE
VI

3DOpenGL
CIN
LabVIEW

Select a VI
VI
User Library
VI

LabVIEW
VI VI
VI

VI VI

FileNew
ControlsNumeric Tank

0.0 1000.0
a. Text Edit Tool
10.0
b. 1000
0.0 1000.0

Visible
ItermsDigital Display
ControlsNumeric
, 0 100


WindowsShow Diagram

a. FunctionsNumeric
c
b. Process Monitor VI
LabVIEW\Activity FunctionsSelect a VI
Process Monitor
LabVIEW Program Files\National Instruments\

VI
Create Constant

FileSave, VI LabVIEW\Activity
Temp & Vol.vi
Run VI

FileClose VI
-

VI
Help Show Help VI
VI Help

Indicator
Control

LabVIEW
DBL
TF I16
16 ABC

Chang to Control,
Chang to Indicator ,

<Delete> EditRemove Bad Wires


<Ctrl-B> VI Signal has
Loose Ends

1
VI
LabVIEW
Find
2
LabVIEW
VI

10

VI

4
Tools

VI
VISubVI VI VI
VI VI
FunctionsSelect a VI. VI VI

VI
Edit Icon


VI VI

VI

11

Show Connector
LabVIEW

VI

Show Connector Patterns

VI

LabVIEW\Activity Temp & Vol.vi


Edit Icon.

Select Tool
<Delete>
Pencil Tool
Text Tool


OK
Show
ConnectorLabVIEW

Rotate 90
Degrees 90

12


a.
b.
/

c. a b
d. Show Icon.
FileSave VI
VI VI VI
VI VI VI

chart
chart


ControlsGraph

AdvancedUpdate Mode

Strip chart
Scope chart Sweep chart

1-3

VI
1
sin(i) chart
chart strip

13

sin(x)
10

100

stop


2 chart, AdvancedUpdate Mode

VI

VI

1-3

LabVIEW

Examples\General\
Graphs\charts.llb charts.vi

LabVIEW
Create
Indicator

3.14

sin(x)

cos(x)

14

15


While
While
Do Repeat-Until
While
FALSE

0 i=0
i+1
i=0

While

While
While
VI
0 10
VI
VI

4.0

1.0
0.8

6.0

2.0

0.6

8.0

0.0

0.4
0.2

10.0

0.0
0

ON
OFF

1023


1 FileNew
2 ControlsBoolean


3 ON OFF
4 ControlsGraph
chart graph

5 0.0 1.0
10.0 1.0
6 ControlsNumeric
While


a. FunctionsStructures While

b. Functions Numeric 0-1

c. Wait Until Next ms Multiple


FunctionsTime & Dialog
0 10
d.
While

8
9 VI LabVIEW\Activity Random
Signal.vi
10
VIWhile

TRUE

11
VI
FALSE
12
Data

OperationsClear Chart

6
Mechanical Action LabVIEW
Examples\General\Controls\booleans.llb Mechanical Action of
Booleans.vi

Shift Register

Add Shift Register

Shift Register

Add Element


VI

0.0 2.0
Mechanical
ActionLatch When Pressed OperateMake Current Values Default ON

Boolean
ON
OFF
ON

Latch When
Pressed

2.0
1.5
1.0
0.5
0.0
0

50

0.5
4.00

500
Boolean


While (FunctionsStructures)
a. While Add Shift Register

b. Add Element

Random Number (01)FunctionsNumeric 0 1


Compound Arithmetic FunctionsNumeric

Add Input
FunctionsNumeric

FunctionsNumeric While Random Number (01)


VI
Random Number (01) 4

Wait Until Next ms Multiple FunctionsTime & Dialog


500
VisibleLabel Wait Until Next ms Multiple

Wait Until Next ms Multiple


Create Constant
Constant 500 500
VI

VI
VI LabVIEW\Activity Random Average.vi

0.5

For
For While

For
100

For For

N:
I:
100
For i 0 99
2-3 For
For

a.

b.
0.0 1.0
c. Visible ItemsScrollbar
Digital Display Plot Legend
d.

100

5 3

For
FunctionsStructures
For
Add Shift Register
6


a Random Number (01)FunctionsNumeric
0 1
b FunctionsNumeric
0
c Max&Min FunctionsComparison

d FunctionsNumericFor
100

VI
VI LabVIEW\Activity Calculate
Max.vi
2-3

Case
Case Case,

Case
Case

TureFalse

False

- Case
VIVI

Number

Number

Number

SQRT

2.00

1.41

True
SQRT

False
SQRT
-999.00

Errot...


3. FunctionsStructures Case
Case
Ture
a Greater Or Equal To 0? FunctionsComparison
0 TRUE
b Square Root FunctionsNumeric

c
d Case False
e FunctionsNumeric
-999.00
f One Button Dialog FunctionsTime &
Dialog
Error...
g (FunctionsString) Edit Text
Tools
h VI TRUE FALSE
0VI TRUE Case
999.00 Error...
4. VI Number

LabVIEW Case FALSE

Case
5. VI LabVIEW\Activity Square
Root.vi
VI

if (Number >= 0) then


Square Root Value = SQRT(Number)
else
Square Root Value = -999.00
Display Message "Error.. "
end if
-

Sequence Structure
LabVIEW
ABCD

A
B

C

ABC D
D D ABC
LabVIEW ABC

0 1 Case

-
VI

1.


50

50

0.00


100

0 [0..2]

1 [0..2]

100.00

2 [0..2]

1000.00


(FunctionsStructures)

10


Add
Frame After

0
Add Sequence Local

Tick Count (ms) FunctionsTime &


Dialog

Round to Nearest FunctionsNumeric


0 100
Not Equal?Functions Comparison

TRUE FALSE
Increment FunctionsNumeric
While 1

0 Tick Count ms

1
VI While 2 Tick Count ms
VI
0

Number to Match
VI

VI LabVIEW\Activity Time to
Match.vi
2-5

Data Range :

11

Formula Node

FunctionsStructures

2
y = x + x + 1

0
Add Input (Add Output)

12


C
C

X X
Y X Y -99
if (x >= 0) then
y = sqrt(x)
else
y = -99
end if

input

output

Y=(X>=0)?sqrt(X):-99;
Y

X,Y
sqrt(X)
2-6
VI
3
2
y1 = x x + 5
y2 = m* x + b
x 0 10

Waveform Graph
m
30.00

1000.0

y1

800.0

y2

600.0
b

400.0

20.00
200.0
0.0
0

10


1.

13

VI m b

2.

Add Input Add


Output
x 0 10 10 11

Build Array FunctionsArray

3. m b VI
4. VI LabVIEW/Activity
Equations.vi

2-6

14

31
2 1
0 n 1 n

0 1


Cluster
C stuct

VI
Waveform


shell

FunctionsArrayArray Constant

ABC
Array Constant
0

Array Constant
0

ABC

Array Constant
0

ABC

Controls
Array & Cluster

Examples\General\arrays.llb

For While

For

Disable
Indexing

For Graph


1.
2. ControlsArray & Cluster
Waveform Array
3. ControlsNumeric
2

4. ControlsGraph
Waveform Graph
5.
6. Y
ScaleAutoscale Y
7. Y -0.5 1.5

8.
100

Delta X
1

X0
0
Waveform Graph

Waveform Array


FunctionsSelect a VI
LabVIEW\activity Generate Waveform
VI VI

Generate Waveform VI

For
For
100
Bundle Functions Cluster

FunctionsNumeric
For N=100 X=0 delta X=1
9. VI VI

10. X delta 0.5X 20


VI 100
20X delta 0.5 X
11.


X delta
X X 0delta X 1
X
delta X

X Delta X
12. Bundle

<Delete> EditRemove Bad Wires

13. VI X delta X 1

Array

100

Waveform Graph
Build Array
50
0.5


14.

FunctionsNumericTrigonometric
For

Pi FunctionsNumericAdditional
Numeric Constants
Build Array FunctionsArray

15. VI
X 0delta X
1
16. VI LabVIEW\Activity Graph
Waveform Arrays.vi
17.

Plot 0

Waveform Graph
1.5
Array
0

-0.09

1.0

0.5
0.0
-0.5
0

10

20

30

40

50

60

70

80 90 100



100
For 100


ExamplesFundamentals Graphs
and ChartsGraph ExamplesWaveform Graph

VI For
1.

FileOpen

Examples\General\arrays.llb Separate Array Values


VI
2. TRUE FALSE

0.0

Initialize
Array

True
Positive Array

0
Build Array

Negative Array

Input Array

0.0

Initialize
Array

False
Build Array

Positive Array

0
Negative Array
Input Array

Input Array For


For
For

3. VI 4
4
4. 5 For
VI

3 2
N

5. VI

A
BCSbr Scr B
C Sbl Scl B C
size ins

B=0
C=0

K=size(A(.))
For i=0 to k-1

p=A(i)
if p>=0 then
Ins p,Sbr

Else
Ins p,Scr
end if
Sbl=Sbr

Scl=Scr
Next i
B=Sbr

C=Scr
Print B

Print C
End

LabVIEW
FunctionsArray Replace Array Element,Search 1D
ArraySort 1D Array Reverse 1D Array Multiply Array
Elements

Build Array FunctionsArray

Build Array

Add Element Input Add Array Input

Remove Input

5
3x3
3, 4, 7; 1, 6, 2; 5, 2, 8.

1 1 2 2 3

Initialize Array

5 100 100
5

Add Dimension

Remove Dimension

Array Size

Array Subset

Index Array

0 2

Index Array Index Array 2


Index Array Index Array 3
Disable Indexing
Constant Control
Constant Control

0
1
2

0 3

10


1
2. ControlsNumeric
scalar 1
3.
scalar 2 scalar 3
4. array
1 array 2
5. array 1scalar 1 scalar 2scalar 3array
2 1 9
6. FunctionsArray
Build Array
5
7. Build Array
array 1scalar 1 scalar 2array 2scalar
3
8. VI array 1scalar 1 scalar 2
scalar 3array 2
9. VI LabVIEW\Activity Build
Array.vi

Polymorphism?

LabVIEW
Add

11

G G

Online
ReferenceFunction and VI Reference


Cluster shell

Control
Control Indicator
Control Indicator
Control Indicator

Control

Autosizing
Order
0 1

Claster Order

12

VI
VI 28 28

Bundle
Bundle

Bundle Claster

Unbundle
Unbundle Bundle

LabVIEW

Input Cluster

Output Cluster

Numeric

Numeric

6.00

6.00

Boolean1 Boolean 2

Boolean1 Boolean 2

String

stop
STOP

String

Tsinghua

Tsinghua

Input Cluster

Unbundle

Bundle

Output Cluster

stop

Not


Array & Cluster palette Input Cluster

Control Control
Output Cluster Control indicator

13


[STOP] FALSE
[STOP] NOT
FALSE NOT TRUE

VI
Cluster Exercise.vi

Cluster Bundle Unbundle


Bundle By Name Unbundle By Name
Bundle Bundle By Name
Bundle By Name
Unbundle
Boolean 2 Bundle By Name
Unbundle By Name
Cluster Control
Numeric
0.00

Output Element
Numeric
0.00

String
TSINGHUA

Cluster Control
String Control

String

Output Element
String

ABCD
String Control
ABCD


Cluster Control Numeric
String
ABCD


LabVIEW

Reverse 1D Array
Cluster to Array
Reverse 1D Array Array
to Claster

Waveform

14

LabVIEW 6i Waveform
Waveform (Y)(t0)
X Waveform Build Waveform
VI Waveform
Waveform Waveform Graph Chart Waveform

Waveform VI
Functions Waveform Analyze

Waveform
Waveform Sine
Waveform Sine Waveform
VI LabVIEW 6i

15



LabVIEW

LabVIEW
LabVIEW Graph Chart Chart

Graph

Graph
LabVIEW Graph

Waveform
XY
Intensity
Digital
3D Surface
3D Parametric
3D Curve

Chart
*
*

Graph
*
*
*
*
*
*
*

Chart Graph
LabVIEW i
Plot

Graph
Graph
Visible Items

(Label)

(Caption)

(Graph Palette)

(Scale Legend)

(Cursor Legend)

4-1 Graph
Chart
Chart
Chart
1024

(Scrollbar)

(Digital Display)

(Update Mode)
Chart
Strip Chart Mode

Scope Chart Mode

Sweep Chart Mode

Stack Plots

\LabVIEW\Examples\Graphs\chart.lib Charts.vi Chart

Chart Graph
VI Chart Graph 40

40
Waveform Chart
Waveform Graph

100

Chart Graph
Chart
Graph 40

For 40 40
For For
Graph


XY XY Graph
Waveform Graph X Y
Y X XY
Graph XY

45 90

XY Graph

XY Graph
XY Graph
Sine Waveform.vi

t0dt Y XY Graph Y
Get Waveform Components Y
XY Graph 45

Intensity Graph

x
y


Digital Waveform Graph


Digital Waveform
Graph
11111111
00000001 00000010

X0
0.00
DeltaX
1.0
Digital Waveform Graph

Number of Ports
1

Digital Waveform Graph


Digital Waveform Graph bundle
x0deltx Number of Ports Number of
Ports

3D 3D Graph

I/O

ASCII LabVIEW
Examples\General\strings.llb


ControlsString & Table

control

Header
SET

SET 5.5000 VOLTS

Number
5.50

16

Trailer
VOLTS

GPIBIEEE 488
RS-232 RS-422

Header

Number

%s %.4f %s

Trailer

Format Into String FunctionsString

String Length FunctionsString

VIFormat Into String

VI Build String.vi VI
Format Into String Edit
Format String

Examples\General\strings.llb Parse String.vi VI


DC
0

String Subset FunctionsString


0

Scan From String FunctionsString


0 9,eE

string 0
VOLTS DC
FileClose VI

/I/O

I/O
ASCII

ASCII
ASCII ASCII

ASCII
I/O Examples\File
I/O
I/O
LabVIEW Functions File I/O
VI 9 VI VI
I/O

Write To Spreadsheet File VI


VI

Read From Spreadsheet File VI


VI

Write Characters To File VI


VI
Read Characters From File VI
VI
Read Lines From File VI
VI
I/O FunctionFile I/O Binary File VIs
FunctionFile I/OAdvanced File Functions

Tab EOL

Excel


VI I/O ASCII

Graph Waveform Arrays.vi VI VI


VI

Array
0

-0.09

Waveform Graph
1.5

Plot 0
Plot 1

1.0
0.5
0.0
transpose? (no:F)
-0.5
0

10

20

30

40

50

60

70

80

90 100

don't transpose

Graph Waveform Arrays.vi


Write To Spreadsheet File VI FunctionsFile I/O

VI

Array

100

Build Array

Waveform Graph

50
0.5

transpose? (no:F)

Boolean FunctionsBoolean

VI
OK

VI Waveform Arrays to File.vi VI

100

I/O VI



VI ASCII VI For

20

Chart
84.96

90.0
85.0
80.0

append to file?
new file

75.0
70.0
39

59

Y
70.0 90.0X 0 20

%f,
append to file?

Chart

For VI

Empty Path FunctionsFile I\OFile Constants

Digital Thermometer VIFunctionsSelect a VI

Format Into String FunctionsString

Write Characters To File VI(FunctionsFile I/O)

Boolean FunctionsBoolean Write Characters To File VI append to


file? TRUE,
TRUE
20 VI
VI

VI LabVIEW\Activity Write Temperature to File.vi


Write for WindowsTeach Text for Macintosh
UNIX
20



VI

ASCII I/O

87.402344,
86.914062,
86.425781,
85.937500,
85.449219,
85.449219,
84.960937,
84.472656,
83.984375,
83.984375,
83.984375,
83.984375,

Graph
100.0
90.0
80.0
70.0
60.0
50.0
0

10

Read Characters From File.vi

Graph

Read Characters From File VIFunctionsFile I/O

512
Read Characters From File VI

Extract Numbers VI (Examples\General\strings.llb)


ASCII

VI
Write Temperature to File VI
VI Temperature from File.vi


datalog file
ASCII

datalog file

VI ASCII

Write Datalog File Examples\File\datalog.llb

Read
Datalog File Write Datalog File

AC: Alternating Current


DC: Direct Current
ADC: Analog-to-Digital Conversion A/D
DAQ: Data Acquisition
DMA: Direct Memory Access

GPIB: General Purpose Interface Bus IEEE 488.2

SCXI: Signal Conditioning extensions for Instrumention,


VISA: Virtual Instrument Standard Architecture
GPIBVXIRS-232

DAQ
Buffer Buffer

Buffers
PC DAQ FIFO

Buffer
Buffer DAQ DMA

Buffer

Buffer I/O

AC >10

Buffer I/O


Triggering
DAQ

/ DAQ

trigger out
DAQ

DAQ

DAQ

DAQ
DAQ VI Buffer Buffer I/O

I/OAnalog I/O

DAQ VI AI Acquire Waveform.vi

device NI DAQ LabVIEW


DAQ VI
VI

samples A/D

channel
LabVIEW VI

5
0 4
18 10 13

5
0:4
1,8,10:13

scan
waveform
waveform
scan waveform scan
waveform

high limit low limit


10V -10V DAQ 5 -5V
2 1 -1V 10

High Limit|-|Low limit|

LabVIEW
0.5,1,2,5,10,20,50,100

taskIDI32 DAQ VI
I/O DAQ VI taskID in taskID out VI
taskID VI
VI taskID out VI

Analog I/O
LabVIEW DAQ VI

Analog Input

VI

wareform

Analog Output

VI


Update rate
2 1

Meter
0.2

0.4 0.6

0.8

0.0

Meter

1.0

0.5V DAQ 0

Meter 0.5V

Waveform Graph

1.5

Plot 0

0:1

400

Plot 1

1.0
0.5
0.0
-0.5


100000.00

-1.0
0.0

20000000.0

40000000.0

0
Waveform Graph

scan

graph Transpose Array AI Sample Channel


2D graph
Y
Bundle
graph I32SGL I32 SGL

scan

Acquire Multiple Channels.vi

I/O scan

A/D

1 scan/sec

ch1

ch2

ch1

ch2

scan
Analog I/O
Analog I/O DAQ

AI Sample Channel

Analog I/O
VI
VI
help

Analog Input

AI Config buffer

Device
Channel
Intput limit
Buffer size scan AI Config

Interchannel delay
AI Start

Scan rate(scan/sec)
Number of scans to acquire
AI Read AI Config

AI Single Scan
VI AI Config AI Start AI Read
AI Clear DAQ

VI AI ConfigAI Config taskID


Error cluster
VI taskID
taskID taskID VI
DAQ VI

AO Config buffer

Device

Channel
Limit settings
taskID VI
AO Write

AO Start Update rate(scan/sec)


Number of buffer iteerations
AO Clear
AO Wait
VI AO Config AO Start
AO Read
AO Clear DAQ

VI AO ConfigAO Config taskID


Error cluster
VI taskID
taskID taskID VI
DAQ VI


A/D

alias

alias frequency
fs 100HZ, 25 Hz70
Hz160 Hz 510 Hz fs/2=50 Hz
F125 Hz
30 Hz40 Hz 10 Hz F2F3 F4

ABS
ABS
F2 = |100 70| = 30 Hz
F3 = |2*100 160| = 40 Hz
F4 = |5*100 510| = 10 Hz

DAQ

a f

b 3

b 7/4f 2f

c
fs=10f
10 d

ADC

f1
f1
b
f1 f2 f1 f2
transition band
f1

VI
LabVIEW

(VI)
(VI)




LabVIEW

single_sided Nyquist (
)

VI VI VI
VI
VI
VI
VI
LabVIEW VI
LabVIEW VI VI

LabVIEW 6i Analyze
Methematics
Functions AnalyzeSignal Processing

6 VI
Signal Generation
Time Domain

Frequency Domain
Measurement
FFT

Digital Filters IIRFIR

Windowing

VI

labview\examples\analysis

examples\analysis\sigxmpl.llb
VI


DAQ

D/A
LabVIEW 6i
Waveform>>Waveform Generation Basic Function Generator.vi

VI

Hz

offset 0.0 DBL


reset signal 0 FALSE.
signal type
frequency Hz
10
amplitude 1.0
phase 0.0.
error in VI no error.
VI error out VI
status FALSE TRUE
code 0
source VI
sampling info Fs #s
Fs / 1000
#s 1000

duty cycle (%) 50%


signal out
phase out
error out error in error out
VI
VI


Hz

/
/
VI f/
0 1 0 fs 1.0
1.1 0.1 fs/2
1/2
/ 0.5 / 1/f
VI
/


FFT
DFT
DFT(FFT)
2
FFT FFT
FFTFFT fs/N fs
Analyze FFT VI Real FFT VI Complex FFT VI
VI FFT
FFT
Real FFT VI
0 Complex FFT VI Complex FFT VI

FFT
Power Spectrum VI Power Spectrum VI Vrms2

FFT FFT
FFT

HZ

t0
dt
Y

2 Array Size FFT

3 VI LabVIEW\Activity FFT_2sided.vi
4Hz=10= 100= 100 VI
== 100
10
5 5
FFT
5 10Hz, 90Hz90Hz
10Hz FFT
6=1020Hz
VI
10 20
7 fs = 100 Hz 50Hz fs/2
48Hz 48 Hz
8 52HZ 5 52
|100 52| = 48 Hz
9 30 70Hz VI
FFT
10. FFT FFT
FFT

FFT FFT 2

case

2.00

HZ

t0
dt
Y

11Hz = 30= 100= 100 VI


12 VI LabVIEW\Activity FFT_1sided.vi
13 70Hz VI 9
6-1

x(t) T()

x(t)
f0

Ripple

f0 f0

W[n]=1.0

W[n]=exp[n*lnf/N-1]
f=

W[n]=0.5cos(2n/N)

W[n]=0.54-0.46cos(2n/N)

W[n]=0.2810639-0.5208972cos(
2n/N)
+0.1980399cos(2n/N)

Kaiser-Bessel

W[n]=I()

W[n]=1-2n-N/N




LabVIEW 6i Search Examples > Fundamentals Examples
>Analysis Examples > Signal Processing > Windows Examples > Window Comparison

1000 FFT
7

Hanning
1
1 0.001
1 73.92
40.0 60.0
20.0

59.24
40.0 60.0

20.0

80.0

0.0

1.000

2
2

100.0

Hanning

None
None
Hanning

80.0

0.0

Window 2

Window 1

dB
0

100.0

-20

1 +2
Time Domain

-40

1.0

-60

0.5

-80

0.0

-100

-0.5

-120

-1.0

-140
0

10 20

30

40 50 60 70

80 90 99

50

100

150

200

255

,1
Hanning(Window 2), 1
Stop

( f1) x(t)
f1
f2=2f1,f3=3f1,f4=4f1

y(t) x(t)

x(t ) cos(wt )

x 3 (t ) 0.5 cos(wt ) 0.25[cos(wt ) cos(3wt )]


w 3w

A1
A2 A3 A4N
ANTHD

THD

A 22 A 32 ... A
A1

2
N

%THD

% THD

100 *

A 22 A 32 ... A N2
A1

LabVIEW 6i

VI
THD
stop search at Nyquist TRUE ( T) Nyquist
FALSE, VI Nyquist
signal in
export signals
none
input signal
fundamental signal
residual signal
harmonics only
highest harmonic 3
2 3 .
error in VI no error. VI
error out VI
status FALSE TRUE
code 0
source VI
advanced search
approx. fund. freq. (optional)
-1.0,
search (+/- % of Fsampl.)
exported signals
detected fundamental frequency advanced search

THD RMS
100
components level 0 (DC),
1 (), 2 (2 ),... n (n ),
measurement info cluster
uncertainty
Warning TRUE
comments Warning TRUE

0 DAQ
761Hz 1000Hz
5
THD THD

10





LabVIEW

t
t

0.001


IIR
FIR

passband ripple
stopband attenuation 0
dB

log10 10 Ai(f) and A0(f)


0.02 dB

11


60 dB

1/1000

IIR FIR

x[0] = 1 I<>0x[i] = 0impulse response


frequency response

1 0

0
FIR
IIR IIR FIR

IIR FIR IIR


FIR
FIR
IIR
IIR
FIR IIR
0 0

VI init/cont
TURE

LabVIEW

12

6-2

waveform

Lowpass

number of samples sample rate

Filtered X

90.00

2Functions AnalyzeSignal
Processing Filters Butterworth Filter.vi VI
Butterworth

filter type
0: Lowpass
1: Highpass
2: Bandpass
3: Bandstop
X
sampling freq fs X 0 1.0

13

0 Filtered X
high cutoff freq fh 0 (lowpass) 1 (highpass)

low cutoff freq fl Nyquist

0fi<0.5fs
Filtered X fi 0.125
order 0 2
init/cont FALSE (default), 0 init/cont
TRUE, VI
FALSE TRUE

Filtered X
3
DAQ 1KHz 100KHz
Lowpass
100KHz 90
6 VI

6-2

curve fitting

VI

MSE

LabVIEW
Levenberg-Marquardt


LabVIEW

14

15

FFT

Search ExamplesDemonstrationsInstrument I/O Two-Channel


Oscilloscope

digital waveform graph

Digital waveform graph


Digital control, located on the Controls numeric palette, with representation of R64 and a
label of X0.
Digital control with representation of R64 and a label of dx. Enter a value of at least >0.
Digital control with representation of I16 and a label of Ports. Enter a value of 1.
Bundle
Bundle
X0
dx
digital signal
Ports
Bundle Digital Waveform Graph

Complete the following steps to create a Formula Node.

1. structures formula Node


2. Help
3. (=)
(;)/**/, //
4.
Add Input

5. 4
6. Wire the input and output terminals of the Formula Node to their corresponding terminals on
the block diagram. All input terminals must be wired. Output terminals do not have to be
wired.


ACH(015)AISENSE AIGNDACH(015) E
ACH(015)
(PGIA) ACH(07) PGIA
ACH(15) PGIA
NRSE ( nonreferenced single-ended input )AISENSE
PGIA RSE (referenced single-ended input) DIFF
(differential)
AIGND

PGIA PCI E

PGIA

You might also like