<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/technology/cnxml/schema/dtd/0.5/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" xmlns:m="http://www.w3.org/1998/Math/MathML" id="new">
  <name>Including LabVIEW Content in Connexions Modules</name>
  <metadata>
  <md:version>1.1</md:version>
  <md:created>2006/08/07 10:33:52.920 GMT-5</md:created>
  <md:revised>2006/08/11 10:58:09.180 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="mhutch">
      <md:firstname>Matthew</md:firstname>
      
      <md:surname>Hutchinson</md:surname>
      <md:email>mhutch@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="mhutch">
      <md:firstname>Matthew</md:firstname>
      
      <md:surname>Hutchinson</md:surname>
      <md:email>mhutch@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>dynamic content</md:keyword>
    <md:keyword>embedded</md:keyword>
    <md:keyword>LabVIEW</md:keyword>
    <md:keyword>virtual instrument</md:keyword>
  </md:keywordlist>

  <md:abstract>An explanation of how to include embedded LabVIEW content within Connexions modules.</md:abstract>
</metadata>

<content>

<para id="para-01">
There are a couple different ways to include LabVIEW content in a Connexions module. They are as follows: 
</para>

<list id="list-01">
<item>Use a VI from another Connexions module.</item>
<item>Upload a VI from your hard drive.</item>
</list>

<para id="para-02">
This module describes the process for each of these methods.
</para>

<section>
<name>Using a VI from Another Module</name>

<para id="para-03">
If you find a virtual instrument (VI) in Connexions that illustrates your point, the Creative Commons license allows you to use the VI in your own module. Steps for embedding the VI in your module are as follows:
</para>

<list id="list-02" type="enumerated">
<item>Choose a workgroup to hold the module containing the desired VI.</item>
<item>From the workgroup window, click the <code>Search for Published Content</code> button.</item>
<item>Type some terms which identify the desired module and click the <code>Search</code> button.</item>
<item>Click the checkbox next to the desired module, choose the target workgroup from the dropdown, and click the <code>Add</code> button to add the desired module to your workgroup.</item>
<item>Open the workgroup window containing the desired module.</item>
<item>Click on the desired module to open it.</item>
<item>Locate the CNXML element containing the VI, click in it, and record the values of the <code>lvfppviname</code>, <code>width</code>, and <code>height</code> parameters.</item>
<item>Click on the <code>Files</code> tab to display files contained in the module.</item>
<item>Click the checkbox next to the file containing the desired VI. It should be the file with a <code>.llb</code> extension.</item>
<item>Click the <code>Copy</code> button to copy the file containing the VI.</item>
<item>Navigate to the files tab of your own module.</item>
<item>Click the <code>Paste</code> button to paste the VI into your own module.</item>
<item>Add a paragraph to your own module (either in <code>Edit In Place</code> or <code>Full Source Editing</code> mode).</item>
<item>Paste the code that follows in the paragraph and modify the attributes to reflect what you recorded earlier:
<code type="block">
&lt;media type="application/x-labviewrpvi80" src="your_llb_filename.llb"&gt;
&lt;param name="lvfppviname" value="your_vi_filename.vi"&gt;
&lt;param name="width" value="your_vi_width"&gt;
&lt;param name="height" value="your_vi_height"&gt;
&lt;/media&gt;
</code>
</item>
<item>Save your module.</item>
</list>

</section>

<section>
<name>Uploading a VI from Your Hard Drive</name>

<para id="para-04">
If you can't find a VI in Connexions that illustrates your point, you can upload one from your hard drive. First you must configure the VI for viewing on the web and second you must include the VI within the CNXML of the module. Both of these are outlined below:
</para>

<note type="note">
You must have the full version of LabVIEW to configure a VI for viewing on the web.
</note>

<list id="list-03" type="enumerated">
<item>Open the VI in LabVIEW.</item>
<item>Size the VI to the desired size by dragging the lower right corner.</item>
<item>Select the <code>File &gt; VI Properties</code> menu item.</item>
<item>From the <code>Category</code> dropdown, select <code>Execution</code>.</item>
<item>Check the <code>Run VI when opened</code> check box.</item>
<item>From the <code>Category</code> dropdown, select <code>Window Size</code>.</item>
<item>Click the <code>Set to Current Window Size</code> button. Make note of the width and height, as this will need to be specified in the Connexions module.</item>
<item>Click the <code>OK</code> button.</item>
<item>Save the VI by selecting the <code>File &gt; Save</code> menu item.</item>
<item>Create a new project by selecting the <code>File &gt; New Project</code> menu item.</item>
<item>LabVIEW should ask "There are currently VIs open... Do you want to add them to the new project?" Select the option that adds the open VI to the project.</item>
<item>In the <code>Project Explorer</code> window, right click on <code>Dependencies</code> and choose <code>Refresh</code> from the list.</item>
<item>Save the project and all enclosed files by selecting the <code>File &gt; Save All</code> menu item.</item>
<item>Right click on <code>Build Specifications</code> and choose <code>New &gt; Source Distribution</code>.</item>
<item>In the <code>My Source Distribution Properties</code> window, change the <code>Build Specification Name</code> to the name of your VI.</item>
<item>In the <code>Packaging Option</code> section, select <code>Custom</code>.</item>
<item>Uncheck the <code>Exclude vi.llb</code> check box.</item>
<item>Uncheck the <code>Exclude instr.llb</code> check box.</item>
<item>Uncheck the <code>Exclude user.llb</code> check box.</item>
<item>Specify a <code>Destination Path</code> for your new .llb file.</item>
<item>Check the <code>Destination is llb</code> check box.</item>
<item>Confirm that the build is an LLB in the dialog that appears.</item>
<item>Click the <code>Build</code> button.</item>
<item>Save the project by selecting the <code>File &gt; Save All</code> menu item.</item>
<item>Open the LabVIEW LLB Manager by selecting the <code>Tools &gt; LLB Manager</code> menu item.</item>
<item>In the LLB Manager window, select the <code>File &gt; Open Folder</code> menu item.</item>
<item>Navigate to the folder where your LLB is located and click the <code>Current Folder</code> button.</item>
<item>Double click your LLB in the list that appears.</item>
<item>Locate your VI in the list that appears, right click on it, and select the <code>Top Level</code> option.</item>
<item>Close the LLB Manager by selecting the <code>File &gt; Close</code> menu item.</item>
<item>Close LabVIEW by selecting the <code>File &gt; Exit</code> menu item.</item>
<item>Open the Connexions web site and navigate to the <code>Files</code> tab of your module.</item>
<item>Add a new file to your module by choosing <code>File</code> from the dropdown and clicking the <code>Add New Item</code> button.</item>
<item>Browse to your .llb file in the screen that appears and click the <code>Save</code> button.</item>
<item>Open your module for editing in Connexions (either in <code>Edit In Place</code> or <code>Full Source Editing</code> mode).</item>
<item>Add a paragraph to your module.</item>
<item>Paste the code that follows in the paragraph and modify the attributes to reflect your VI:
<code type="block">
&lt;media type="application/x-labviewrpvi80" src="your_llb_filename.llb"&gt;
&lt;param name="lvfppviname" value="your_vi_filename.vi"&gt;
&lt;param name="width" value="your_vi_width"&gt;
&lt;param name="height" value="your_vi_height"&gt;
&lt;/media&gt;
</code>
</item>
<item>Save your module.</item>
</list>

</section>

</content>
  
</document>
