03-25-2015 12:17 PM
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
Solved! Go to Solution.
03-25-2015 03:41 PM
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
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-27-2015 04:44 PM
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
04-10-2015 04:05 AM
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!!
04-10-2015 07:24 AM
Just add another Write TDMS outside of the loop, before the close.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-15-2015 03:13 AM
Thanks!! It worked!