LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pause a for loop

Hi,

 

I am trying to do something like a countdown timer. I just created a for loop and then wired its loop count to a string indicator on the screen after converting the loop count to string. And on front panel you can see one, two, three etc. But I want to pause the for loop in between. Is there a way I can do that. Thank you. 

0 Kudos
Message 1 of 4
(691 Views)

Hi govindsankar,

 


@govindsankar wrote:

I am trying to do something like a countdown timer. I just created a for loop and then wired its loop count to a string indicator on the screen after converting the loop count to string. And on front panel you can see one, two, three etc. But I want to pause the for loop in between. Is there a way I can do that.


Sure!

The simplest solution would call the OneButtonDialog (inside a case structure inside your FOR loop) when you want to "pause" the loop:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(683 Views)

The correct way would be to have a while loop and a proper state machine (look it up!).

 

States could be (1) idle, (2) paused, (3) counting down, etc.

 

Not sure why you need a string indicator to display a numeric value.

 

Start by attaching your VI. Make sure it has all the controls and indicators you need (start countdown, pause countdown, show numeric progress, enter target time, end program, etc.). Explain the reason for each and how it will be used during the run.

0 Kudos
Message 3 of 4
(634 Views)

@altenbach wrote:

The correct way would be to have a while loop and a proper state machine (look it up!).

 

States could be (1) idle, (2) paused, (3) counting down, etc.

 

Not sure why you need a string indicator to display a numeric value.

 

Start by attaching your VI. Make sure it has all the controls and indicators you need (start countdown, pause countdown, show numeric progress, enter target time, end program, etc.). Explain the reason for each and how it will be used during the run.


He has 247 posts.  he should know the basics (like attaching the VI) by now.  😕

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 4
(606 Views)