From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Link between documentation tags and FPs

Hello all,

When crating a function panel, I remember that there's some way to partially populate it automatically based on the documentation tags (HIFN, HIPAR...) but I can't seem to find the way to do it. Or is it the other way around, creating function prototypes and documentation tags from a newly created FP ?!?

Thanks

0 Kudos
Message 1 of 8
(2,304 Views)

If you open a header file that contains documentation tags Options>>Generate Function Tree is what you need.

You can also have a look on this tutorial about documentation tags

Message 2 of 8
(2,295 Views)

Hmmm, that's what I'd tried and the link you provide at least gave me a working example. When used on a DLL header, it's really picky as to what it will covert to a FP. For instance:

 

export int DLLEXPORT fn1(int a);

// Unknown data type error

 

DLLEXPORT export int fn2(int a);

// fails silently

 

export DLLEXPORT int fn3(int a);

// Unknown data type error

 

DLLEXPORT int fn4(int a);

// Fails silently

 

int DLLEXPORT fn5(int a);

// Success at long last !!!

 

I'd file this as a bug report...

0 Kudos
Message 3 of 8
(2,284 Views)

Also the syntax is actually quite different from the documentation tags: HIFN, HIPAR, HIRET etc become HFUN, HPAR and many more. Is there a reason for that ? Maybe the former are supposed to be used in the.c file and the latter in the .h, but then it's double the work to document your code !

0 Kudos
Message 4 of 8
(2,283 Views)

Hi 

Did you mention this: http://www.ni.com/tutorial/6502/en/ Using Source Code Tags to Enhance LabWindows™/CVI™ Code Documentation  ?

0 Kudos
Message 5 of 8
(2,277 Views)

Absolutely. Why two sets of tags for what will eventually be the same comments ?

0 Kudos
Message 6 of 8
(2,266 Views)

In the documentation it saysThe following tags might appear similar to the tags you use to generate a function panel from a .h file. However, you can use the following tags only in .c files for the purpose of adding information that appears in tooltips. You can use header file tags only in .h files for the purpose of defining a function tree structure.

0 Kudos
Message 7 of 8
(2,243 Views)

And yet, using the following in your header file DOES work in creating a FP (note the use of parameter position instead of parameter name...):

 

/// HIFN	Add two numbers
/// HIPAR	1/First number to add
/// HIPAR	2/2nd number to add
/// HIRET	Sum of a and b
int DLLEXPORT Cmpt_AddI(int a, int b);
0 Kudos
Message 8 of 8
(2,233 Views)