LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loop is not working

Solved!
Go to solution

Just started to learn LABVIEW and face this kind of difficulties. The while loop is not working, but when the stop button is pressed the loop is happen only for a cycle. Looking for help/suggestion.

MDewey_0-1709282680323.png

 

0 Kudos
Message 1 of 5
(341 Views)
Solution
Accepted by MDewey

Move all indicators inside the loop. Think in dataflow. The data in the wires outside the loop only updates once the loop has finished.

0 Kudos
Message 2 of 5
(325 Views)
Solution
Accepted by MDewey
  • Hi Dewey,

 


@MDewey wrote:

Just started to learn LABVIEW and face this kind of difficulties. The while loop is not working, but when the stop button is pressed the loop is happen only for a cycle. Looking for help/suggestion.


The while loop iterates once per second

  • when the Maintainance button is FALSE initially
  • as long as the Stop button is FALSE

You can even see the iteration once you start debugging using the highlight execution tool: you really should use this to help you understand your own code! 🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(317 Views)
Solution
Accepted by MDewey

I'd say the code works as expected, not just as you wanted it to. 🙂

 

As a tips you can r-click the needle meters and activate Visible Items -> Digital display so you don't need to update 2 controls for each value.

 

LV will read the Stop button long before it starts the wait, so it'll loop around one extra time and have on average a 1.5 sec stop time.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 5
(268 Views)

Hi, thank you for your reply. Yes, since the numeric indicator did not showing any number, i thought the problem is on the loop. Thank you for letting me know.

0 Kudos
Message 5 of 5
(170 Views)