LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure in while loop

I am kind of new to Labview and have the following Problem: I have a event Structure inside a while loop and also want things to happen every second regardless of events fired. So I put it in the Timeout tab of the event struct with 1000ms timeout. The problem is, that this results in my while loop only updating every second or when one of the other events fire. How do I get my while loop outside of the event struct to run faster?

 

I also thought about reducing the timeout timer and do things inside that only every n-th time so they happen only every second but this doesn't seem to be the right way...

 

 

 

0 Kudos
Message 1 of 3
(2,316 Views)

Hi Simon,

 

the timeout event is only fired when no other event occures…

When you want to execute a loop at a regular interval you should put that code in a parallel running loop!

Best regards,
GerdW


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

You can easily do some math whenever a non-timeout event occurs to calculate an appropriately shorter timeout to be put in a shift register. (Long ago, I posted an old example that does just that, but there are many ways to do it, of course).

 

 

Message 3 of 3
(2,287 Views)