LabVIEW NXG - Front Panel Basics - Controls and Indicators

This is the second LabVIEW NXG tutorial article in which we will cover the basics of working with the Front Panel.



Imagine that we were in America, the hotel has air conditioning, but the temperature controller there is equipped with a scale in degrees Fahrenheit. We want to set a comfortable twenty degrees, but how much will it be on the Fahrenheit scale? So let's count it in LabVIEW NXG. We are still at a very basic level - under the cut will be a lot of words about the simple (so that in the future you can talk just about the complex)


Previous Part - Basics and Block Diagram


As usual, launch LabVIEW NXG and create a new empty Virtual Tool. But now our main space is the Front Panel (in fact, it opens by default, and this behavior can be changed in the File-> Preferences settings):



The principle of operation is identical to the Block Diagram - we have palettes (controls in our case) and we will drag the necessary elements from the palettes to the panel. If you have worked with similar tools before (Visual Studio with Winforms or WPF, well, or with Delphi), then you can easily get comfortable - everything is very simple and intuitive here, in addition, the palettes are conveniently grouped:



For our exercise, we need a couple of elements from the palette of working with numbers - in one we will enter the temperature in degrees Celsius, and in the second we will get the values ​​in degrees Fahrenheit.


Controls and Indicators


, , , ( ). , . , β€” , β€” . β€” ( "" β€” ).


, , :



, , β€” QuckDrop, Ctrl+Space "" "nc" "nn":



" "- , , :



, , . , , :



, , , , , ( - β€” ). , Visual Studio, C#/WPF, , " " , β€” - .


, , β€” -. , , (LabVIEW β€” ):



β€” - "". -, Ctrl+E. β€” . , , LabVIEW, , β€” , .


, - , , "" , ( β€” ):



- , , , (Uplaced Items) "2"



, , , . :



, β€” ( Data Flow):



.


, , β€” , (Label) , :



, , , β€” . , , ( Reference).


. : (TΒ°C Γ— 9/5) + 32 = TΒ°F ( , "google.com/search?q=c in f", ), #


double tC = 20.0;
double tF = tC * 9.0/5.0 + 32.0;
Console.WriteLine(tF);

LabVIEW :



β€” " , " β€” , , ...


β€” "9", "5" "32" , ( Coercion Dots). , . , ( "Representation", , ), "9,0" "5,0" ( "9.0" "5.0") β€” LabVIEW , :



, , , , β€” , :



( , ):



(Ctrl+E), "20" (Ctrl+R):



β€” , 1k β€” .


β€” . . β€” "Find on Panel/Find on Diagram".


β€” , :



, , " ", <Ctrl+U> :



, . .



. :



. , , , , . , β€” , Quick Drop, … , "Ctrl" , . , - (Unplaced Items) . β€” , . , .


( ) LabVIEW.


LabVIEW ? "" LabVIEW ("Variables"), ( , , ). LabVIEW NXT β€” "" (Duplicate Terminal), ( ) .


, , , .


, :



" " ( "Create duplicate terminal") :



, "" , , , .


β€” , . " ".


, , temp:


double tC = 20.0;

double temp = 9.0/5.0;
double tF = tC * temp + 32.0;

Console.WriteLine(tF);

, , LabVIEW: , "temp", , :



, LabVIEW , " " .


, , , , temp . , , , :



, , , . - temp, .


β€” "" , , :



, Ctrl+B (Remove Broken Wires β€” Ctrl+U). β€” , "" , (, ).


, . LabVIEW . . , , "" , .


Duplicate Terminal, . , "" , , , "" - GoTo, , , , . , (, , , , , ), . - , .



( β€” ), , , , "Make current value default" ( "Capture Data", "Create Reference" "Change to Type Definition"):



, :



β€” , . , . .



β€” , , , β€” :



β€” , :



, , , β€” .


To summarize - today we examined the basic principles of working with the panel, learned how to quickly switch to the block diagram via Ctrl + E, and most importantly, a little deeper into the dataflow .


I left behind the scenes very obvious things like zooming the front panel - this can be done not only from the drop-down list, but also with the mouse wheel. At this stage, it already makes sense to go over the settings (not all of them will be clear, but there aren’t many of them yet) and experiment - for example, it’s more convenient for me to work with conductors in this mode, when a click near the conductor starts creating a new branch:



And in the next short lesson, we will look at simple data types and their coercion, which was mentioned above.


All Articles