VirtualBench

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring high resolution data from DMM and writing it into a file

Hi,

 

I try to capture a voltage measurement from DMM, I would like to have 1 ms resolution, which means 1000 data per second. I tried to use a loop whose wait time is 1 ms as below:

file_write.png

But somehow the data from the written .xlsx does not generate the high resolution data (attached) as I expected. Do I do it correctly? I mean using the loop to obtain the resolution data that I want? Another question is: How to open and process this .lvf data? I have not tried it, but if it can achieve the requirement that I want, maybe it worth a try, maybe it is better than .xlsx format.

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

Writing to an .xlsx file is SLOW.  I would recommend using a simple text file instead.  Open/create the file before the loop and close it after the loop.  You can then use Write Text File inside the loop to write your data.  You will just have to do some simple formatting into a string.

 

Otherwise, you are getting into the realm where you really should use a Producer/Consumer to write your data.  The idea here being that you have a loop that acquires the data and then another loop to write it to disk.  This way you keep the acquisition loop running as fast as possible and the logging loop can lag behind.

 

Finally, you might just have problems getting down to the 1ms resolution using software timing.  You might want to consider using a DAQ.  You might have some success using the Oscilloscope on the VirtualBench, but I have not tried using it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(2,213 Views)

I have tried using .txt format and also applying the Producer/Consumer method, but still there is no luck to obtain the data at such high resolution 1ms. So is the only way by using a DAQ? I do not have DAQ yet. Any other advice might be valuable for me.

0 Kudos
Message 3 of 3
(2,166 Views)