LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding time stamp to tdms written using DAQmx Configure Logging

Dear All,

 

I am taking as input three analogue voltage values. I modified existing example in Labview help for continuously acquiring voltage. It writes a tdms file using DAQmx configure logging Vi. When I open the tdms file i get values of my time step and channel details in first sheet and voltage values in second sheet from different channels.

 

I like to add the value of the time in column next to my voltage values.Here I am attaching the pictures and my code how it looks and how I like to have it. Your kind feedback will be appreciated.This is how I want second sheet to look like.JPGThis is how it looks 01.JPGThis is how it looks 02.JPG

0 Kudos
Message 1 of 12
(4,388 Views)

Hi mmaraza,

 

don't mix up the term "TDMS file" with how you got the information, embedded in those files, presented in Excel using the Excel-TDMS-plugin!

 

When you need a different data format in Excel you need to write your own routine to convert the TDMS data to an Excel-compatible data format. Here it's up to you to program a VI reading the TDMS data and creating a CSV file (or any other file format natively supported by Excel)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(4,379 Views)

I am very new so sorry for not using appropriate terminology. But from my code can you suggest me how can I get time values directly in my tdms file next to the columns where I get values from my channels.

 

Regards

 

0 Kudos
Message 3 of 12
(4,359 Views)

Hi mmaraza,

 

But from my code…

Unfortunately not, because I'm stuck at LV2017 right now.

(If you would attach a downconverted version of your VI I could…)

 

can you suggest me how can I get time values directly in my tdms file next to the columns where I get values from my channels.

Add a channel to the TDMS saving routine which holds the (relative) time since start of the measurement.

This is no option when you use the DAQmxLogging feature: you would need to implement your own logging routine…

 

Conclusion:

  • The DAQmxLogging is implemented just the way it is. The TDMS plugin in Excel is implemented just the way it is. You cannot change anything in those implementations.
  • But you can implement your own way of data logging and your own way of presenting data in Excel!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 12
(4,344 Views)

Hi thanks,

 

I down-converted it to 2017. And thanks for additional explanation.

0 Kudos
Message 5 of 12
(4,341 Views)

Hi mmaraza,

 

thanks for the VI.

But that doesn't change my conclusion (in the previous message)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 12
(4,338 Views)

Hello mmaraza,

Am I understand you correctly, that (in Excel) you want to have the absolute measurement time displayed next to your measures values?

That is, you want to see

2019-02-07 10:01.123     0.313216541     0.54654654    -1.4465465

2019-02-07 10:01.124     0.354353454     1.54654654    2.1353455465 

2019-02-07 10:01.125     0.567567454     1.97954654    2.9873455465 


instead of

0.313216541     0.54654654    -1.4465465

0.354353454     1.54654654    2.1353455465 

0.567567454     1.97954654    2.9873455465 

Is that correct?

If so, this seems to be a a task to be done in Excel to me. Please note that the absolute time is imported into the overview sheets, it's in your screenshot above as "wf_start_time". Use this and add the "wf_increment" multiplied with the row index on the measurement data page and you achieve what you want. Please note that this will need lots of storage space.

 

If I interpret your screenshots correctly, you have 18M samples. I don't know how much data the date data type uses in Excel, but let's assume it's only 4 bytes. Then you have 72MB to save redundant information only...

 

 

 


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 7 of 12
(4,332 Views)

Hi thanks,

 

Yes I want my data to appear with time relative time. As my first sample was read at  "o seconds" second at "0.000001" second and third one at "0.000002" so on.  But at the moment  I get value of "wf incremment" that is my scan rate  and the data i read "idc, H1 and H2"in columns I like to get fourth time column to be also there. I am not sure what change i should made in my VI so It should give me time value directly in column instead of I am modifying each time excel file.

 

Regards 

0 Kudos
Message 8 of 12
(4,328 Views)

@ikaiser wrote:

Hello mmaraza,

Am I understand you correctly, that (in Excel) you want to have the absolute measurement time displayed next to your measures values?

That is, you want to see

2019-02-07 10:01.123     0.313216541     0.54654654    -1.4465465

2019-02-07 10:01.124     0.354353454     1.54654654    2.1353455465 

2019-02-07 10:01.125     0.567567454     1.97954654    2.9873455465 


instead of

0.313216541     0.54654654    -1.4465465

0.354353454     1.54654654    2.1353455465 

0.567567454     1.97954654    2.9873455465 

Is that correct?

If so, this seems to be a a task to be done in Excel to me. Please note that the absolute time is imported into the overview sheets, it's in your screenshot above as "wf_start_time". Use this and add the "wf_increment" multiplied with the row index on the measurement data page and you achieve what you want. Please note that this will need lots of storage space.

 

If I interpret your screenshots correctly, you have 18M samples. I don't know how much data the date data type uses in Excel, but let's assume it's only 4 bytes. Then you have 72MB to save redundant information only...

 

 

 



Hi thanks,

 

Yes I want my data to appear with time relative time. As my first sample was read at  "o seconds" second at "0.000001" second and third one at "0.000002" so on.  But at the moment  I get value of "wf incremment" that is my scan rate  and the data i read "idc, H1 and H2"in columns I like to get fourth time column to be also there. I am not sure what change i should made in my VI so It should give me time value directly in column instead of I am modifying each time excel file.

 

Regards 

0 Kudos
Message 9 of 12
(4,324 Views)

Hi mmaraza,

 

I am not sure what change i should made in my VI so It should give me time value directly in column instead of I am modifying each time excel file.

Two options:

  1. Don't change anything in your VI. Open the TDMS file in Excel, then insert a new column left of your measurement data. Type in the first two timestamps: "0" and "1e-6". Then autofill that time column using standard Excel features. (This is done mainly manually. You can also implement an ExcelVBA macro to do all this.)
  2. Don't change anything in your VI. Instead create a 2nd VI which reads the TDMS file and creates a CSV (or XLSX) file from it, with exactly the information you need.

As said before: you cannot change the way DAQmxLogging and the TDMS-Excel-plugin are working. When you need different behaviour then you need to create a program implementing it…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 12
(4,322 Views)