02-18-2009 07:23 AM
Hello,
I am writing some data into a TDMS file using the OPEN/WRITE/CLOSE tdms sequence and then I am reading it back using the OPEN/CLOSE/READ sequence but I dont know how to insert a timestamp of the absolute time and date when I write and recover it back when I read.
Any help would be appreciated!
02-19-2009 07:45 AM
You have three options.
02-19-2009 08:25 AM
Hello DFGray,
Thanks for the reply.
Now the data I am writing is some manipulated data from a daq signal and is writen as a dynamic data type (which i think has time in it as well).
When I read it back using the open/read/close sequence I get waveform of the data I read but the time axis starts from zero, even though its not correct (i.e. if i write for 50 s the time axis when I read it back not only starts from zero but its only 20 or so seconds).
Basically the data type out of the read tdms is 1D array DBL, so its not a dynamic type (for which i am guessing the problem is).
I am very very new to LabView so your further help would be appriecated.
02-20-2009 07:18 AM
02-20-2009 08:09 AM
Hello,
I understand your explanation in fact I was trying it yesterday but couldn’t sort it out completely!
Anyhow (because things are strange and unforeseen) I am using again the write and read to measurement file and with the use of align & resample and select signals vi (in parallel for comparison) I think I am getting the time axis right.
So the problem was easier than i thought.
I am planning a bit later though to (because we have to record measurements for up to seven days continuously in one case) to discard some data ( for example not to write to file when current is very small, but I would preferably want to have the time information written on the file), so I was wondering if you have any ready files I can see on how to do that.
I know I can use the enable setting of the write to measurement file with probably a comparison sign but maybe you know better ways of doing it.
Thank you for help.
Regards
02-23-2009 03:36 AM
Hi Tony,
Thats it exactly, by using the comparison that should allow you to only save to file when you have met your trigger settings.
Regards,
02-23-2009 08:11 AM
Tony,
I am unsure, from your post, whether you want to store single points or waveforms when your current is above a certain threshold. I also do not know how fast you are acquiring data. The solution will differ depending on these items. You may also want to check the LabVIEW help for data logging example (Help >> Find Examples...). For waveforms (fast data collection), all you need to do is store a WDT. This will timestamp the data. For single points (slow data collection), save a timestamp and the data as a data pair (in TDMS, this would be data and attribute).
Let us know if you need more info.
02-23-2009 10:03 AM
Hello,
So far we are taking measurements correctly thank you for your replies.
As James said the best way to do it is to use a comparison vi for enabling the write to meaurament file.
I guess the latest will probably do the job for us if we plan to take very long time measuraments and discarding some data (hopefully it must have the time information).
{@DFGray - I am sampling at 1k Hz and reading 200 samples. I am measuring current, voltage at 50 Hz (mains) as well as unperiodic voltage from thermistors which is then translated to temperature (at the same rate as I want the readings at the same time).}
So for the moment we are not encountering any problems yet!
If we encounter any problems Ill let you know gentleman.
Thank You!