LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Iteration in a For Loop using a button


@billko wrote:


Well, you cannot stick them outside the loop, so it's not ANYwhere.  😉 Besides, a better experience awaits the user if you stick it inside its respective event case because then it doesn't have to wait until the next loop iteration to "unpress" again.


I think this thread is going off the rails, choo chooo : )  Just so there is a full perspective and playing the devil's advocate, this works just fine and has nice deterministic behavior (but is the behavior you want) ...

snip.png

 

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 11 of 14
(479 Views)

Except that this code does not answer most of the original questions:

 

  • It does not create two values (one random and one set by a control)
  • It does not write them to a file.

 

Here's how a very simple solution would look like.

 

altenbach_0-1654896901653.png

 

 

(I tend not to recommend event structures to newbies. Too many landmines 😄 )

 

Message 12 of 14
(467 Views)

@Jay14159265 wrote:

@billko wrote:


Well, you cannot stick them outside the loop, so it's not ANYwhere.  😉 Besides, a better experience awaits the user if you stick it inside its respective event case because then it doesn't have to wait until the next loop iteration to "unpress" again.


I think this thread is going off the rails, choo chooo : )  Just so there is a full perspective and playing the devil's advocate, this works just fine and has nice deterministic behavior (but is the behavior you want) ...

snip.png

 

 


All aboard the Crazy Train!  On a serious note, though, the button doesn't reset until after you exit the loop.

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.
Message 13 of 14
(456 Views)

@billko wrote:

@Jay14159265 wrote:

@billko wrote:


Well, you cannot stick them outside the loop, so it's not ANYwhere.  😉 Besides, a better experience awaits the user if you stick it inside its respective event case because then it doesn't have to wait until the next loop iteration to "unpress" again.


I think this thread is going off the rails, choo chooo : )  Just so there is a full perspective and playing the devil's advocate, this works just fine and has nice deterministic behavior (but is the behavior you want) ...

snip.png

 

 


All aboard the Crazy Train!  On a serious note, though, the button doesn't reset until after you exit the loop.


It won’t even I press then. The button only unpresses when it is read. It will have already been read so it won’t unpress.

0 Kudos
Message 14 of 14
(444 Views)