LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write power spectrum + other arrays to TDMS

Solved!
Go to solution

Hi everyone!

 

I am trying to build an DAQ project, using compactDAQ to measure and save some data from one accelerometer.

 

The main goal is to save data from acceleration, speed, displacement and frequency spectrum in a TDMS but I am having some problems doing that.

 

As you can see in the file attached I had conveted the data from the Express assistant into a waveform using Unbundle + Build waveform, after that I wired this waveform to a Build an array together with acc, speed and displacement data.

 

The problem arise reading the data with the TDMS viewer because the plot of the frequency spectrum doesn't have the X axis with the good values, instead of showing frequency data it shows date and time that doesn't match with the one from PC but the fact is that I need the frequency values.

 

Is there any way to do that change and introduce the correct values in the TMDS file??

 

Thanks in advanced,

Omar

 

 

0 Kudos
Message 1 of 6
(3,427 Views)
Solution
Accepted by topic author osuarez

The TDMS viewer included with LabVIEW is not going to meet the needs of everyone.  And this is one case where it falls short.  Your data is stored properly (at least the picture looks right.  By the way next time post code not pictures.  Attach a VI or a code snippet.

 

When you read your TDMS data back out using a TDMS Read you tell it the data type to expect, and there you can provide a analog waveform.  Then when you read it back you'll have the same dT and T0 that it was written with.  The problem with the viewer is it is it likely doesn't know it is a waveform and is just reading the amplitude data and then getting confused about the X axis.

 

You can write your own code to read the file, make a copy of the existing viewer and modify it. Or my favorite is try Scout by Signal.X.  They took the standard TDMS viewer and gave it an overhaul.  You might get lucky and have the data open normally there.

 

http://sine.ni.com/nips/cds/view/p/lang/en/nid/211879

Message 2 of 6
(3,409 Views)

Thanks for the reply!

 

I have downloaded the Scout viewer and is far better than the one provided by Labview!

And the X axis of the frequency spectrum is now correct.

 

Thanks a lot,

Omar

0 Kudos
Message 3 of 6
(3,376 Views)

Hi everyone!!

 

I am having troubles with this stuff again.

 

This is what I am trying to get now:

 

the TDMS fills during the loop iterations and save the data when finish but I would like to add the Power Spectrum that is ploted and calculated out of the loop.

 

You can see the idea in the attached file.

I need to calculate the PS outside the loop because I want to calculate it using all the samples in the acquisition.

 

How should I add the power spectrum inside the TDMS with this configuration?

 

Any help with this??

 

Thanks in advanced!!

0 Kudos
Message 4 of 6
(3,294 Views)

Just add another Write TDMS outside of the loop, before the close.

Message 5 of 6
(3,280 Views)

Thanks!! It worked!

 

 

0 Kudos
Message 6 of 6
(3,231 Views)