labview 7.1 寒假短期教學課程

62
1 LabVIEW 7.1 寒寒寒寒寒寒寒寒 寒寒寒寒 2006/02/06

Upload: kai-clayton

Post on 30-Dec-2015

484 views

Category:

Documents


4 download

DESCRIPTION

LabVIEW 7.1 寒假短期教學課程. 歐陽丞修. 2006/02/06. LabVIEW 簡介. LabVIEW (Laboratory Virtural Instrument Engineering Workbench ) 虛擬儀表 (VI,Virtual Instrument) 量測 、 呈現與分析資料 G 語言 (Graphic Language). 虛擬儀表 (Virtual Instrument). Virtual instrument has all main properties of the real one, - PowerPoint PPT Presentation

TRANSCRIPT

1

LabVIEW 7.1 寒假短期教學課程

歐陽丞修

2006/02/06

寒假短期訓練課程Lab 303

2

LabVIEW 7.1

LabVIEW 簡介

LabVIEW (Laboratory Virtural Instrument Engineering Workbench )

虛擬儀表 (VI,Virtual Instrument) 量測、呈現與分析資料 G 語言 (Graphic Language)

寒假短期訓練課程Lab 303

3

LabVIEW 7.1

虛擬儀表 (Virtual Instrument)• Virtual instrument has all main properties of the real one, being „only” computer program.

寒假短期訓練課程Lab 303

4

LabVIEW 7.1

Virtual Instrumentation With LabVIEW

人機介

面程式方

寒假短期訓練課程Lab 303

5

LabVIEW 7.1

開啟 LabVIEW 開始 => 程式集 =>National Instrument LabVIEW 7.1

寒假短期訓練課程Lab 303

6

LabVIEW 7.1

開啟新 VI

寒假短期訓練課程Lab 303

7

LabVIEW 7.1

程式方塊圖

人機介面

Front Panel

Block Diagram

寒假短期訓練課程Lab 303

8

LabVIEW 7.1

建立 VI 程式

工具面板

控制面板

狀態面板

寒假短期訓練課程Lab 303

9

LabVIEW 7.1

Operating Tool

Positioning/Resizing Tool

Labeling Tool

Wiring Tool

Shortcut Menu Tool

• Floating Palette• Used to operate and modify

front panel and block diagram objects.

Scrolling Tool

Breakpoint Tool

Probe Tool

Color Copy Tool

Coloring Tool

工具面版

Automatic Selection Tool

寒假短期訓練課程Lab 303

10

LabVIEW 7.1

Run Button

Continuous Run Button

Abort Execution

Pause/Continue Button

Text Settings

Align Objects

Distribute Objects

Reorder

Resize front panel objects

Execution Highlighting Button Step Into Button

Step Over Button

Step Out Button

Additional Buttons on the Diagram Toolbar

狀態面版

寒假短期訓練課程Lab 303

11

LabVIEW 7.1

LabVIEW 介面 控制元 (Input) 與顯示元 (Output)

Front Panel

寒假短期訓練課程Lab 303

12

LabVIEW 7.1

控制元接點 接線 節點 顯示元接點

Block Diagram

寒假短期訓練課程Lab 303

13

LabVIEW 7.1

程式方塊之接線型式

Floating-point Number

橘色

Interger Number 藍色

Boolean 綠色

String 粉紅色

寒假短期訓練課程Lab 303

14

LabVIEW 7.1

Wiring Tips – Block Diagram

Wiring “Hot Spot”

Clean Up Wiring

Use Automatic Wire Routing

Click To Select Wires

寒假短期訓練課程Lab 303

15

LabVIEW 7.1

數值運算

寒假短期訓練課程Lab 303

16

LabVIEW 7.1

布林運算

寒假短期訓練課程Lab 303

17

LabVIEW 7.1

比較運算

寒假短期訓練課程Lab 303

18

LabVIEW 7.1

簡易計算機練習

寒假短期訓練課程Lab 303

19

LabVIEW 7.1

簡易計算機練習

寒假短期訓練課程Lab 303

20

LabVIEW 7.1

建立子程式 (SubVIs)

A SubVI is a VI that can be used within another VI

Similar to a subroutine Advantages

Modular Easier to debug Don’t have to recreate code Require less memory

寒假短期訓練課程Lab 303

21

LabVIEW 7.1

Steps to Create a SubVI

Create the Icon Create the Connector Assign Terminals Save the VI Insert the VI into a Top Level VI

寒假短期訓練課程Lab 303

22

LabVIEW 7.1

建立子程式 (SubVI)

寒假短期訓練課程Lab 303

23

LabVIEW 7.1

建立子程式 (SubVI)

寒假短期訓練課程Lab 303

24

LabVIEW 7.1

呼叫子程式

寒假短期訓練課程Lab 303

25

LabVIEW 7.1

呼叫子程式

若為常數有何好

SubVI 內容

寒假短期訓練課程Lab 303

26

LabVIEW 7.1

呼叫子程式

寒假短期訓練課程Lab 303

27

LabVIEW 7.1

架構 - 迴圈控制

寒假短期訓練課程Lab 303

28

LabVIEW 7.1

迴圈種類 C語言 for (i=0;i<10;i++)

{

}

i=0; while (i<10) { … i++; }

For Loop While Loop

i=0; do { … i++; } while (i<10)

Do … While Loop

寒假短期訓練課程Lab 303

29

LabVIEW 7.1

For Loop

次數 (N)

目前執行完畢的迴圈數

寒假短期訓練課程Lab 303

30

LabVIEW 7.1

For Loop

(0~N-1)

for (i=0;i<10;i++) { … }

位移暫存器

寒假短期訓練課程Lab 303

31

LabVIEW 7.1

位移暫存器

寒假短期訓練課程Lab 303

32

LabVIEW 7.1

For Loop

結果有何差異 ??

寒假短期訓練課程Lab 303

33

LabVIEW 7.1

While Loop

目前執行的迴圈次數 狀態接點

寒假短期訓練課程Lab 303

34

LabVIEW 7.1

While Loopi=0; while (i<10) { … i++; }

i=-1; do { … i++; } while (i<10)

寒假短期訓練課程Lab 303

35

LabVIEW 7.1

While Loop

錯誤 !! 正確 !!

寒假短期訓練課程Lab 303

36

LabVIEW 7.1

While Loop

等效

寒假短期訓練課程Lab 303

37

LabVIEW 7.1

圖形函式

寒假短期訓練課程Lab 303

38

LabVIEW 7.1

For Loop & While Loop 練習

寒假短期訓練課程Lab 303

39

LabVIEW 7.1

For Loop & While Loop 練習

寒假短期訓練課程Lab 303

40

LabVIEW 7.1

模擬雜訊

寒假短期訓練課程Lab 303

41

LabVIEW 7.1

模擬雜訊

寒假短期訓練課程Lab 303

42

LabVIEW 7.1

Case structure

寒假短期訓練課程Lab 303

43

LabVIEW 7.1

Case structure

寒假短期訓練課程Lab 303

44

LabVIEW 7.1

Case structure

if (Number >= 0) then Square Root Value= SQRT (Number)else Square Root Value = -99999 Display Error Messageend if

寒假短期訓練課程Lab 303

45

LabVIEW 7.1

Case structure 應用

寒假短期訓練課程Lab 303

46

LabVIEW 7.1

Case structure 應用

寒假短期訓練課程Lab 303

47

LabVIEW 7.1

Formula Node

寒假短期訓練課程Lab 303

48

LabVIEW 7.1

Formula Node

寒假短期訓練課程Lab 303

49

LabVIEW 7.1

Formula Node

寒假短期訓練課程Lab 303

50

LabVIEW 7.1

Sequence Structure

Stacked Sequence Structure Flat Sequence Structure

寒假短期訓練課程Lab 303

51

LabVIEW 7.1

Stacked Sequence Structure

逐頁執行…

寒假短期訓練課程Lab 303

52

LabVIEW 7.1

Stacked Sequence Structure

寒假短期訓練課程Lab 303

53

LabVIEW 7.1

Flat Sequence Structure

由左而右逐頁執行…

寒假短期訓練課程Lab 303

54

LabVIEW 7.1

Event Structure

寒假短期訓練課程Lab 303

55

LabVIEW 7.1

Adding an ArrayFrom the Controls >> All Controls >> Array and

Cluster subpalette, select the Array Shell

Drop it on the screen.

寒假短期訓練課程Lab 303

56

LabVIEW 7.1

Adding an Array (cont.)

Place data object into shell (i.e. Numeric Control)

寒假短期訓練課程Lab 303

57

LabVIEW 7.1

Creating an Array with a Loop

寒假短期訓練課程Lab 303

58

LabVIEW 7.1

Creating 2D Arrays

寒假短期訓練課程Lab 303

59

LabVIEW 7.1

Creating an Array with a Loop

寒假短期訓練課程Lab 303

60

LabVIEW 7.1

Formula Node

寒假短期訓練課程Lab 303

61

LabVIEW 7.1

Thanks for your attention!

寒假短期訓練課程Lab 303

62

LabVIEW 7.1

參考資訊 Example programs (Help» Find Examples…) LabVIEW Student Edition

(www.ni.com/labviewse) Web resources (ni.com)

NI Developer Zone (zone.ni.com)Application Notes Info-labview newsgroup (www.info-labview.org/) Instrument Driver Library (www.ni.com/idnet)