LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write the data into a file in 10 ms interval within 10 sec

Hi,

 

I'm trying to write the data into a file when I press a OK button and the data should write in a file every 10ms interval. After pressing the OK button the process will stop after 10 sec.

 

I've attached my VI.

 

Problem is that I'm getting the result every ms. How can I get the data every 10ms? So it'll come 1000 data within 10 sec.

 

For other calculations purpose I'm using Amplitude and Level Measurements block to get the mean DC voltage, so when I change the Samples to Read and Rates, the process is getting stuck.

 

Any kind of suggestion is appreciable.

 

Thanks,

Chotan

0 Kudos
Message 1 of 4
(3,185 Views)

Hello chotan

 

Try using Wait Until Next ms Multiple Function to write data into file every 10ms.

 

You could use two Tick Count timer (one before and one after the data acquire funtion ) and calculate the difference and compare whether this value is greater  than or equal to 10000ms ( 10 sec) and wire it to STOP of the WHILE Loop. The loop stops if thevalue is greater than 10sec

 

Nghtcrwlr

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 4
(3,158 Views)
See example attached, if needed
Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 4
(3,152 Views)

Your VI does not make any sense. Your acquisition takes 1 second so there is no way to record every 10ms. Then, because your Write to Measurement is inside a while loop that does not exit until the time is up, all you are doing is recording the same data over and over again.

 

If you want to record every 10 msec, then the first thing you have to do is change your acquisition. It might also prove difficult to use the Write to Measurement File in the same loop and a 10ms continuous acquisition rate without getting a buffer overflow error. You probably want to use a producer/consumer design pattern.

0 Kudos
Message 4 of 4
(3,130 Views)