LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Dharsen

Change the "while loop" name to "do while".

Status: New

In common, the loops are divided into two categories: entry control loops and exit control loops. The entry control loop checks the condition first, and the code will get executed only if the condition is true. But in the exit control loop, the code will get executed first, and then the condition is checked.

So the "for loop" and "while loop" are entry control loops that will not execute the code if the condition is false, but the "do while loop" will execute the code (run) one time even if the condition is false because it is an exit control loop.

 

This is also the case in Labview, where the while loop will execute the code (run) one time even if we wire true to the conditional terminal, but in the for loop, if we wire 0 to the count terminal code inside the loop, it never gets executed.

So it is more meaningful to say the labview's "while loop" as "do while loop".Screenshot 2024-01-05 110311.pngScreenshot 2024-01-05 110320.png

2 Comments
Intaris
Proven Zealot

There is only the one while loop available in LabVIEW.

I don't see the value of further differentiating between "Do while" and "While". It raises more questions than it answers.

It follows dataflow just like everything else. Its behaviour is a logical deterministic consequence of that. Within the context of dataflow, it does exactly what it should.

Yamaeda
Proven Zealot

Just like in the C-family, LV uses the While name (and declares it first instead of a do-while), the function is the same.

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

Qestit Systems
Certified-LabVIEW-Developer