Showing results for 
Search instead for 
Did you mean: 

Stepping at runtime

I have a program that I would like to pause at each loop iteration and restart at the next iteration using a button.. My test involves relocating a test probe for each iteration. All I see is debugging options which I'm not interested in.

0 Kudos
Message 1 of 16

Please, please, please attach your code.


My generic answer to your vague question will be - simply place a breakpoint within the loop, the execution will stop at the breakpoint everytime and you click on the pause exectuion button to continue.

Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 16

This works. How do I show the block diagram?



0 Kudos
Message 3 of 16

A simple Event Structure would work here:




Pressing the button causes the indicator to blink 10 times, otherwise it sits in the Timeout case and waits

=== Engineer Ambiguously ===
0 Kudos
Message 4 of 16

This wouldn't work I have a loop with a lot of things happening in it and sometimes I want to run non-stop and sometimes step. My solution works very well. If the Step button is true then it pauses at each iteration, if false, it completes the loop.


0 Kudos
Message 5 of 16

I think @   approach would work. That is a fundamental idea. Below is my attempt to build upon @ 's idea.


Stepping through loop.png


EDIT: Improvements (disregard the snippet above)

Stepping through loop.png




0 Kudos
Message 6 of 16

My bad, I misread it.

@RHutchings wrote:

 sometimes I want to run non-stop and sometimes step.

This also possible with what @ suggested. Check this VI snippet.


Stepping through loop_V2.png




0 Kudos
Message 7 of 16

Where's the for loop? Can you upload this so I can download it.

0 Kudos
Message 8 of 16

I do not recall putting in a for loop. Attached block diagram is a VI snippet, you can save it on your local hard drive and then drag it on to your block diagram and you will have actual coding populate on your block diagram.


But if that does not work. Attached is the VI file.

0 Kudos
Message 9 of 16
Well there's the problem, it has to be in a for loop as the program is already built with one and it's too large of a program to make such a drastic change, I think.
0 Kudos
Message 10 of 16