LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get the accurate times displayed on waveform chart from data written to TDMS file?

Attached is a .tdms file I have created with a very simple VI I created to learn some things about LabView.  I am trying to capture some simple data, write to a file, then read the file and have the data displayed.  The problem I am having is with the Time column / data. 

 

I have the .tdms file opened and displayed on a waveform chart.   The data recorded displays perfectly, but the times are not. 


When I use the TDMS File Viewer to open the .tdms file,  I can see the "accurate times" in the Values tab, but the Analog Values show what is actually displayed as the time scale on my chart.

 

The attached file is a small collection of data for approximately one minute.  When I read this data into the chart, it looks as though the time of the test is around 6 minutes.  The 6 minute time scale is based on what the Analog Values tab shows in the TDMS file viewer. 

 

How can I get a waveform chart to use the "accurate" times seen in the Values tab as the actual time scale for my chart? 

 

0 Kudos
Message 1 of 9
(5,170 Views)

Here are the VIs I used to record and read the data.

 

 

Download All
0 Kudos
Message 2 of 9
(5,169 Views)

James;

 

Could you attach the read vi you use, you attached 2 copies of the writer...

 

Hunter

0 Kudos
Message 3 of 9
(5,136 Views)

DOH!

 

Here it is.  Nothing fancy. 

 

Thanks. 

0 Kudos
Message 4 of 9
(5,125 Views)

James

 

I don't quite understand what you are asking, I ran your writer file and get the following TDMS file. The time on the bottom of the graph is accurate. I ran this test for about 20 seconds and that is what is show on the bottom of the graph and on the values table. Can you clarify what the difference in what you are seeing and what you are expecting to see.

 

Hunter

 

 

0 Kudos
Message 5 of 9
(5,105 Views)

Hunter,

 

Thanks for looking at this so far.  I am very new to LabView and it would seem as though this would be an easy thing to do, but it is turning out to not be. 

 

 If you look at the initial_data image, you will see the time I ran the test was from 8:21 to 8:22, a one minute test.

 

 When I read that data in, it seems to get spread out over a three to four minute spread.  See reader_data.png. 

 

When I open the file in a TDMS File Viewer, the time values listed in the Values (table), the times listed appear to be accurate.  However, when I look at the Analog Values (graph), the data is once again spread out over that three to four minute period. 

 

It seems too easy to assume that the actual times could be used as my X-Scale on my chart when looking at the data.  

 

Additionally, when I change my time delay to a lower value, the time discrepancy becomes more apparent.  


Thanks again for helping. 

 

- James

Download All
0 Kudos
Message 6 of 9
(5,089 Views)

James

 

It turns out that this issue is quite complicated but have been working on this issue for a while and I have some answers. The reason the "manual signals" do not have the correct time scaling on TDMS graph is they use the default delta t value of 1 s, so the more samples you get the further into the future the graph will go. I am working on a actual fix but until then there is a relatively simple work around you can do.

 

Express VI's are great but they only play well with other express VI's. If you want to use express VI's like the write to measurement file you can use other express VI's to make them work well together. The picture below shows how to use the simulate signals to read in a numeric or Boolean control. This is kind of a hack but it works well, you can look at the TDMS file and see that all the data points line up and are in actual time. Notice the "Boolean to (0,1)" to convert the Boolean to a numeric input. So this would actually store the Boolean as numeric data but you could strip it back out with the opposing (0,1) to Boolean VI. 

 

 

 This is not a perfect solution, but it should get you going in the mean time.

 

Let me know if this helps.

Hunter

0 Kudos
Message 7 of 9
(4,986 Views)

Thanks, I'll give something like this a shot and let you know how it works out. 

 

- James

0 Kudos
Message 8 of 9
(4,929 Views)

Huter,

 

Your solution seems to be working rather well.  Thanks for the help.

 

- James
0 Kudos
Message 9 of 9
(4,888 Views)