<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="None">
  <name>Convert C to F VI</name>
  <metadata>
  <md:version>1.1</md:version>
  <md:created>2004/06/16 11:07:42 GMT-5</md:created>
  <md:revised>2004/07/16 15:00:05.698 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="NationalInstruments">
      <md:firstname>National</md:firstname>
      
      <md:surname>Instruments</md:surname>
      <md:email>certification@ni.com</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="lizzardg">
      <md:firstname>Elizabeth</md:firstname>
      
      <md:surname>Gregory</md:surname>
      <md:email>lizzardg@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="mshiralkar05">
      <md:firstname>Malan</md:firstname>
      
      <md:surname>Shiralkar</md:surname>
      <md:email>mshiralkar05@hotmail.com</md:email>
    </md:maintainer>
    <md:maintainer id="harika">
      <md:firstname>Harika</md:firstname>
      
      <md:surname>Basana</md:surname>
      <md:email>ilsai@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="NationalInstruments">
      <md:firstname>National</md:firstname>
      
      <md:surname>Instruments</md:surname>
      <md:email>certification@ni.com</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  

  <md:abstract>To create a VI and the icon and connector pane needed to use as a subVI.
</md:abstract>
</metadata>
  
  <content>
    <exercise id="e1">
      <problem>
	<para id="intro">
	  Complete the following steps to create a VI that takes a number
	  representing degrees Celsius and converts it to a number
	  representing degrees Fahrenheit.
	</para>
	
	<section>
	  <name> Front Panel</name>
	  <list id="steps1" type="enumerated">
	    <item> Open a blank VI and begin building the following front
	      panel.
	      <figure>
		<media type="image/png" src="convertctoffp.png"/>
	      </figure>
	    </item>
	    <item>
	      (Optional) Select <code> Window&gt;&gt;Tile Left and Right </code> to 
	      display the front panel and block diagram side by side or <code>
		Window&gt;&gt;Tile Up and Down </code> to display the front panel and
	      block diagram stacked.
	    </item>
	    
	    <item>
	      Create a numeric control. You will use this control to enter the 
	      value for degrees Celsius.
	      
	      <list id="dsje" type="enumerated">
		<item> 
		  Select <code> Controls&gt;&gt;Numeric Controls </code> 
		  to display the <code> Numeric Controls </code> palette.
		  If the <code> Controls </code> palette is not visible, 
		  right-click an open space on the front panel workspace to 
		  display it.
		</item>
		
		<item>
		  <media type="image/png" src="numericcontrol.png"/>
		  Select the <code>Numeric Control</code>. Move the
		  control to the front panel and click to place the
		  control.
		</item>
		
		<item>
		  <media id="m1" type="image/png" src="enter.png"/> Type
		  <code>deg C</code> in the label of the control and press
		  the <code>&lt;Enter&gt;</code> key or click the
		  <code>Enter</code> button, shown in <cnxn target="m1"/>,
		  on the toolbar. If you do not type the name immediately,
		  LabVIEW uses a default label.
		</item>
	      </list>
	      <note> 
		You can edit a label at any time by double-clicking the
		label, using the <code>Labeling</code> tool, or
		right-clicking and selecting <code>Properties</code> from
		the shortcut menu to display the property dialog box.
	      </note>
	    </item>

	    <item>
	      Create a numeric indicator. You will use this indicator to
	      display the value for degrees Fahrenheit.
	      <list id="shls" type="enumerated">
		<item>
		  <media type="image/png" src="numericindicator.png"/>
		  Select the <code>Numeric Indicator</code> located on
		  the <code> Controls&gt;&gt;Numeric Indicators </code>
		  palette.
		</item>

		<item>
		  Move the indicator to the front panel and
		  click to place the indicator.
		</item>

		<item>
		  Type <code> deg F </code> in the label and press the
		  <code>&lt;Enter&gt;</code> key or click the <code> Enter
		  </code> button.
		</item>
	      </list>
	    </item>
	  </list>
	</section>

	<section>
	  <name> Block Diagram</name>

	  <list id="ask" type="enumerated">
	    <item> Display the block diagram by clicking it or by
	      selecting <code> Window&gt;&gt; Show Block Diagram</code>.
	      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.
	      </note>
	    </item>
	    
	    <item> 

	      <media type="image/png" src="multiply.png"/> Place the
	      <code>Multiply</code> function, located on the
	      <code>Functions&gt;&gt;Arithmetic &amp; Comparison&gt;&gt;Express
		Numeric</code> palette, on the block diagram to the right of
	      the <code>deg C</code> indicator. If the
	      <code>Functions</code> palette is not visible, right-click
	      an open space on the block diagram workspace to display it.
	    </item>
	    
	    <item>
	      <media type="image/png" src="add.png"/> Place the
	      <code>Add</code> function, located on the <code>
		Functions&gt;&gt;Arithmetic &amp; Comparison&gt;&gt;Express Numeric
	      </code> palette, on the block diagram to the right of the
	      <code>Multiply</code> function.
	    </item>

	    <item> <media type="image/png" src="numericconstant.png"/>
	      Place a <code>Numeric Constant</code>, located on the <code>
		Functions&gt;&gt;Arithmetic &amp; Comparison&gt;&gt;Express Numeric
	      </code> palette, to the lower left of the
	      <code>Multiply</code> function.  Type <code>1.80</code> 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 <code>Labeling</code> tool.
	    </item>
	    
	    <item>
	      <media type="image/png" src="numericconstant.png"/> Place a
	      <code>Numeric Constant</code>, located on the
	      <code>Functions&gt;&gt;Arithmetic &amp; Comparison&gt;&gt;Express
		Numeric</code> palette, to the left of the <code>Add</code>
	      function. Type <code>32.0 </code> in the constant.
	    </item>
	    
	    <item>
	      <media id="media" type="image/png" src="wiring.png"/> Use
	      the <code>Wiring</code> tool, shown in <cnxn target="media"/>, to wire the icons as shown in <cnxn target="fnmsha"/>.
	      <figure id="fnmsha">
		<media type="image/png" src="convertctofbd.png"/>
	      </figure>
	      
	      <list id="sdhajh">
		<item>
		  To wire from one terminal to another, use the
		  <code>Wiring</code> 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.
		</item>
		
		<item>
		  You can bend a wire by clicking to tack down the wire
		  and moving the cursor in a perpendicular
		  direction. Press the <code>spacebar</code> to toggle the
		  wire direction.
		</item>
		
		<item>
		  To identify terminals on the nodes, right-click the
		  <code>Multiply </code> and <code>Add</code> functions
		  and select <code> Visible Items&gt;&gt;Terminals </code> 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 <code>
		    Visible Items&gt;&gt;Terminals </code> from the shortcut menu
		  to remove the checkmark.
		</item>

		<item>
		  When you move the <code>Wiring</code> 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 <code> Context Help </code> window is
		  open, the terminal area also blinks in the <code>
		    Context Help </code> window.
		</item>
		
		<item>
		  To cancel a wire you started, press the
		  <code>&lt;Esc&gt;</code> key, right-click, or click the
		  terminal where you started the wire.
		</item>
	      </list>

	    </item>

	    <item>
	      Display the front panel by clicking it or by selecting
	      <code>Window&gt;&gt;Show Front Panel</code>.
	    </item>

	    <item>
	      Save the VI as <code>Convert C to F.vi </code> in the 
	      <code> C:\Exercises\LabVIEW Basics I </code>directory.
	    </item>

	  </list>
	</section>


	<section>
	  <name>Run the VI</name>
	  <list id="iwoiqp" type="enumerated">
	    <item>
	      Enter a number in the numeric control and run the VI.
	      <list id="ahak" type="enumerated">
		<item> 

		  <media id="media1" type="image/png" src="operate.png"/>
		  Use the <code>Operating</code> tool, shown in <cnxn target="media1"/>, or the <code>Labeling</code> tool to
		  double-click the numeric control and type a new number.
		</item>
		<item>
		  <media type="image/png" src="run.png"/> Click the
		  <code>Run</code> button, shown at left, to run the VI.
		</item>
		<item>
		  Try several different numbers and run the VI again.
		</item>
	      </list>
	      
	    </item>
	  </list>
	</section>
	
	<section>
	  <name>Icon and Connector Pane</name>
	  
	  <list id="cinnect" type="enumerated">
	    <item>
	      Right-click the icon in the upper right corner of the front panel
	      window and select <code> Edit Icon </code> from the shortcut menu.
	      The <code>Icon Editor</code> dialog box appears.
	    </item>

	    <item>
	      <media id="media2" type="image/png" src="select.png"/>
	      Double-click the <code>Select</code> tool, shown in <cnxn target="media2"/>, on the left side of the <code>Icon Editor
	      </code> dialog box to select the default icon.
	    </item>

	    <item>
	      Press the <code>&lt;Delete&gt;</code> key to remove the default
	      icon.
	    </item>

	    <item>
	      <media id="media3" type="image/png" src="rect.png"/>
	      Double-click the <code>Rectangle</code> tool, shown in <cnxn target="media3"/>, to redraw the border.
	    </item>

	    <item>
	      Create the icon in <cnxn target="fignmsha"/>.
	      <figure id="fignmsha">
		<media type="image/png" src="ctoficoned.png"/>
	      </figure>

	      <list id="nnnn" type="enumerated">
		<item>
		  <media id="media4" type="image/png" src="text.png"/>
		  Double-click the <code>Text</code> tool, shown in <cnxn target="media4"/>, and change the font to <code>Small
		    Fonts </code>.
		</item>
		
		<item>
		  Use the <code>Text</code> tool to click the editing area
		  where you will begin typing.
		</item>
		
		<item> Type <code>C</code> and <code>F</code>. While the
		  text is active, you can move the text by pressing the
		  arrow keys.
		</item>
		
		<item> <media id="media5" type="image/png" src="pencil.png"/> Use the <code>Pencil</code> tool,
		  shown in <cnxn target="media5"/>, to create the arrow.
		  <note>
		    To draw horizontal or vertical straight lines, press
		    the <code>&lt;Shift&gt;</code> key while you use the
		    <code>Pencil</code> tool to drag the cursor.
		  </note>
		</item>
		
		<item>
		  Use the <code>Select</code> tool and the arrow keys to
		  move the text and arrow you created.
		</item>
		
		<item> 
		  Select the <code> B &amp; W </code> icon and click the
		  <code> 256 Colors </code> button in the <code> Copy from
		  </code> section to create a black and white icon, which
		  LabVIEW uses for printing unless you have a color
		  printer.
		</item>
		
		<item>
		  Select the <code> 16 Colors </code> icon and click the
		  <code> 256 Colors </code> button in the <code> Copy from
		  </code> section.
		</item>
		
		<item>
		  When you complete the icon, click the <code> OK </code>
		  button to close the <code> Icon Editor </code> dialog
		  box.  The icon appears in the upper right corner of the
		  front panel and block diagram.
		</item>
	      </list>
	    </item>
	    
	    <item>
	      <media id="blah" type="image/png" src="ctofconpane.png"/>
	      Right-click the icon on the front panel and select <code>
		Show Connector </code> 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, <code>deg C </code> and <code> deg F
	      </code>, so LabVIEW selects a connector pane pattern with
	      two terminals, shown in <cnxn target="blah"/>.
	    </item>

	    <item>
	      Assign the terminals to the numeric control and numeric
	      indicator.
	      <list id="ahasj" type="enumerated">
		<item>
		  Select <code> Help&gt;&gt;Show Context Help </code> to display
		  the <code> Context Help </code> window.
		</item>

		<item>
		  Click the left terminal in the connector pane. The
		  tool automatically changes to the
		  <code>Wiring</code> tool, and the terminal turns
		  black.
		</item>

		<item>
		  Click the <code> deg C </code> control. A marquee
		  highlights the control on the front panel.
		</item>

		<item>
		  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.
		</item>

		<item>
		  Click the right terminal in the connector pane, and
		  click the <code> deg F </code> indicator.
		</item>
		
		<item>
		  Click an open space on the front panel. Both terminals
		  of the connector pane are orange.
		</item>
		
		<item>
		  Move the cursor over the connector pane. The <code>
		    Context Help </code> window shows that both terminals
		  are connected to double-precision, floating-point
		  values.
		</item>

	      </list>
	    </item>

	    <item>
	      Save and close the VI. You will use this VI later in the course.
	    </item>

	  </list>
	  
	</section>
      </problem>
    </exercise>
  </content>
  
</document>
