Example Code

How can I automatically generate documentation for my whole LabVIEW project?

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This example uses recursion to harvest and publish documentation for a LabVIEW project.

 

Description

LabVIEW offers very good ways to document your applications.  If you want to generate comprehensive documentation for a LabVIEW project, we can tap into this documentation linked to our VIs, Classes, Controls, Indicators, etc.  This example should provide a basic outline for doing this.  It gives a good example of how to access the different items in a project.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

In order to run this example,

  1. Open the project(s) you want to document and the Project Documentation.vi.
  2. Run the Project Documentation.vi and it will document all the open projects.

 

The Project Documentation.vi gets a list of all the projects that are currently open and it loops through each one, doing the following:

  • Grab the project description and a reference to My Computer.
  • Using the reference to My Computer, we get a list of all the Children items to My Computer, i.e. all of the items in our project.
  • Then we run a recursive VI, Recursive Documentation.vi, on each item, which prints documentation for the current item and any children it has.
  • In the end it has built the documentation string based on the functionality of the Recursive Documentation.vi

 

Additional Information or References

 

Here's the VI Snippet of Project Documentation.vi:1.png

 

Here's the VI Snippet of Recursive Documentation.vi: 

2.png

 

3.png

 

 

Notes

This example only provides a starting point for documenting a project.  It doesn't document every kind of item in a project, but the method used for the two that it does cover (VIs and Classes) can be used to extend the example to more item types, such as Variable Libraries and Build Specifications.

 

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Jared S.
Applications Engineering
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
M_Peeker
Member
Member
on

This looks to be what I need right now, however I'm sitting on LV8.6. Any possibilty of getting it in 8.6?



CLA
www.dvel.se
jareds
NI Employee (retired)
on

Sorry that I just noticed this.  I've added one that should work in 8.2 and up.

Jared S.
Applications Engineering
National Instruments
M_Peeker
Member
Member
on

Hi jared, and thanks.

However, it still is in version 9.0 (as the error message calls it). Could you repost?

I could very well install 2009 at home (I need to get around to that anyway) and sort myself out, so don't get out of your way on this one.



CLA
www.dvel.se
jareds
NI Employee (retired)
on

Sorry about that.  I saved for a previous version, but for some reason decided to edit and save the VIs in 2009 again.  I've loaded the real 8.2 VIs.

Jared S.
Applications Engineering
National Instruments
dsavir
Active Participant
Active Participant
on

Hi,

Great code! I created my own project documentation tool based on your code, I published it here.

Thanks for sharing,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
krupa
Member
Member
on

Its not working for me.Pls help.

dsavir
Active Participant
Active Participant
on

What exactly isn't working for you? Do your VIs have documentation (in the VI->file->properties [or ctrl+i])? If you want a linked html report, you can try my code, linked above.

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
Olivier-JOURDAN
Active Participant Active Participant
Active Participant
on

I know that this document is old, but it's one of the first results given by search engines.

For the record, I just want to point out that the Antidoc tool can be a solution to generate automatically your code documentation.


Olivier Jourdan

Wovalab founder | DQMH Consortium board member | LinkedIn |

Stop writing your LabVIEW code documentation, use Antidoc!