Developer Center Resources

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Example VIs to the NI Example Finder

» Developing a VI-Based API » Adding Example VIs to the NI Example Finder

 

This example documents the process for adding Example VIs to the NI Example Finder. To prepare for this example, please download the .zip archive linked to at the bottom of this document and copy the contents to your LabVIEW directory (the 'examples' folder in the .zip should be merged with the existing examples folder in the LabVIEW directory in order for the examples\ATX\SimpleMath\Simple Math Example.vi file to be in the correct location).

  1. Open LabVIEW

  2. Open the 'Prepare Example VIs for NI Example Finder utility (Tools > Prepare Example VIs for NI Example Finder)
    1.png
  3. Change the 'Start directory for examples' to the directory where your API examples are located (LabVIEW\examples\Company\Product\ or for this example, LabVIEW\examples\ATX\Simple Math).

  4. Double-click the example VI (.vi) or LabVIEW Project file (.lvproj) you wish to document in the first pane on the left (Simple Math Example.vi).

  5. Navigate to your desired browse path and double-click on the grey icon designating the bucket you've chosen for the example (you can add multiple paths); this is the path users will use with the 'List' view of the NI Example Finder.  Currently, this list is not open to adding new browse paths.

  6. Double-click on Keywords in the third pane to compile a list of tags for users to use when searching for examples in the NI Example Finder. If you would like to add keywords, enter your new keywords in the box below this pane and select 'Add New Keyword'.

  7. The Documentation pane in the upper right corner of the window describes the settings you've chosen for a particular example.

  8. The pane below the Documentation pane contains the example description, this is the description which appears in the Description text box of the NI Example Finder.

  9. When you've completed documenting a particular example, click 'Save Documentation' at the bottom-right of the window. Then repeat steps 4-8 for additional examples.

  10. Once you've completed documenting your examples, change to the 'Build Data File' tab.

  11. For the 'Data file to create (bin3)', navigate to \LabVIEW\examples\exbins\ and save this file as Company-Product.bin3. For a list of prefixes you cannot use when naming this file, please consult the LabVIEW Help Document by clicking the Help button at the bottom-right of the window.

  12. Set the directory where the examples are stored.

  13. Click 'Build File'.

  14. Restart LabVIEW, Open the NI Example Finder and search/browse for your examples. I recommend documenting the steps to search/browse to your examples for customers.
Comments
vishots.com
Member
Member
on

What if LabVIEW doesn't have an exbins folder? For example, LabVIEW 2010

vishots.com
Member
Member
on

Let's say I created my bin3 file and now I want to update it. How do I do this?

David_L
Active Participant
Active Participant
on

Michael_Aivaliotis wrote:

What if LabVIEW doesn't have an exbins folder? For example, LabVIEW 2010

The exbins folder is required in later versions but backwards compatible in earlier versions.  In older versions of LabVIEW, it parsed every folder recursively under LabVIEW\examples.  But in 2011 it was limited to the exbin folder in order to help save on load time. 

Michael_Aivaliotis wrote:

Let's say I created my bin3 file and now I want to update it. How do I do this?

You don't modify the bin3 when making the changes, instead the utility pulls data from the VIs and LVPROJs and you just need to make the changes in these files and then generate a new bin3 file from the utility.

Thoric
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

This process requires the relevant example VIs to be present in the correct location, which for some toolkits will not be the case. I don't ever install PTP Sequencer onto the development environment to ensure I don't get cross-linking issues. Therefore the creation of a bin3 is painstaking and fraught with issues. Any chance NI and JKI can get VIP Builder to create the bin3 on the fly as part of the build process? Would make the whole package-generation much easier 🙂

Thoric (CLA, CLED, CTD and LabVIEW Champion)


vishots.com
Member
Member
on

It's on JKI's roadmap. But the road is very long and winding...

tst
Knight of NI Knight of NI
Knight of NI
on

I was expecting this - https://www.youtube.com/watch?v=FkqOnFOZ7W0


___________________
Try to take over the world!
AristosQueue (NI)
NI Employee (retired)
on

Thoric wrote:


                       

This process requires the relevant example VIs to be present in the correct location, which for some toolkits will not be the case. I don't ever install PTP Sequencer onto the development environment to ensure I don't get cross-linking issues. Therefore the creation of a bin3 is painstaking and fraught with issues. Any chance NI and JKI can get VIP Builder to create the bin3 on the fly as part of the build process? Would make the whole package-generation much easier 🙂


                   

I would expect that the right way to do this is to buld PTP as one package and build the examples as a *separate* package that has a dependency on the first. That way you package your build up, deploy it onto your example development machine, develop your examples, and then produce the final package from that. Makes it easier to distribute smaller bug fixes and creates a much smoother development process.

Building the bin3 for files that do not exist is a pretty strong sign in my book that "you're doing it wrong". Breaking things into separate packages helps a lot with this.

SteenSchmidt
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

Splitting it up into two packages doesn't help here;

The workflow will then be this:

1) Install PTP (without examples, which in theory already violates the LVTN requirements, but exceptions will be made...)

2) Develop the PTP-examples in a dev-folder some other place than vi.lib.

3) Fire up the 'Prepare Example VIs for NI Example Finder' (PrepEx) utility, which requires you to point it to the directory where your example VIs will be once deployed.

4) So, now you have to install the PTP-examples package, and then build the bin3 file with the PrepEx utility.

5) Uninstall the PTP-examples package.

6) Build a new PTP-examples package (which includes the bin3 file).

In the end still two builds of one package has to be done, this time it's just the PTP-examples package. There could still be advantages to separating the examples from the toolset itself, but it doesn't fix the broken workflow of having to build a package two times for one release.

The problem is the PrepEx utility, which demands that its resources are located at the deployment location when it builds the bin3 file. If the PrepEx utility could somehow be pointed to a dev folder and then be told of a deployment location it should take into consideration, then we could develop these examples in one go.

/Steen

CLA, CTA, CLED & LabVIEW Champion
Thoric
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

The examples #do# exist, I place them in the appropriate locations before running the Prepare VIs for NI Example Finder wizard.  However, I have to put them there manually and then remove them afterwards.

Building one solid package is hard enough. Building a second package that's dependent on the first sounds like a recipe for an explosion of complications.  I can see the value in your suggestion Stephen, and I'll keep it in mind because it will resolve one of the outstanding issues with the examples (dependency path changes on first load of a freshly installed toolkit), however the panic I'm already feeling when I think about changing anything in my 22 step build process has me breaking a sweat. I think I'll reserve this modification to my next 'good' day

Thoric (CLA, CLED, CTD and LabVIEW Champion)


vishots.com
Member
Member
on

Package builders should not know or care about Bin3 files, where they go, or how they're generated. They just want to pick a few VIs, set a description, categorize them and set them as examples. What happens behind the scenes is not of concern. VIPM already builds palettes for VIs that "don't exist" but somehow it works. VIPM knows the expected paths of the examples and can dynamically generate them as required. Sounds easier than it is though. It's a just a small matter of programming.

James_McN
Active Participant Active Participant
Active Participant
on

How do you add browse paths if not here? Or does everything else just go in "Other"?

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
Plutto313
Member
Member
on

Hi.

How can I add a requirement for my example?

The only way I can see is just writing it in 'Example description' section.

 

  

Contributors