LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i add a time stamp to tdms file?

I want the data and the time for the tdms file generated?

how can i do that?

should i cinvert .tdms to .lvm and use the data storage option or excel add on option for .lvm file created?

cant i directly have the time stamp for tdms file generated?

0 Kudos
Message 1 of 10
(6,958 Views)

How are you acquiring the data in the first place?  That will matter in how we want to approach this.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 10
(6,929 Views)

I would like to ask again this question to find a good way to go about including the time stamp in my measurements. My situation is the following. 

 

I take a measurements with 3 different insturments (DMM, LCR, Electrometer), each of these measurements is based off of output pin connections and will be grouped that way. As you can see in the TDMS file opened with the Excel Plugin that is how I have the data. 

 

TDMS_OUT.png

 

Each Pin connection has it's own tab, Pin 0 to 0, Pin 1 to 2, Pin 3 to 4, and Pin 2 to 4. And each tab has a history of the measurement taken between those pins. My problem is that I need to add a timestamp to have some reference for when things are happening. 

 

This is a slow test stand as I am using a switch matrix and one insturment at a time to take these measurements, and although the DMM, LCR, and Electrometer take each round of measurements at different times, a single column of time stamps should suffice for now. 

 

I have attached my main.vi and a few of the relevant subVIs to maybe get some help. 

 

Thanks,

 

Kellen

 

Log_Data.png

 

0 Kudos
Message 3 of 10
(6,716 Views)

Just use another TDMS Write to write the timestamp.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 10
(6,709 Views)

You can do it like this.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 5 of 10
(6,702 Views)

Like how James?

0 Kudos
Message 6 of 10
(6,686 Views)

Is it necessary to use the "Convert to Dynamic Data to make this work like I have with the 1D array? Or is there a problem with doing it that way? 

 

Log_Data_Fixed.png

0 Kudos
Message 7 of 10
(6,680 Views)

@rkmadse wrote:

Like how James?


Did you click on the link?

 

You don't need to convert to dynamic data.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 8 of 10
(6,671 Views)

James, Thanks for the example that was helpful. You answered both of my questions. A follow up question would be, is there a better method of storing my data while it waits to be written to a TMDS file? I am currently saving it as a double in a Clustor, but am needing to add in a timestamp for each measurement now. Should I just add Timestamp constants for each measurement to the clustor and then use a second array and a for loop at the output to make it work? The desired format is the following. Where there is a time stamp for each measurement.

 

Desired_Format.png

 

The Producer Consumer (State Machine)  method I am using looks like this (Excluding the Producer Loop)

 

Consumer Loops.png

 

 

 

0 Kudos
Message 9 of 10
(6,658 Views)

You need to store your timetsamp to the cluster when you acquire the data. Otherwise your timestamp won't be matching up with the actual time that the data was acquired.

 

The way you have it now could result in this scenario (and most definitely will on a smaller scale):

  1. Data is acquired at t=1234ms
  2. Data is added to cluster and enqueued at t=1235ms
  3. 100ms passes while consumer loop is busy with other data
  4. Data is dequeued at t=1335ms
  5. Timestamp is set as t=1336ms
  6. Both data and timestamp are written to file

The above scenario results in a 102ms offset between the timestamp that is written to file and the actual time that the data was acquired.

 

 

You also do need to add a timestamp for all datapoints, not just a single timestamp. Does you acquisition include timestamp information? It's a VISA connection it looks like. Is it triggering the acquisition and then waiting for those points to come in, or is it acquiring the last few points from a buffer? You're going to have to come up with an array of Timestamps that match your data at some point. If you data is streaming, this might be best done by using a t0 value when the stream is first triggered and a dt value from there on. If the data acqusition is on a trigger basis, then you'll need to store a single timestamp and then calculate the others based on your sample rate.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 10 of 10
(6,639 Views)