-
1.
'- 1 -
2015- 1: . . . . . '- . 1/ .: . . , . . . .: , 2015. 107 .
( 2015 .)
-
1.
'- 1:
. . , . . , .
. . , . . , .
4
61.
222. LabVIEW
403.
544. Sequence Case
675.
826.
96
98 1. Numeric Data Types
101 2. Expression Node
106 3.
LabVIEW (Laboratory Virtual Instrument Engineering Workbench) () (). ' ', (VME, IEEE RS), ( ) , SCADA .
LabVIEW :
) , ;
) ;
) , ( ) ;
) ( );
) .
LabVIEW , .
LabVIEW . - , , ' , . LabVIEW . (SQL, Toolkit), (Convert VI), - (PID Control), (Fuzzi Logic) .
LabVIEW. , - .
1.
: LabVIEW.
LabVIEW , . . , , () ( . virtual instrument VI), .
Windows: National Instruments LabVIEW. 6.
' (. 1.1) : New VI ( ), Open VI ( ), DAQ Solutions ( /), Search Examples ( ), LabView Tutorial (), Exit ().
. 1.1. LabVIEW
"New VI" : (Front Panel), Untitled 1, - (Block Diagram) Untitled 1 Diagram* (. 1.2). [Ctrl+E] .
(*) , .
, (Tools Palette) (Controls Palette) (Function Palette). - .
.1.2. -
LabVIEW . , :
File , New ( ) [Ctrl+N]; Open ( ); Close ( ); Save (Save As, Save And Copy As) ( , ) [Ctrl+S]; Exit ( LabVIEW) [Ctrl+Q].
Edit , Cut ( ) [Ctrl+X]; Copy ( ) [Ctrl+C]; Paste ( ) [Ctrl+V]; Remove Broken Wires ( ') [Ctrl+B].
Operate : Run ( ) [Ctrl+R]; Stop ( ) [Ctrl+.].
Tools .
Browse VI, , Show VI Hierarchy ( VI).
Window : Show Diagram (Ctrl + E) ( ); Show Control Pallete ( ); Show Functions Pallete ( -); Show Tools Pallete ( ); Show Help Window ( ); Tile ( - ); Size to Screen ( );
Help : Show Context Help ( , ' ) [Ctrl+H]; Context and Index ( ); Examples ( ).
(. 1.3).
. 1.3
(Run) . "Error List" , .
- . : .
() - . , ' , : ; , , , , Controls Functions . . LabVIEW.
LabVIEW ' . . "Tools Palette" (. 1.4), Window/Show_Tools_Pelette.
. 1.4
' , , . , . .
(Operating Tool). : , , . . .
(Positioning Tool). , .
(Labeling Tool). , , , , ).
(Wiring Tool). . , .
(Shortcut Menu Tool). ' . .
(Scroll Tool). ( ).
(Breakpoint Tool). .
(Probe Tool), - .
(Color Copy Tool). - ' .
(Coloring Tool). ' .
, "Window":
1) Controls Palette ( ) ;
2) Functions Palette ( ) .
' , ' Controls Functions, :
) (): ' . ' ' . , ', [SHIFT];
) (): ' [Delete];
) (): ', , ;
) (): , ' . , ' ;
) () ( ) Edit.
: : Help\Examples\Demonstrations\Process_Control\Control_Mixer_Process .
1
.
1) LabVIEW .
2) Untitled 1 '.
3) Controls_Palette\Numeric\Digital_Control (. 1.5) .
. 1.5
, Numeric. , , sampler , , Run. Controls_Palette\Graph\Waveform_Chart Controls_Palette\Numeric\Di-gital_Indicator. (. 1.6, ) .
4) Untitled 1 Diagram*. , , . Find Terminal ( ) Find Indicator ( ).
Front Panel
Block Diagram
)
)
. 1.6
5) ' " ", ( , ) "sampler" ( ) , Waveform_Chart. , . ' , ( , ' ), ( [Ctrl+Z] [Ctrl+B] [Delete]) '. , (. 1.6, ). , Front Panel Block Diagram.
6) ' .
7) Untitled 1.
8) Run_Continuously . .
9) sampler .
10) Abort_Execution .
11) LabVIEW File\Exit. Save Changes? Yes Name_the_VI ' *.vi.
2
.
1) 1 1 File\Open , 1.
Untitled 1 Diagram*. ' , sampler Waveform chart, Functions Functions\Analyze\Signal_Procesisng\Signal_Generation\Sine_Pattern. (. 1.7, ) .
)
)
)
. 1.7
LabVIEW , , . , , , . . 1.7, , , samples . , , (. 1.7, ), Help\Context help., samples Sine_Pattern sampler. , Sine_Pattern. ' Sinusoidal Pattern Sine_Pattern Waveform_Chart. . , , amplitude Sine_Pattern . , , Create\Control (. 1.8). amplitude.
. 1.8
, Run . sampler amplitude (. 1.9).
Front Panel
Block Diagram
. 1.9 2
, , , , File\Print.... , , , , . RTF (. 1.10).
. 1.10 Print... File LabVIEW , .
1. .
2. ( , , ) . 1. ?2. ?3. ?4. -?5. ?6. -?7. Controls?8. Functions?9. ?10. -.11. . 12. ()? 13. .14. ?15. ?16. .
2. LabVIEW
: LabVIEW.
LabVIEW , - . . , , .
LabVIEW , ' . LabVIEW ' .
LabVIEW Functions (), Structures (), Numeric (), Boolean (), String () . .
Functions . : , .
. 2.1
( ). Functions\Numeric\Numeric_Constant, . ( , Na , ) Functions\Numeric\Additional_Numeric_Constant.
1. A = (B + C)/5, .
Control\Numeric\Digital_Control B C, Control\Numeric\Digital_Indicator A. , , :
1) ( 5): Functions\Numeric\Constants 5 ;
2) : Functions\Numeric\Add Functions\Numeric\Divide .
' .
Front Panel
Block Diagram
.2.2
: [x] (), [y] (), [x/y] () (. . 2.3). ' "" , , '. "" . )
).2.3 :
) ; ) , , . - [DBL], (Double-precision floating-point numbers). , , (Long integer numbers) 32 . , , Representation (. 2.4). , LabVIEW 1. Functions\Numeric\Conversion.
.2.4
If you ask electronics engineer "To be or not to be ?" , his answer will be "One!" , , . Controls\Boolean. Functions\Boolean. : True () False (), 1 0. LabVIEW (.2.4). .2.4 . , : HL SB1 SB2 .
, Controls\Boolean\Push_Button SB1 SB2. HL Controls\Boolean\Round_LED (. 2.5). HL SB1, SB2 , (And) Functions\Boolean\And.
. 2.5 FORMULA NODE (Formula Node) Functions\Structure. , . . Formula Node , , . Formula Node ( Formula Node) Add Input ( ), Add Output ( ). ', , Formula Node (. 2.6).
. 2.6
2. A = (B + C)/5 , Formula Node , . , , Add Input ( ). , ', ' (. 2.6). . , Add Output ( ) . Formula Node A = (B + C)/5;. .Front PanelBlock Diagram
. 2.7 Formula Node
, Formula Node , 10.58. ;.
, Expression Node (). . 2.8 Expression Node () ( ) (). Formula Node Expression Node 2.
. 2.8 Expression NodeType Cast ' . -. Type Cast ( ) Functions\ Numeric\ Data Manipulation\ . . 2.9 , - .
. 2.9 Type Cast . , . Type Cast Enums (). . 2.10 . . 2.10a , . 2.10 .Enums U16 , U8 U32. 2. 4a Enums U16 U32. , Type Cast 2 sine tangent.
. 2.10 Type Cast Integer Enumerated ) ; ) , , Type Cast, -, I32 ( ), U32 ( ) , (. 2.10). Enum-. 1:
1.1 ( = + 273,15) 1.2 (R = 4/5) 1.3 ( = 273,15) 1.4 ( = 5/4 R) 1.5 (F = 9/5 + 32) 1.6 (F = 9/4 R + 32) 1.7 (R = U / I) 1.8 ( R = 4/5 ( 273,15)) 1.9 (I = U / R) 1.10 ' ' ( = / ) 1.11 () () () (P = I U) 1.12 () () () (P = I U) 1.13 () () ( / ) (G = m / t) 1.14 () (3) ( / 3) ( = m / V) 1.15 (3) () ' (3 / ) (G = V / t)1.16. . . . (= 133.3*. . .)
1.17. . . . (. . . = 759.9*)
1.18. /2 . . . (. . .= /2 *735)
1.19. (= 105 )
1.20. /2 (/2= 1.0197)
1.21. . . . . . . (. . .= 13.3 . . .)
1.22. . . . . . . (. . .= 0.075* . . .)
1.23. 3 (= 103* 3)
1.24. () ( = 3.79 ())
1.25. () ( = 4.55 ())
1.26. (= 159 )
1.27. (=0.568 )
1.28. (=0.0254 )
1.29. ( = 1609* )
1.30. () (= 1852* ())
1.31. (1 l = 100 cl) 2. . :
) (. 1);
) Structure\Formula Node (. 2. Formula Node (. 2).
2.1
2.2
2.3
2.4
2.5 a =
2.6 a =
2.7
2.8
2.9
2.10
2.11
2.12
2.13
2.14
2.15
2.16
2.17
2.18
2.19
2.20
2.21
2.22
2.23
2.24
2.25
2.26
2.27
2.28
2.29
2.30
3. (A , ). (A, B) Controls Boolean. (C) .3.1
ABC
000
011
101
110
3.2
ABC
001
010
101
111
3.3
ABC
000
010
100
111
3.4
ABC
001
011
101
110
3.5
ABC
001
011
100
111
3.6
ABC
001
010
100
111
3.7ABC
100
010
001
110
3.8ABC
101
011
111
000
3.9ABC
100
011
000
111
3.10ABC
011
110
101
011
3.11ABC
010
001
100
111
3.12ABC
111
010
101
001
3.13ABC
100
010
001
110
3.14ABC
001
100
111
010
3.15ABC
101
010
000
111
3.16ABC
110
011
101
000
3.17
ABC
011
000
101
111
3.18ABC
001
110
100
011
3.19
ABC
011
001
101
110
3.20ABC
101
111
010
001
3.21
ABC
110
011
100
001
3.22ABC
101
010
001
111
3.23ABC
010
101
000
110
3.24ABC
101
001
010
110
3.25ABC
101
010
001
111
3.26ABC
110
00
010
101
3.27ABC
111
101
011
000
3.28ABC
000
110
011
101
3.29ABC
011
110
101
000
3.30ABC
111
100
011
001
1. ? 2. - ? 3. ? 4. ? 5. ' '? 6. Controls ()? 7. Functions ()? 8. ? 9. -. 10. . 11. ? 12. . 13. ?14. Formula Node? Formula Node?3. : LabVIEW. () ( ) . LabVIEW : Function\Structures\. :
) (For Loop),
) (While Loop),
For Loop.
() N, :
for i=0 to N-l do ...
- For Loop , ' -.
(). 3.1 For Loop: () LabVIEW , (b) , () For Loop : Function\Structures\For_Loop. ' (. 3.1). , , . - ', , , . .
.3.1 "" "N".
N , , , Function\Numeric\Numeric_Constant. ( N = 50).
= N 1 . ( = 0), , N. = N 1.
. Controls\Graph\Waveform_Graph. ' . ' DBL. .
' 50, , N. i ' ( ' [DBL] [I32], , (Integer) 32 ) (. 3.2). 1.
. 3.2
' : , . LabVIEW , ( ' ) . .
0 49.
For (Shift Registers), .
. , : ; .
. , . . 3.3 .
. 3.3 :
1) For Loop .
2) , Add Shift Register ( ). ' . ( 1) . , , (Add Element). ( 2). ( k)- ( k ). (Remove Element) (Remove All) . [Delete].
3) (Controls\), (Function\Numeric\Random_Number_(01)) \ (Function\Comparison\Max&Min). , N , (Function\Array\Array_Max&Min). . ' 3.3. 0, N = 100.
"Run" .
:
1. , . 0;
2. , .
For Loop 1- : Y(t) = K (1 ( / d)).
. 3.4 (. 3.4) , "Exponential", Function\Numeric\Logarithmic.
While Loop
(For Loop) (While Loop) . While Loop , , boolean FALSE. :
DO ...( ), WHILE ( ).
. 3.5 While Loop: () LabVIEW , (b) While Loop Function\Structures\WhileLoop.
i () ().
WHILE , 3.6. pre- post- . pre- , FALSE, . post-test . , post- , FALSE, , , . LabVIEW post- .
. 3.6 () Pre- (b) post- WhileloopWhile Loop , . , Continue if True, While Loop FALSE. , While Stop if True . Stop if True, While Loop TRUE. , I . i . . i 0.
. 3.7 , , While Loop. Control\Boolean\Push Button, . Functions\Date&Time\Wait (ms), .
. , , . . , , , , . . LabVIEW . , I . . . Wait Until Next ms Multiple Wait (ms), 3.8 () (b) .
. 3.8 () Wait Until Next ms Multiple (b) Wait (ms)Wait Until Next ms Multiple , , . . , . , , . ( 3.9). Wait (ms) . , . Wait () , , . , ( 3.9). )). 3.9:
(. . 3.1), "While Loop" "For Loop".
. 3.1
1
2ex - 3 sin x + e(x-1)
35 lg (x+4) 15
4ln x3 + tg x2
510 (15 log2 x +10 log2 x3)
6 x! / ln (x+x4)
7x!+(x-1)!
8x!/((x-1)!)
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1. ? 2. While ? 3. 30 2 ? 4. ? 5. 1 ? 6. For.7. While.8. .
9. , ?10. Stop if True Continue if True While Loop?
4. Sequence Case
: Sequence Case LabVIEW.
Case Structure (Case Structure) . : Functions\Structures\Case. ( ?), . - . , , True/False, . Case , . (Controls\Boolean) . , .
, . ? , , , . .
Block Diagram
. 4.1 (Add Case After) (Add Case Before) . , . (Remove Case). , , . , .
. , : True False (. 4.1).
, , (0. True . | < | >= | >, and