There are a couple different ways to include LabVIEW content in a Connexions module. They are as follows:
- Use a VI from another Connexions module.
- Upload a VI from your hard drive.
This module describes the process for each of these methods.
Using a VI from Another Module
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:
- Choose a workgroup to hold the module containing the desired VI.
- From the workgroup window, click the
Search for Published Content button. - Type some terms which identify the desired module and click the
Search button. - Click the checkbox next to the desired module, choose the target workgroup from the dropdown, and click the
Add button to add the desired module to your workgroup. - Open the workgroup window containing the desired module.
- Click on the desired module to open it.
- Locate the CNXML element containing the VI, click in it, and record the values of the
lvfppviname, width, and height parameters. - Click on the
Files tab to display files contained in the module. - Click the checkbox next to the file containing the desired VI. It should be the file with a
.llb extension. - Click the
Copy button to copy the file containing the VI. - Navigate to the files tab of your own module.
- Click the
Paste button to paste the VI into your own module. - Add a paragraph to your own module (either in
Edit In Place or Full Source Editing mode). - Paste the code that follows in the paragraph and modify the attributes to reflect what you recorded earlier:
<media type="application/x-labviewrpvi80" src="your_llb_filename.llb">
<param name="lvfppviname" value="your_vi_filename.vi">
<param name="width" value="your_vi_width">
<param name="height" value="your_vi_height">
</media>
- Save your module.
Uploading a VI from Your Hard Drive
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:
note:
You must have the full version of LabVIEW to configure a VI for viewing on the web.
- Open the VI in LabVIEW.
- Size the VI to the desired size by dragging the lower right corner.
- Select the
File > VI Properties menu item. - From the
Category dropdown, select Execution. - Check the
Run VI when opened check box. - From the
Category dropdown, select Window Size. - Click the
Set to Current Window Size button. Make note of the width and height, as this will need to be specified in the Connexions module. - Click the
OK button. - Save the VI by selecting the
File > Save menu item. - Create a new project by selecting the
File > New Project menu 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.
- In the
Project Explorer window, right click on Dependencies and choose Refresh from the list. - Save the project and all enclosed files by selecting the
File > Save All menu item. - Right click on
Build Specifications and choose New > Source Distribution. - In the
My Source Distribution Properties window, change the Build Specification Name to the name of your VI. - In the
Packaging Option section, select Custom. - Uncheck the
Exclude vi.llb check box. - Uncheck the
Exclude instr.llb check box. - Uncheck the
Exclude user.llb check box. - Specify a
Destination Path for your new .llb file. - Check the
Destination is llb check box. - Confirm that the build is an LLB in the dialog that appears.
- Click the
Build button. - Save the project by selecting the
File > Save All menu item. - Open the LabVIEW LLB Manager by selecting the
Tools > LLB Manager menu item. - In the LLB Manager window, select the
File > Open Folder menu item. - Navigate to the folder where your LLB is located and click the
Current Folder button. - Double click your LLB in the list that appears.
- Locate your VI in the list that appears, right click on it, and select the
Top Level option. - Close the LLB Manager by selecting the
File > Close menu item. - Close LabVIEW by selecting the
File > Exit menu item. - Open the Connexions web site and navigate to the
Files tab of your module. - Add a new file to your module by choosing
File from the dropdown and clicking the Add New Item button. - Browse to your .llb file in the screen that appears and click the
Save button. - Open your module for editing in Connexions (either in
Edit In Place or Full Source Editing mode). - Add a paragraph to your module.
- Paste the code that follows in the paragraph and modify the attributes to reflect your VI:
<media type="application/x-labviewrpvi80" src="your_llb_filename.llb">
<param name="lvfppviname" value="your_vi_filename.vi">
<param name="width" value="your_vi_width">
<param name="height" value="your_vi_height">
</media>
- Save your module.