Showing results for 
Search instead for 
Did you mean: 

How to comment out code including front panel objects with it ?

I often find myself comment out big sections of code that worked before, keeping them intact. I then modify a copy of that section of code to version 2, 3, etc... This is how I usually do in C with /* */. This way I have a record and with a quick look I can see what has changed.

Unfortunately this methods leaves multiple versions of front panel objects with which the code had been commented. I am also less inclined to save a new VIs for each version, seems too much work...

What is the best way to achieve this purpose ?

0 Kudos
Message 1 of 7


You might wanna try Diagram Disable Structure. Then you can copy you code in that structure, and it will not be seen on the frontpanel


0 Kudos
Message 2 of 7

The diagram disable structure does not hide front panel controls.   And code is never seen on the front panel because it only exists on the block diagram.


If you need to hide disabled controls, you will have to hide them from the front panel.  Another choice would be to move them off screen.

0 Kudos
Message 3 of 7

If the control is shared among the different versions, you can try moving it outside the disable structure, so that it's shared.


A more general answer is that you should probably use source code control (SVN is free and easy to understand, but there are others). That gives you a backup, allows you to maintain a full history and allows multiple people to work on code. You can configure your SCC provider to work with the LV diff tool, which will then allow seeing the changes between different versions of the same VI.

Try to take over the world!
0 Kudos
Message 4 of 7

Thanks all, I am aware of above solutions and it seems there is no nice workaround. Perhaps NI should auto hide the front panels objects if they happen to be in the Diagram disable structure. It makes no sense they should appear on the front panel when the control/indicators themselves on block diagram are disabled.

0 Kudos
Message 5 of 7

Sounds like you should be using source control (which is even more true in text based languages as well)! Make a change, commit to source control and add a note saying what you changed and then you can can easily look back through the history of a VI without needing to add lots of dead (un-executed) code. If you use a server (e.g. an online repository or a network server) then you get the added bonus that all your code is backed up too!

LabVIEW Champion, CLA, CLED, CTD
0 Kudos
Message 6 of 7

Here are a few ideas that touch this subject:

You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 7