Showing results for 
Search instead for 
Did you mean: 

comment blocks in labview?

is there any way to make a comment block,
i.e. /* comments.... */

in labview?

I suppose you could enclose your code in a case or while loop that never
executes- but what if
you are trying to comment out code that doesn't work?

Seems like this would be handy when you are debugging, and have the luxury
of commenting out
part of your program you don't need to work on-
or during documentation when you need to write some example code that you
don't want to interfere with anything else.
0 Kudos
Message 1 of 2
There are a couple answsers to this question...

You can, as you pointed out, simply put a case structure around something and wire a constant to the selector such that the code you don't want executed is in the case that isn't selected.

A more fundamental answer to this problem lies in the way you design your LV code. In the many years I have worked with the language I have seldom needed the ability to comment-out code because, LV code is naturally modular. Hence, if you divide up your task properly you don't have to worry about commenting out portions of a large diagram, you simply execute the subVI(s) making up the functionality you want to test.

With a graphical dataflow programming environment such as LV that lets you interactively execute any
subroutine simply by opening its front panel and clicking the run button, testing and troubleshooting takes a very different form than it has in most text-based languages.

Think of it this way, BASIC had the "goto" statement as a way of implementing branches in the code. Likewise, when C came along it also had a "goto" in it--but it is rarely if ever used. Why? Because C has more sophisticated flow-control structures that make the BASIC way of doing things obsolete.

In the same way, LV has some control structures like those in other languages, but the dataflow orientation of the language means that you can spend less thinking about them--and indeed use less of them. And frankly there are things that are absolutely manditory in other languages that are obsoleted in LV.

The bottom line is that just as C requires a fundamentally different way of thinking about development tasks than did, say BASIC or COBOL; so working in LV requires a different way of thinking about the job of pr
ogramming than any of the earlier languages (with the possible exception of Forth--but thats a different digression).

Hope you got an answer from all this rambling...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 2