LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to document type defs?

I have many strict type defs that I use to abstract my designs (like state names, methods of action engines, and anything that might otherwise be a magic number).  I would like to produce an output (maybe HTML or text) that identifies every enum of every type def.  Does anyone know of a method to do this?
0 Kudos
Message 1 of 6
(3,022 Views)

If you have documented each control in the 'Description' field, then you can print the documentation for multiple controls at once.

The 'Description' Field is under the 'Documentation' category in the 'Control Properties' dialog.

 

To print the description field:

Open one of the controls

Go to File->Print...

Then select 'Multiple VIs'

Then add all the controls you want to document.

Follow the instructions in the wizard to specify what you want printed

Then select your Destination as an HTML (other choices are a printer, rich text, or plain text)

 

Hope this helps! 

-Jonathan 

Message Edited by malkier on 10-22-2008 04:40 PM
-----
LV 8.2/8.5/8.6 - WinXP
0 Kudos
Message 2 of 6
(2,989 Views)
Thanks for the info.  Actually, my intent is to get more information than I presently have in order to do the documentation.  For example, I would much rather write the documentation outside of LV and not have to make a list of the enums for each of my 100 type defs by hand.  We're talking close to 1000 items that have to be documented.  Can I get the list from the controls or do I have to retype every one?
0 Kudos
Message 3 of 6
(2,956 Views)

If you have the items in a project then you can get the list of items in the "Dependencies" item and simply get all the items that have .ctl as the extension, which should be controls. You can then export this list of names to a text file.

 

An example of getting that list of items can be found in this thread

0 Kudos
Message 4 of 6
(2,948 Views)

Ok, so I think what you want is a way to list all the strict type def, enum, control, strings along with the name/label of said enum.

 

Since using the print documentation/description doesn't print out the actual value in the enum.

 

So heres what I came up with....

 

Attached is a VI that takes in a path to a control, opens a VI reference, grabs the control reference, then outputs an array of enum strings for that control and the control label.

Enum to String

 

This only works with strict type defs since I am type-casting to an enum(strict) reference, but this should get you started.

 

So, I'm thinking you can loop through the controls in a folder that are enums and this will give you a string array for each enum.

 

Hope this helps,

Jonathan

 

 

Message Edited by malkier on 10-23-2008 03:58 PM
-----
LV 8.2/8.5/8.6 - WinXP
Download All
0 Kudos
Message 5 of 6
(2,938 Views)

malkier--

 

Wonderful!  Exactly what I needed.  Thank you all.

 

kc64

0 Kudos
Message 6 of 6
(2,926 Views)