LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve stored tdms data with the help of date & time

Hi everyone..

my question is that how can i read stored tdms data  for a particular time  with the help of time & date control. I am attaching this VI in which i am storing a group of data  .

i want to retrieve this data for particular time  with the help of time & date control.

0 Kudos
Message 1 of 6
(3,628 Views)

Kindly convert the code to LabVIEW 2017.


CLD Using LabVIEW since 2013
0 Kudos
Message 2 of 6
(3,601 Views)

Currently, your code doesn't do what you think it does. Be sure to read carefully the help on TDMS Write. As written, all your data is written to an Untitled channel and Channel-1. This is exactly as the help describes because of the array you pass in. You need to convert the array into a column of data and not a row. Again, I recommend reading the help file.

 

http://zone.ni.com/reference/en-XX/help/371361P-01/glang/tdms_file_write/

 

Second, you can view the data easily using the TDMS File Viewer.vi function in Labview. This can help you debug issues with your TDMS file (you'd see all the issues with your data format).

 

Third, I would recommend not using a TDMS file because they are so hard to handle and have lots of gotchas. I would recommend a human readable file such as a CSV. If this is long term, low repetition rate logging data, also consider a database.

 

However, if you must use a TDMS file, you have a couple options for find the data associated with timestamp. One way is just read in all the data and then do a search for the time stamp. Note that a time constant can actually be a double value (timestamp to double conversion) so all your data can be same value. Then just load in the full 2D array, pull out the data column for the time and find index of the closest value to the one you want. In one application I had, since the TDMS files were GBs, I did a binary search in the file for the time. So options abound.

0 Kudos
Message 3 of 6
(3,586 Views)

I am being able to store data but i do not know that how to retrieve a particular data from that all data with the help of two time & date control

0 Kudos
Message 4 of 6
(3,561 Views)

Could you post your updated code? What have you tried so far? Can you elaborate a bit on your goals? To me the solution depends a bit on how much data you plan on collecting and the data format you plan to use. However, I recommend using a spreadsheet file (comma seperated file) instead of TDMS for the application you original wrote.

0 Kudos
Message 5 of 6
(3,549 Views)

I will retrieve data of almost 5 years .

I want to use tdms because i will use many group of data.

0 Kudos
Message 6 of 6
(3,531 Views)