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.
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.
08-26-2016 09:51 AM
Hi,
I now have a VI and I want to debug. There is a while loop in my VI. I am interested in what happens after a few iteration.
I want to do single stepping but not for a few loops at beginning.
How can I do this?
Thanks in advance.
Chuan
Solved! Go to Solution.
08-26-2016 09:54 AM - edited 08-26-2016 09:58 AM
Use a conditional probe off of the iteration node of the while loop. You may need to run a wire from the node to the edge of the loop if you aren't using the node already, then right click the wire and select Custom Probe->Conditional I32 Probe, then select the conditions to cause it to pause.
08-26-2016 10:11 AM
Another option: put breakpoint in the loop, click Continue button a few times, untill it gets to required iteration, then turn on Highlight execution or single stepping.
08-26-2016 10:19 AM - edited 08-26-2016 10:21 AM
Another option is to just place a breakpoint early inside the loop (i.e. on a wire that is before the bulk of the loop operations). It will pause with every iteration and then you can decide (e.g. based on the value of some other probes) if you want to unpause to immediately go to the next iteration or start single stepping or execution highlighting. (EDIT: just noticed that Alexander suggested the same thing while I was writing :D)
(the conditional probe may not work as expected because of the parallel nature of LabVIEW. There is no guarantee that the code will pause early in the iteration (but it most likely will ;)). It could theoretically be possible that a large chunk of the loop code has elapsed by the time the code is paused by the conditional probe.)
08-26-2016 10:23 AM
You could do both. Set a conditional probe to stop it 1 iteration early, then use single stepping from there as necessary.
08-26-2016 10:51 AM
@altenbach wrote:
(the conditional probe may not work as expected because of the parallel nature of LabVIEW. There is no guarantee that the code will pause early in the iteration (but it most likely will ;)). It could theoretically be possible that a large chunk of the loop code has elapsed by the time the code is paused by the conditional probe.)
Raven beat me to it, but yeah, just stop on iteration sooner.
It should also be noted that saying a few cycles can be relative, it might be 5 iterations out of 100, it might be 105 iterations out of 100,000....
08-26-2016 01:00 PM
Chief LabVIEW Architect, Testeract | Owner, Q Software Innovations, LLC (QSI)
Director, GCentral | Admin, LabVIEW Wiki | Creator, The QControl Toolkit
Certified LabVIEW Architect | LabVIEW Champion | NI Alliance Partner
08-26-2016 01:19 PM
Here you go.
08-26-2016 01:45 PM
@scofield wrote:Here you go.
While I do not in anyway want to call into question waht you shared scofield I am reply only to share my first reaction to seeing that code in the context of this thread. It think the correct term would be an;
auto-appendectomy
Ben