LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is this data type and how to write it to TDMS File?

Hi NI Community,

 

I'm using a HSDIO module that. I'm currently taking the data from the niHSDIO Fetch.vi and display that information on a plot. Now I'm trying to log this data into TDMS file but it looks like the data format is not compatible. Please help me!

 

Here is the output of the Fetch.vi

hsdio_waveform_dataindicator.PNG

 

Here is the data format

hsdio_data_format.PNG

 

Here is the broken wire when trying to wire to TDMS

tdms_write_broken.PNG

 

Thank you for your help!

0 Kudos
Message 1 of 14
(2,795 Views)

I was able to log this data into TDMS by indexing that data wire like this

 

victor55_0-1601242292716.png

 

 

 

 

 

But the data only logs the data and # of samples, it does not have the time component of it. How can I also add the time component?

Here is what I see in DIAdem when I open up the TDMS file. The x axis is # of samples instead of a time like 0-10 seconds

victor55_1-1601242325427.png

 

0 Kudos
Message 2 of 14
(2,778 Views)

If you have an array of data, I suppose you should use a for loop to write each element of the array.

 

Index array only returns the first element...

0 Kudos
Message 3 of 14
(2,741 Views)

You could also use a dequeue to get individual elements.

 

You'd need a different stop strategy... Usually, the returned error of the dequeue works well.

0 Kudos
Message 4 of 14
(2,739 Views)

Thank you for your reply! Can you elaborate a little more on what that may look like? Or is there an example of that? 

0 Kudos
Message 5 of 14
(2,722 Views)

@victor55 wrote:

Thank you for your reply! Can you elaborate a little more on what that may look like? Or is there an example of that? 


I'm sure there are examples of for loops, and the dequeue function in the online tutorials.

 

It would look like this:

Dequeue TDMS.PNG

0 Kudos
Message 6 of 14
(2,715 Views)

I see. In my program, there is a problem with directly wiring the Dequeue output into TDMS file for some reasons. It could be that the data type is not compatible with TDMS? 

0 Kudos
Message 7 of 14
(2,709 Views)

I tried doing the forloop like your example. It worked! But the data written into it does not have the "time" component of the 1D WDT. It just displays x-axis as # of samples. 

 

In the DAQmx read.vi, if we configure it to "Analog 1D wfm NCham NSamp", the data written into TDMS file has the "time" component of the data points. 

 

How come it is different for 1D WDT from the niHSDIO Fetch.vi? 

0 Kudos
Message 8 of 14
(2,706 Views)

TDMS probably stores the samples, dT and T0, to save space.

 

How do you analyze the data?

 

I suppose you'd need to add a time channel to TDMS if you want all times to be stored. But if the data is equally spaced, it would be completely redundant.

 

It would help if you posted your VI... I've never needed or wanted to use a WDT data type.

 

0 Kudos
Message 9 of 14
(2,697 Views)

Thank you for your help and suggestion. Please see attached for my VI.

 

The reason why I want to have time component stored is because I'm also logging data from DAQmx. That is sampling at a lower rate so I take the data in as a wfm format so it has the "time" component. Then, I plot these in DIAdem. I want to keep the X-axis as "time" instead of "# of samples" so we can plot multiple plots of different sampling rates at once in DIAdem.

 

Here is a DAQmx channel plotting in DIAdem with its time component. Showing 2 seconds worth of data acquisition time. 

victor55_0-1601303481910.png

 

Here is a plot with the niHSDIO channel but the x-axis for that channel is in #of samples instead of time. So the plots are not aligned. 

victor55_1-1601303517474.png

 

Thank you!

 

 

0 Kudos
Message 10 of 14
(2,687 Views)