LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pause button in a For Loop

Hi everyone, i have some problems with the implementation of a 'Pause Button' for a 'For Loop'; I am using a QMH, in the 'consummer part' i am running 2 "For Loops" one inside the other, i found a way to pause a 'while loop', then i decided to do a simple VI to make sure if it is possible to Pause a For Loop with that idea, and the answer is 'yes', at the moment I use this idea in the main program, i realise when i wanna pause the for loop to see some details in a Table indicator, the button was not doing anything, as if it were not enable. Ty for your answers.

0 Kudos
Message 1 of 4
(926 Views)

@taimen wrote:

Hi everyone, i have some problems with the implementation of a 'Pause Button' for a 'For Loop'; I am using a QMH, in the 'consummer part' i am running 2 "For Loops" one inside the other, i found a way to pause a 'while loop', then i decided to do a simple VI to make sure if it is possible to Pause a For Loop with that idea, and the answer is 'yes', at the moment I use this idea in the main program, i realise when i wanna pause the for loop to see some details in a Table indicator, the button was not doing anything, as if it were not enable. Ty for your answers.


The problem is that you coded it incorrectly.  Just fix the code so that it is correct and it will be fine.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 4
(909 Views)

The button can only be read if it's either inside the FOR loop, plus the FOR loop must get to the code place where the button is put, or the button is outside the FOR loop in a WHILE loop running in parallel. This is how most people would do it, unless the button is only used in that particular loop.

0 Kudos
Message 3 of 4
(903 Views)

@taimen wrote:

 i realise when i wanna pause the for loop to see some details in a Table indicator, the button was not doing anything, as if it were not enable. Ty for your answers.


There is not real way to make sense of your question. A state machine is probably a much better architecture than huge Aztec pyramids of loops inside loop inside loops inside loops ....

 

What has "pausing" to do with looking at a table?

 

A button is a control and cannot do anything on its own. Do you mean nothing happens when you press it? We can probably give more specific advice once you show us your code.

0 Kudos
Message 4 of 4
(866 Views)