LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write to spreadsheet at a reduced sample rate

Hi all,
 
I have a program that is using a USB-6218 to monitor some voltages. I am sampling at 1khz and displaying the values on a simple meter. I am also using the "Write to measurement file" function to save this data to a csv file.
 
However, I only really want to save a much lower sample rate, say every minute, so that I don't have too much data over 8hrs of monitoring.
 
Not sure how to do this. I thought of having a Sub vi with while loop containing the "Write to measurement file" function and a time delay. But is it possible to tell this to carry on running and keep the meters running on the front end at 1kHz?
 
Any suggestions much appreciated.
 
Cheers,
Dan
0 Kudos
Message 1 of 4
(4,234 Views)
The "Write to Measurement File" express VI has an 'Enable' input that allows you to turn off the datalogging with just a boolean input.
 
The easiest way would be to use the "Elasped Time" express VI and set it up for 60 secondes and have it automatically reset. (You'll see this in the configuation dialog) Connect the 'Time has Elapsed' output form this to the 'Enable' input of the file writer. You could also use the "Sample Compression" express VI to reduce the amount of data that gets written to the file while keep the all the data for display.
 
 
There are plenty of other ways to to do this not using express VIs, but this by far the easiest.
 
Ed

Message Edited by Ed Dickens on 01-18-2007 08:12 AM



Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 2 of 4
(4,227 Views)
Howdy,

Not knowing the complete plan for your data, I just wanted to point out that you may want to save an average value over that 60 seconds versus the value at that instant.  You mentioned long term trending and savig the average values may be the way to go.
Greg Cole
“It is not the ship so much as the skillful sailing that ensures the prosperous voyage.”
Message 3 of 4
(4,218 Views)
Thanks Ed, thats exactly what I was trying to do!
 
And thanks Greaper for the averaging tip!
 
Cheers,
Dan
0 Kudos
Message 4 of 4
(4,204 Views)