LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert timed loop to normal while loop

Solved!
Go to solution

How to convert a Timed while loop to normal while loop with exact same properties and execution?

I donot need to worry about the exact timing. But it need the While loop to be executed similar to timed loop.

 

And also, is there any issue faced when we use Timed loop? problems like crashing of exe??

0 Kudos
Message 1 of 9
(2,933 Views)

Hi,

 

You can just right click on timed loop and select the option Replace with while loop and the timed loop executes at the period you specify, you can assign priorities and it is used for time critical applications read context help for more details. And in while loop you can put wait ms timer to specify the delay.

 

And what are the properties you have set in timed loop?

 

Using Timed Loop will not crash your exe or code.

 

0 Kudos
Message 2 of 9
(2,929 Views)

Hi Karthikeyan,

 

Follow the below mention step to switch Time loop to normal loop.

 

Graph.JPG

 

You are going to design system with time loop or while loop for your Data Acquisition. It's upto you how you want to design the system or you feel more comfortable in your coding. Check this data Acquisition Link for more detail of while loop data acquisition.

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 3 of 9
(2,928 Views)

Timedloop

This is the timed loop that i want to convert.

I put a "Wait until next ms muliple" block with constant wired as 10 (10 ms).

Will that be sufficient?

Does Loop timing source 1KHz relevent in normal while loop? if so, how to attain that property in while loop?

0 Kudos
Message 4 of 9
(2,924 Views)

Hi,

Using the 1KHz clock, the timed structure executes once every 1ms. So in your normal while loop use "wait ms" with 0.001(1ms) constant wired.

0 Kudos
Message 5 of 9
(2,918 Views)

Check the data acquisition link in my above post. No need for delay in while loop. You have to configure your sampling rate and number of samples to read to decide your acquisition rate.

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 6 of 9
(2,915 Views)

in My timed loop, dt is wired to constant 10.

I am using Ni USB Scope 5132. I need to aquire samples in regular intervals.

In configure time loop window, it is choosen as 1 KHz.

It is confusing. Which is actual time of the loop????

0 Kudos
Message 7 of 9
(2,912 Views)
Solution
Accepted by topic author lxkarthi

Hi,

 

1kHz is the base clock used. Then, you decide to use 10 as period (dt) wich is 10ms.

The clock is selectable because in Real-Time systems you can use the 1MHz clock, giving µs resolution.

But for your needs, using 1kHz clock with dt=10 and using a wait ms with 10 wired to it is exactly the same.

Olivier L. | Certified LabVIEW Developer


0 Kudos
Message 8 of 9
(2,903 Views)

Thanks a Lot..

0 Kudos
Message 9 of 9
(2,897 Views)