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
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.
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.
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.
@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.
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
@GerdW wrote:
Hi Paul,
your Log2 zip file is missing atleast one subVI ("variant to string")…
Oops.