Skip to content Skip to navigation Skip to collection information

OpenStax-CNX

You are here: Home » Content » LabVIEW Graphical Programming » Convert C to F VI

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • NSF Partnership display tagshide tags

    This module is included inLens: NSF Partnership in Signal Processing
    By: Sidney BurrusAs a part of collection: "LabVIEW Graphical Programming Course"

    Click the "NSF Partnership" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • National Instruments display tagshide tags

    This module is included in aLens by: National InstrumentsAs a part of collection: "LabVIEW Graphical Programming Course"

    Comments:

    "A full introductory course on programming with LabVIEW."

    Click the "National Instruments" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Also in these lenses

  • Lens for Engineering

    This module is included inLens: Lens for Engineering
    By: Sidney Burrus

    Click the "Lens for Engineering" link to see all content selected in this lens.

  • eScience, eResearch and Computational Problem Solving

    This module is included inLens: eScience, eResearch and Computational Problem Solving
    By: Jan E. OdegardAs a part of collection: "LabVIEW Graphical Programming Course"

    Click the "eScience, eResearch and Computational Problem Solving" link to see all content selected in this lens.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

Convert C to F VI

Module by: National Instruments. E-mail the author

Summary: To create a VI and the icon and connector pane needed to use as a subVI.

Exercise 1

Complete the following steps to create a VI that takes a number representing degrees Celsius and converts it to a number representing degrees Fahrenheit.

1.a) Front Panel

  1. Open a blank VI and begin building the following front panel.
    Figure 1
    Figure 1 (convertctoffp.png)
  2. (Optional) Select Window>>Tile Left and Right to display the front panel and block diagram side by side or Window>>Tile Up and Down to display the front panel and block diagram stacked.
  3. Create a numeric control. You will use this control to enter the value for degrees Celsius.
    1. Select Controls>>Numeric Controls to display the Numeric Controls palette. If the Controls palette is not visible, right-click an open space on the front panel workspace to display it.
    2. numericcontrol.png Select the Numeric Control. Move the control to the front panel and click to place the control.
    3. enter.png Type deg C in the label of the control and press the <Enter> key or click the Enter button, shown in Media 3, on the toolbar. If you do not type the name immediately, LabVIEW uses a default label.

    Note:

    You can edit a label at any time by double-clicking the label, using the Labeling tool, or right-clicking and selecting Properties from the shortcut menu to display the property dialog box.
  4. Create a numeric indicator. You will use this indicator to display the value for degrees Fahrenheit.
    1. numericindicator.png Select the Numeric Indicator located on the Controls>>Numeric Indicators palette.
    2. Move the indicator to the front panel and click to place the indicator.
    3. Type deg F in the label and press the <Enter> key or click the Enter button.

1.b) Block Diagram

  1. Display the block diagram by clicking it or by selecting Window>> Show Block Diagram. LabVIEW creates corresponding control and indicator terminal icons on the block diagram when you place controls and indicators on the front panel. The terminals represent the data type of the control or indicator. You should see two double-precision, floating-point terminals on the block diagram, one indicator, and one control.

    Note:

    Control terminals have a thicker border than indicator terminals.
  2. multiply.png Place the Multiply function, located on the Functions>>Arithmetic & Comparison>>Express Numeric palette, on the block diagram to the right of the deg C indicator. If the Functions palette is not visible, right-click an open space on the block diagram workspace to display it.
  3. add.png Place the Add function, located on the Functions>>Arithmetic & Comparison>>Express Numeric palette, on the block diagram to the right of the Multiply function.
  4. numericconstant.png Place a Numeric Constant, located on the Functions>>Arithmetic & Comparison>>Express Numeric palette, to the lower left of the Multiply function. Type 1.80 in the constant. When you first place a numeric constant, it is highlighted so you can type a value. If the constant is no longer highlighted, double-click the constant to activate the Labeling tool.
  5. numericconstant.png Place a Numeric Constant, located on the Functions>>Arithmetic & Comparison>>Express Numeric palette, to the left of the Add function. Type 32.0 in the constant.
  6. wiring.png Use the Wiring tool, shown in Media 9, to wire the icons as shown in Figure 2.
    Figure 2
    Figure 2 (convertctofbd.png)
    • To wire from one terminal to another, use the Wiring tool to click the first terminal, move the tool to the second terminal, and click the second terminal. You can start wiring at either terminal.
    • You can bend a wire by clicking to tack down the wire 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 on the block diagram. 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, displaying the name of the terminal. If the Context Help window is open, the terminal area also blinks in the Context Help window.
    • To cancel a wire you started, press the <Esc> key, right-click, or click the terminal where you started the wire.
  7. Display the front panel by clicking it or by selecting Window>>Show Front Panel.
  8. Save the VI as Convert C to F.vi in the C:\Exercises\LabVIEW Basics I directory.

1.c) Run the VI

  1. Enter a number in the numeric control and run the VI.
    1. operate.png Use the Operating tool, shown in Media 11, or the Labeling tool to double-click the numeric control and type a new number.
    2. run.png Click the Run button, shown at left, to run the VI.
    3. Try several different numbers and run the VI again.

1.d) Icon and Connector Pane

  1. Right-click the icon in the upper right corner of the front panel window and select Edit Icon from the shortcut menu. The Icon Editor dialog box appears.
  2. select.png Double-click the Select tool, shown in Media 13, on the left side of the Icon Editor dialog box to select the default icon.
  3. Press the <Delete> key to remove the default icon.
  4. rect.png Double-click the Rectangle tool, shown in Media 14, to redraw the border.
  5. Create the icon in Figure 3.
    Figure 3
    Figure 3 (ctoficoned.png)
    1. text.png Double-click the Text tool, shown in Media 16, and change the font to Small Fonts .
    2. Use the Text tool to click the editing area where you will begin typing.
    3. Type C and F. While the text is active, you can move the text by pressing the arrow keys.
    4. pencil.png Use the Pencil tool, shown in Media 17, to create the arrow.

      Note:

      To draw horizontal or vertical straight lines, press the <Shift> key while you use the Pencil tool to drag the cursor.
    5. Use the Select tool and the arrow keys to move the text and arrow you created.
    6. Select the B & W icon and click the 256 Colors button in the Copy from section to create a black and white icon, which LabVIEW uses for printing unless you have a color printer.
    7. Select the 16 Colors icon and click the 256 Colors button in the Copy from section.
    8. When you complete the icon, click the OK button to close the Icon Editor dialog box. The icon appears in the upper right corner of the front panel and block diagram.
  6. ctofconpane.png Right-click the icon on the front panel and select Show Connector from the shortcut menu to define the connector pane terminal pattern. LabVIEW selects a default connector pane pattern based on the number of controls and indicators on the front panel. For example, this front panel has two terminals, deg C and deg F , so LabVIEW selects a connector pane pattern with two terminals, shown in Media 18.
  7. Assign the terminals to the numeric control and numeric indicator.
    1. Select Help>>Show Context Help to display the Context Help window.
    2. Click the left terminal in the connector pane. The tool automatically changes to the Wiring tool, and the terminal turns black.
    3. Click the deg C control. A marquee highlights the control on the front panel.
    4. Click an open space on the front panel. The marquee disappears, and the terminal changes to the data type color of the control to indicate that you connected the terminal.
    5. Click the right terminal in the connector pane, and click the deg F indicator.
    6. Click an open space on the front panel. Both terminals of the connector pane are orange.
    7. Move the cursor over the connector pane. The Context Help window shows that both terminals are connected to double-precision, floating-point values.
  8. Save and close the VI. You will use this VI later in the course.

Collection Navigation

Content actions

Download:

Collection as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Module as:

PDF | More downloads ...

Add:

Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks