05-04-2015 08:24 PM
Hai guys,
Im developing a saving application that saves the data acquired in a tdm file. The file would later be open in excel for viewing. I've attach the VI in this message. The VI is actually one part of a DAQ program. The DAQ would run for a couple of hours.
-My first problem is it seems the program saves everytime a value is changed in the signal. This results in a high number of reading. How to make it such that the it will save the signal in intervals of 5 minutes? Ive attach an example picture.(Sorry for the bad picture)
-My second problem is that I want to make the 1stt column date, 2nd column time, and the 3rd column the reading.
Regards,
Newbie92
05-04-2015 09:45 PM
It is unclear what you want to do. At one level, you seem to want to take a single reading every 5 minutes, saving Date, Time, and Reading. However, this is almost too trivial to be what you really want to do. You mention a DAQ program -- what are you sampling (how many channels, what sampling rate?)? Are you sampling at a relatively high rate (say 100 Hz), displaying the data, and now want to save a point every 5 mintues?
You seem to be more focussed on how you want to accomplish your tasks (mentioning TDM, DAQ, Excel, a whole lot of Express VIs) than on what you want to do (sampling rate, # channels, what to do with the data). I suspect that clearing up the What (and getting rid of the Express VIs) will allow a simpler and more direct solution.
Incidentally, if you are going to open the TDM file in Excel for viewing, why not write an Excel file? Are you planning on running DIADem and running higher-level cross-experiment analyses?
BS
05-05-2015 02:37 AM
Hai Bob_Schor
Sorry for the unclear stetements. Well first off no, I'm not running on DIADem. Clearing on what I want to accomplish is I want to save an analog data which stream in a rate of about 10 Hz in a single channel with single sample in waveform into a .tdm file every 5 minutes as long as the program runs. I did an error in the previous code. Its suppose to be set to single channel with single sample. I'm not familiar with coding for excel saving and when I read the forum, its easier to understand the TDM coding. Sorry for the unclear request. Hope this clear things up
Regards,
Newbie92.
05-05-2015 07:52 AM
OK, you are sampling at 10 Hz, or 10 samples/second. You mention a Waveform, so I'm assuming that you are generating a Waveform from the samples, i.e. you have an array of samples, with delta-t = 0.1 seconds. You mention saving something every 5 minutes -- did you want to save the waveform (meaning all 5 * 60 * 10 samples) as a "thing" every 5 minutes (and start a new waveform variable for the next 5 minutes), or do you want to save a single sample from that Waveform (perhaps the first sample, or the last sample, or an average over the 5 minutes)?
In any case, it seems clear to me that there is a 3000-fold difference between your data acquisition rate and your data storage rate. This is perfectly OK, but (probably) means that you need to keep 3000 data points in memory during the acquisition phase (not a difficult thing to do).
Am I on the right track? Can you clarify what you want to save, and how it relates to the (much higher rate of the) data you are acquiring?
Bob Schor
05-05-2015 07:42 PM
Hai Bob_Schor
I'm terribly sorry for not mentioning to you that the parameter I'm working with are temperature, humidity, sound and light. These are the things that I want to measure. They are measured based on their change in voltage. I used the wrong signal, it should not be waveform instead a DBL.
Regards,
Newbie92
05-06-2015 09:59 PM
You would greatly help yourself if you put LabVIEW away and opened Microsoft Word. Write a one-page document describing, as completely as you can, what signals you are acquiring, how often you want to acquire a sample of each channel, how you want to relatively time the data points, how many of these points you want to save, and what you want to do with the data.
You describe recording fout types of data. I'm guessing that you want to record them all simultaneously, which suggests setting up your DAQ device as 4 channels of Analog input. Now decide at what data rate you want to sample, and how many points you want to take at a time. These latter choices will be determined, in part, by how rapidly the data you are recording are changing, and what you need to do with the data.
Now open LabVIEW and put your ideas into LabVIEW code. You should end up with about 20 LabVIEW functions on about half a laptop screen.
Bob Schor