02-18-2013 03:53 PM
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
02-19-2013 03:42 AM
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
02-19-2013 04:21 AM
02-19-2013 09:25 AM
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.