From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop doesnt start

Hi, its me again.

Still working on the same program. The program just reads some values and puts them into an array.
This is timed, but not exaclty correct. It waits for 10ms and then counts 10 up one the time-variable.
When u have a measurement time of 3 hz, it waits until the remainder of time is 0.
I calculate this like so:

remainder = time / (1000 / rate)

So if rate = 3, the time has to be 333,3333333 to enter the while loop.

Thinking of this, the programs while loop has to run every ms, which is kinda impossible IMHO.
So how to solve this?

And then another problem, the while loop which has the calculate loop etc inside of it, doesnt run on program execution. I'm wondering why not...
0 Kudos
Message 1 of 4
(2,294 Views)

You have to familiarize with the basic concepts of dataflow. Look at some example programs. Do some online tutorials.

In this particular case:

All loops on the left cannot start until the loop on the right finishes. They must wait for the boolean wires to contain data and this only happens once the loop in the right exits.

0 Kudos
Message 2 of 4
(2,285 Views)
okay. But it only has to start when the start button is pressed. That means that all the wires are connected.
0 Kudos
Message 3 of 4
(2,285 Views)
Hello k0ewl,

just read the chapter on dataflow 🙂 And then the chapter on programming style guide too... (Your program is much easier to understand when all data flows from left to right!)

The "measurement" can only start when the while loop containing the event structure finishes! This only happens when you press "exit". So you never see the measurement running, just the dialog window "2".


Best regards,
GerdW


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