12-28-2009 11:24 AM
I've been using the Retain Wire Values feature in debugging my code quite a bit the past few weeks, so I thought I'd write a nugget about it. By using Retain Wire Values (available in LabVIEW 8.0 and later), you can probe any wire on your diagram after the VI has finished executing. Prior to having this feature, I would place a bunch of probes in my code *before* I ran it, with the hopes that I probed the right wires to help me figure out the problem.
The use of this feature can potentially affect the performance of your application during debugging, but I've never noticed any problems. Also, this setting does not persist when you save the VI, so unlike breakpoints, you don't have to worry about accidentally leaving Retain Wire Values turned on...it will reset once the VI leaves memory.
One more thing...I just noticed that Vishal has posed a JKIRCF plugin that will enable the Retain Wire Values setting for your entire VI hierarchy during debugging. You can get his plugin here.
12-28-2009 12:37 PM
12-28-2009 12:58 PM
12-28-2009 12:59 PM
12-28-2009 01:26 PM - edited 12-28-2009 01:28 PM
12-28-2009 08:02 PM
One helpful way to take advantage of the Retain Wires feature is to turn it on, then set up a conditional probe on an error wire set to pause if an error occurs. Then if this happens you can trace back the data that caused the error.
This is especially helpful in state machines by placing the conditional error probe inside the while loop of the state machine so you can know which state caused the error.