3. Tworzenie VI, subVI, debugging.pdf

(689 KB) Pobierz
Microsoft Word - 3. Tworzenie VI, subVI, debugging.doc
Warszawa, 2003
122228056.030.png
Tworzenie VI
Okno panelu czołowego
Okno diagramu
Terminale
zadajników
Terminale
wskaźników
Politechnika Warszawska, Wydział Inżynierii Produkcji, Instytut Technologii Maszyn
When you create an object on the Front Panel, a terminal will be created on the Block Diagram. These
terminals give you access to the Front Panel objects from the Block Diagram code.
Each terminal contains useful information about the Front Panel object it corresponds to. For example, the
color and symbols provide the data type. Double-precision, floating point numbers are represented with
orange terminals and the letters DBL. Boolean terminals are green with TF lettering.
In general, orange terminals should wire to orange terminals, green to green, and so on. This is not a hard-
and-fast rule; LabVIEW will allow a user to connect a blue terminal (integer value) to an orange terminal
(fractional value), for example. But in most cases, look for a match in colors.
Controls have an arrow on the right side and have a thick border. Indicators have an arrow on the left and a
thin border. Logic rules apply to wiring in LabVIEW: Each wire must have one (but only one) source (or
control), and each wire may have multiple destinations (or indicators).
The program in this slide takes data from A and B and passes the values to both an Add function and a
subtract function. The results are displayed on the appropriate indicators.
122228056.031.png 122228056.032.png
 
122228056.001.png 122228056.002.png 122228056.003.png 122228056.004.png
Tworzenie VI –Diagram
Politechnika Warszawska, Wydział Inżynierii Produkcji, Instytut Technologii Maszyn
In addition to Front Panel terminals, the Block diagram contains functions. Each function may have multiple
input and output terminals. Wiring to these terminals is an important part of LabVIEW programming.
Once you have some experience programming in LabVIEW, wiring will become easy. At first, you may
need some assistance. Here are some tips to get you started:
The wiring tool is used to wire to the nodes of the functions. When you “aim” with the wiring tool, aim with
the end of the wire hanging from the spool. This is where the wire will be placed.
As you move the wiring tool over functions, watch for the yellow tip strip. This will tell you the name of the
terminal you are wiring to.
As you move the wiring tool over a terminal, it will flash. This will help you identify where the wire will
attach.
For more help with the terminals, right-click on the function and select Visible Items>>Terminals . The
function’s picture will be pulled back to reveal the connection terminals. Notice the colors- these match the
data types used by the front panel terminals.
For additional help, select Help>>Show Context Help , or press CTRL+H . This will bring up the context
help window. As you move your mouse over the function, this window will show you the function,
terminals, and a brief help description. Use this with the other tools to help you as you wire.
122228056.005.png 122228056.006.png
 
122228056.007.png 122228056.008.png 122228056.009.png 122228056.010.png 122228056.011.png 122228056.012.png 122228056.013.png
Łączenie przewodami – diagram
Szpulka ma „gorący koniec”
Wybieranie przewodu przez kliknięcie
raz...
dwa razy...
trzy razy...
Przewody załamują się
samoczynnie przy pierwszej
zmianie kierunku, potem
trzeba kliknąć
Porządkowanie przewodów
Politechnika Warszawska, Wydział Inżynierii Produkcji, Instytut Technologii Maszyn
If your wiring becomes doesn’t look very good, right-click on the particular wire in question and choose
Clean Up Wire to automatically re-route that wire.
Wiring is very flexible in LabVIEW. Experiment with keystroke and clicking combinations when wiring.
Here are some of the most often used features:
Single, double, and triple clicking a wire selects the wire for movement or deletion
Clicking while wiring tacks down a bend in the wire
Right-clicking or pressing Escape while wiring cancels the wiring operation
Don’t worry about wire colors- LabVIEW will automatically select the right wire for each situation.
Automatically Wiring Objects
LabVIEW automatically wires objects as you place them on the block diagram. You also can automatically
wire objects already on the block diagram. LabVIEW connects the terminals that best match and leaves
terminals that do not match unconnected. As you move a selected object close to other objects on the block
diagram, LabVIEW draws temporary wires to show you valid connections. When you release the mouse
button to place the object on the block diagram, LabVIEW automatically connects the wires. Toggle
automatic wiring by pressing the spacebar while you move an object using the Positioning tool. You can
adjust the automatic wiring settings by selecting Tools » Options and selecting Block Diagram from the top
pull-down menu.
122228056.014.png 122228056.015.png
 
122228056.016.png 122228056.017.png 122228056.018.png 122228056.019.png 122228056.020.png 122228056.021.png 122228056.022.png 122228056.023.png
Ćwiczenie - zamień °C na °F
DegF=DegC*1,8+32
Politechnika Warszawska, Wydział Inżynierii Produkcji, Instytut Technologii Maszyn
Estimate completion time: 20 minutes. The exercise is easy, but since it will be the first VI that we actually
create, it is good to allow ample time to explore the LabVIEW environment.
Instructions: Build a VI that converts °C to °F. When run, the VI should take an input value (°C), multiply it
by 1.8, add 32, and display the result (°F). The front panel should display both the input value and the result.
Save the VI as Convert C to F.vi.
122228056.024.png 122228056.025.png
 
122228056.026.png 122228056.027.png 122228056.028.png 122228056.029.png
Zgłoś jeśli naruszono regulamin