From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
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
(1,776 Views)

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.

Santhosh
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
(1,765 Views)

This works. How do I show the block diagram?

RHutchings_0-1628098480972.png

 

0 Kudos
Message 3 of 16
(1,750 Views)

A simple Event Structure would work here:

 

blink.png

 

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
(1,732 Views)

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.

Step.JPG

0 Kudos
Message 5 of 16
(1,726 Views)

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

 

Bonkerz_0-1628105613699.png

 

0 Kudos
Message 6 of 16
(1,721 Views)

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

 

Bonkerz_0-1628120882147.png

 

0 Kudos
Message 7 of 16
(1,697 Views)

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

0 Kudos
Message 8 of 16
(1,661 Views)

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
(1,654 Views)
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
(1,646 Views)