Exercise 1 – Convert C to f build a VI




Yüklə 15.07 Kb.
tarix28.02.2016
ölçüsü15.07 Kb.
Exercise 1 – Convert C to F
Build a VI
Complete the following steps to create a VI that takes a number representing degrees Celsius and converts it to a number representing degrees Fahrenheit.
In wiring illustrations, the arrow at the end of this mouse icon shows where to click and the number on the arrow indicates how many times to click.
Front Panel

  1. Select File»New to open a new front panel.




  1. (Optional) Select Window»Tile Left and Right to display the front panel and block diagram side by side.

  2. Create a numeric digital control. You will use this control to enter the value for degrees Centigrade.

    1. Select the digital control on the Controls»Numeric Controls palette. If the Controls palette is not visible, right-click an open area on the front panel to display it.

    2. Move the control to the front panel and click to place the control.

    3. Type deg C inside the label and click outside the label or click the Enter button on the toolbar. If you do not type the name immediately, LabVIEW uses a default label. You can edit a label at any time by using the Labeling tool.

  3. Create a numeric digital indicator. You will use this indicator to display the value for degrees Fahrenheit.

    1. Select the digital indicator on the Controls»Numeric Indicators palette.

    2. Move the indicator to the front panel and click to place the indicator.

    3. Type deg F inside the label and click outside the label or click the Enter button.

LabVIEW creates corresponding control and indicator terminals on the block diagram. The terminals represent the data type of the control or indicator. For example, a DBL terminal represents a double-precision, floating-point numeric control or indicator.

Note Control terminals have a thicker border than indicator terminals.
Block Diagram

  1. Display the block diagram by clicking it or by selecting Window»Show Diagram.



Note: Block Diagram terminals can be viewed as icons or as terminals. To change the way LabVIEW displays these objects right click on a terminal and select View As Icon.




  1. Select the Multiply and Add functions on the Functions»Numeric palette and place them on the block diagram. If the Functions palette is not visible, right-click an open area on the block diagram to display it.

  2. Select the numeric constant on the Functions»Numeric palette and place two of them on the block diagram. When you first place the numeric constant, it is highlighted so you can type a value.

  3. Type 1.8 in one constant and 32.0 in the other.

If you moved the constants before you typed a value, use the Labeling tool to enter the values.

  1. Use the Wiring tool to wire the icons as shown in the previous block diagram.






    • You can bend a wire by clicking to tack the wire down and moving the cursor in a perpendicular direction. Press the spacebar to toggle the wire direction.

    • To identify terminals on the nodes, right-click the Multiply and Add functions and select Visible Items»Terminals from the shortcut menu to display the connector pane. Return to the icons after wiring by right-clicking the functions and selecting Visible Items»

    • Terminals from the shortcut menu to remove the checkmark.

    • When you move the Wiring tool over a terminal, the terminal area blinks, indicating that clicking will connect the wire to that terminal and a tip strip appears, listing the name of the terminal.

    • To cancel a wire you started, press the key, right-click, or click the source terminal.

  1. Display the front panel by clicking it or by selecting Window»Show Panel.

  2. Save the VI because you will use this VI later in the course.

    1. Select File»Save.

    2. Navigate to c:\exercises\LV Intro.

Note Save all the VIs you edit in this course in c:\exercises\LV Intro.

    1. Type Convert C to F.vi in the dialog box.

    2. Click the Save button.

  1. Enter a number in the digital control and run the VI.

    1. Use the Operating tool or the Labeling tool to double-click the digital control and type a new number.

    2. Click the Run button to run the VI.

    3. Try several different numbers and run the VI again.

  2. Select File»Close to close the Convert C to F VI.


End of Exercise


Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azrefs.org 2016
rəhbərliyinə müraciət

    Ana səhifə