09-27-2020 04:12 PM - edited 09-27-2020 04:25 PM
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
Here is the data format
Here is the broken wire when trying to wire to TDMS
Thank you for your help!
09-27-2020 04:32 PM
I was able to log this data into TDMS by indexing that data wire like this
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
09-28-2020 02:49 AM
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...
09-28-2020 02:50 AM
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.
09-28-2020 08:38 AM
Thank you for your reply! Can you elaborate a little more on what that may look like? Or is there an example of that?
09-28-2020 08:54 AM
@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:
09-28-2020 08:57 AM
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?
09-28-2020 09:06 AM
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?
09-28-2020 09:25 AM
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.
09-28-2020 09:32 AM
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.
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.
Thank you!