Labview Numeric BooleanComparison Structure Array Cluster 2 Labview


大綱 Labview 環境介紹 數值(Numeric) 布林值(Boolean)與比較(Comparison) 結構(Structure) 陣列(Array) 叢集(Cluster) 2

Labview 簡介 Lab. VIEW全名為 Laboratory Virtual Instrument Engineering. Workbench, 是一種圖控程式語言。 1980 年中期,由 Jeff Kodosky 為 National Instruments Cooperation 發展出來的。 3

Labview 環境介紹 4

Labview 環境介紹 5








大綱 Labview 環境介紹 數值(Numeric) 布林值(Boolean)與比較(Comparison) 結構(Structure) 陣列(Array) 叢集(Cluster) 13

數值(Numeric) Numeric Control 14










數值(Numeric) Multiply Array Elements(陣列元素相乘物件) 陣列元素相乘 24





大綱 Labview 環境介紹 數值(Numeric) 布林值(Boolean)與比較(Comparison) 結構(Structure) 陣列(Array) 叢集(Cluster) 29

布林值(Boolean)與比較 (Comparison) 方塊圖功能區塊 ◦ Boolean 30

布林值(Boolean)與比較 (Comparison) 方塊圖功能區 ◦ Comparison 31

布林值(Boolean)與比較 (Comparison) And(及閘) 32

布林� (Boolean)與比較 (Comparison) Not (反向器) 33

布林� (Boolean)與比較 (Comparison) Or (或閘) 34





布林� (Boolean)與比較 (Comparison) Number To Boolean Array(數值轉成布林陣列) Boolean Array To Number(布林陣列轉換數值) 39




布林� (Boolean)與比較 (Comparison) Equal ? (相等 ? ) Not Equal ? (不相等 ? ) 43

布林� (Boolean)與比較 (Comparison) Greater ? (大於 ? ) Less ? (小於 ? ) 44

布林� (Boolean)與比較 (Comparison) Greater Or Equal ? (大於或等於 ? ) Less Or Equal ? (小於或等於 ? ) 45

布林� (Boolean)與比較 (Comparison) Equal To 0 ? (等於 0 ? ) Not Equal To 0 ? (不等於 0 ? ) 46

布林� (Boolean)與比較 (Comparison) Greater Than 0 ? (大於 0 ? ) Less Than 0 ? (小於 0 ? ) 47

布林� (Boolean)與比較 (Comparison) Greater Or Equal To 0? (大於或等於 0? ) Less Or Equal To 0? (小於或等於 0? ) 48




布林� (Boolean)與比較 (Comparison) Empty String/Path ? (空字串或空路徑? ) 52




大綱 Labview 環境介紹 數值(Numeric) 布林值(Boolean)與比較(Comparison) 結構(Structure) 陣列(Array) 叢集(Cluster) 56

結構(Structure) 方塊圖功能區面板 ◦ Structures 57

結構(Structure) 58



結構(Structure) For Loop ◦ Add Shift Register 輸入 暫存器 輸出 暫存器 61

結構(Structure) For Loop ◦ 累加計算 sum=1+2+…+n 62


結構(Structure) For Loop ◦ 開啟平行處理 64


結構(Structure) 66

結構(Structure) 67

結構(Structure) While Loop ◦ Add shift Register 68

結構(Structure) Two loops showing the difference between shift registers (A) and tunnels(B) 69

結構(Structure) Converting Tunnels to Shift Registers 70

結構(Structure) For Loop ◦ 有條件停止 71

結構(Structure) Initializing Shift Registers 72

結構(Structure) The Feedback Node 73

結構(Structure) Sequence Structure ◦ Stacked ◦ Flat Stacked Flat 74

結構(Structure) Stacked Sequence Structure ◦ 一連串 作以串連方式表示 75

結構(Structure) Stacked Sequence Structure 76

結構(Structure) Flat Sequence Structure ◦ 一連串 作以平面表示 77


結構(Structure) Case (條件控制)物件 79

結構(Structure) 練習 While/For Loop 80


結構(Structure) Event架構 編輯觸發事件 新增case 複製case 刪除case 82


結構(Structure) Event 結構 84

結構(Structure) Formula Node (程式連結點)物件 85

結構(Structure) Formula Node (程式連結點)物件 86

結構(Structure) if (x >= 0) then y = sqrt(x) else y = -99 end if 87



大綱 Labview 環境介紹 數值(Numeric) 布林值(Boolean)與比較(Comparison) 結構(Structure) 陣列(Array) 叢集(Cluster) 90



陣列(Array) 93

陣列(Array) 94

陣列(Array) 95








陣列(Array) Build Array (陣列建立) 103

陣列(Array) Build Array (陣列建立) ◦ Concatenate Inputs 104












大綱 Labview 環境介紹 數值(Numeric) 布林值(Boolean)與比較(Comparison) 結構(Structure) 陣列(Array) 叢集(Cluster) 116











Example 學生資料查詢 127


- Slides: 129