03-02-2022 05:44 AM
Hi everyone,
I am fairly new to Labview. I wonder if there are different ways to debug the code.
Right now I always place a dozen probes to see what happens somewhere.
But now my code is stuck somewhere (have to find the right place yet). Is there a better way than using probes?
Thanks
melody
03-02-2022 05:50 AM - edited 03-02-2022 05:52 AM
If the code gets stuck, the Highlight Execution lightbulb is excellent, it'll show you which VI is working. I also like the Retain Values lightbulb so i can check all values by hovering over them without placing probes (there's always something extra you want to check). If you activate it in too many VI's things get sluggish, but if you're debugging a couple VIs it works fine.
03-02-2022 06:03 AM - edited 03-02-2022 06:05 AM
There's also NI IO Trace, which lets you see more things (like VISA communication)
edit:
and Desktop Execution Trace Toolkit (which i have never used) which seems to have some CPU details and events.
03-02-2022 01:13 PM
Attached is an ancient set of logging files that I sometimes temporarily sprinkle around suspicious code.
Also some highlighting VIs that turn highlighting on or off when execution gets to them.
03-02-2022 04:20 PM
@me1ody wrote:
Hi everyone,
I am fairly new to Labview. I wonder if there are different ways to debug the code.
Right now I always place a dozen probes to see what happens somewhere.
But now my code is stuck somewhere (have to find the right place yet). Is there a better way than using probes?
Thanks
melody
Don't write bugs.
03-03-2022 08:06 AM - edited 03-03-2022 08:07 AM
Probes.
Execution highlighting.
Temporary indicators (incl. arrays that build up data).
Temporary Breakpoints.
Temporary Message popups.
Assert VIs (See Exposing the Holes of the Assert API by Peter Horn)
Stopping the main, debug the sub VIs.
Copy subVIs into a new VI, test it there by changing the input data (gateway to unit testing).
Desktop Execution Trace Toolkit (DETT)
The best way to find bugs is to remove the crap. Bugs hide in crap.
If you can't easily find a bug, it's (almost by definition) because the code is too complex.
Pretty useless advice, as making things simple is the hardest thing 😊. But sometimes things get complex simply because no time is spend to refactor. If bugs can't be found, that's the cue.
03-04-2022 03:27 AM
03-04-2022 07:49 AM
03-04-2022 08:17 AM
@GerdW wrote:
Hi Paul,
your Log2 zip file is missing atleast one subVI ("variant to string")…
Oops.