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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Comment out some sections of Labview programs during debuging

In other programming such as VC or VB, we can always comment out some sections of our program so that the commented section are not executed during debuging. Is there any way to comment out some sections of Labview program during debugging?
0 Kudos
Message 1 of 7
(2,661 Views)
You can use a case structure to surround the section of the program you do not want to execute and then wire a false constant into the input so the case will never execute.
Message 2 of 7
(2,659 Views)


@YanWong wrote:
You can use a case structure to surround the section of the program you do not want to execute and then wire a false constant into the input so the case will never execute.





Just remember to encapsulate the code within the "TRUE" case, otherwise it will execute it in the "FALSE" case..

- just in case -

😉
Message 3 of 7
(2,645 Views)


@YanWong wrote:
You can use a case structure to surround the section of the program you do not want to execute and then wire a false constant into the input so the case will never execute.




Also remember that doing this will only work if the code you "commenting" out must be executable. A broken run arrow will still be there after you put it in the Case Structure. If you are trying to comment out some broken code, you're out of luck, at least now.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 4 of 7
(2,638 Views)
Thank you Ed,

This was a very important item to point out.

-JLV-
Message 5 of 7
(2,636 Views)
Add to that;

Bad dll calls that fail durring the load,
Or
An Event structure configure to lock FP until...

The attached illustrates this behaviour.

Hit "Stop" before "Stop2" and the code never stops!

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 7
(2,605 Views)
Oh yes...

I've seen that before...

😉
Message 7 of 7
(2,595 Views)