LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 12/28/2009

Highlighted

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.

DNatt, LV R&D
Message 1 of 6
(3,496 Views)
Thanks for the tip!  I didn't know about that feature and it will be very useful.
0 Kudos
Message 2 of 6
(3,457 Views)
I am constantly using probes. This is a handy feature to know about.
PaulG.

LabVIEW versions 5.0 - 2018

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 3 of 6
(3,444 Views)
I'm surprised how many developers I talk to who don't know about this feature - it's beyond invaluable when you have more than one or two wires you want to keep an eye on, especially when you're not positive exactly what you're going to want to check post-execution. Having cascading functionality built-in would be awesome to see in the future.
0 Kudos
Message 4 of 6
(3,443 Views)
One feature that I particularly appreciate is that, during execution, when you float the probe tool over a wire its value appears similar to the way a tool-tip text does. Just put a breakpoint after the section of code you're interested in and you can query all of the data up to there.  No probe windows required.
Message Edited by jcarmody on 12-28-2009 02:28 PM
Jim
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 5 of 6
(3,427 Views)

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.

Jarrod S.
National Instruments
Message 6 of 6
(3,337 Views)