04-20-2021 02:18 PM
I just realized the waveform chart i.e. parameters Xo, deltaX and 1D/2D Array is not an accepted parameter in the TDMS Write VI. I want to store the waveform chart information so that freq (X-axis) and amplitude (Y-axis) is plotted in the viewer.
I not sure if this is possible from some post I've come across.
04-20-2021 02:26 PM - edited 04-20-2021 02:26 PM
Hi richjoh,
@richjoh wrote:
I just realized the waveform chart i.e. parameters Xo, deltaX and 1D/2D Array is not an accepted parameter in the TDMS Write VI. I want to store the waveform chart information so that freq (X-axis) and amplitude (Y-axis) is plotted in the viewer.
You don't store "charts" inside TDMS file, but the "data" you show in your charts. Quite a difference…
Which kind of data (aka datatype) do you want to store in TDMS files? AFAIK they accept waveforms!
(Maybe you should attach an example VI to explain which kind of data you want to save.)
04-20-2021 05:40 PM - edited 04-20-2021 05:42 PM
frequency vs amplitude chart. As you know bundle the Xo, deltaX, 1D/2DArray you can plot using a Chart. I simply want to save the frequency/amplitude data using TDMS. When I go back to view the TDMS file it should show me frequency vs amplitude (instead of separate plot of the axis).
In other words, TDMS should show me x-axis (frequency) and y-axis (amplitude).
04-20-2021 09:44 PM
Sound and Vibration Toolkit has TDMS VIs to Write and Read frequency spectra with correct units saved as channel and group properties. You can download the eval and see how those VIs manage the spectrum data.
From the help:
The complementary Read function will pull the spectrum data out of the file in the expected format ready to be graphed. You will still have to overwrite the x- and y-axis labels.
04-22-2021 05:48 PM - edited 04-22-2021 05:51 PM
OK, I downloaded and looked at the Sound&Vib toolkit LabVIEW 2016.
So if I have a Waveform Graph, i.e. Xo, deltaX, 2DArray, they basically cast it to a Variant to store into a TDMS file. And now that I see the Labview, I wouldn't want to use the toolkit. Just to put the Graph into a TDMS file it's alot of bloat. I may convert the Waveform Graph to Variant on my own to get it into TDMS file.
I appreciate your help on issue.
04-23-2021 12:35 AM
Hi richjoh,
@richjoh wrote:
So if I have a Waveform Graph, i.e. Xo, deltaX, 2DArray, they basically cast it to a Variant to store into a TDMS file. … Just to put the Graph into a TDMS file it's alot of bloat.
As said before: you don't put "a graph" into a TDMS file, you write data to your TDMS file!
You are responsile of providing the data in a way which the TDMS functions can handle!
I would not convert to variant, I would save the 2D array, with X0/dX added as properties…
04-23-2021 08:14 AM - edited 04-23-2021 08:22 AM
The spectrum data is not cast to a variant. The array data is written directly to TDMS, and the spectrum attributes (x0, dx, all elements of spectrum info, and additional attributes) are written as TDMS group and channel properties.
1 and N Ch VIs attached (for LV 2020). If you don't want to write spectrum info, make a copy of the VI and rip that part of the code out.
I agree with Gerd, don't convert the spectrum to a variant.
04-26-2021 10:52 AM
I looked at something in the SV toolkit, I think I saw the WF attributes being written with Variants which led me to the data being written as a variant. Thanks guys for clearing that up.
Ultimately, the TDMS properties are written using Variants. It looks like I pass parameters for the WF (x, dx, Array) and Spectrum Info parameters and it should do it. My WFs are Single precision (not a big deal to cast to double).
I didn't see a setting for Multi-plot WF Graph, plotting 1.Amplitude, 2.Lowlimit, 3.HiLimit vs Freq. This is a 2D array where each row is a plot. I did find Multi WF where it is Arrays of WF, i.e. [WF1], [WF2]...[WFX]. Not a show stopper but would be nice to have Multi-plot WF .
04-26-2021 01:19 PM
Hi richjoh,
@richjoh wrote:
Not a show stopper but would be nice to have Multi-plot WF .
No showstopper at all: a "multi-plot waveform" is an array of waveforms!
04-27-2021 09:33 AM
Ultimately, the TDMS properties are written using Variants. It looks like I pass parameters for the WF (x, dx, Array) and Spectrum Info parameters and it should do it. My WFs are Single precision (not a big deal to cast to double).
You can convert to DBL or you can create your own instance of a TDMS Write to save SGL data.
I didn't see a setting for Multi-plot WF Graph, plotting 1.Amplitude, 2.Lowlimit, 3.HiLimit vs Freq. This is a 2D array where each row is a plot. I did find Multi WF where it is Arrays of WF, i.e. [WF1], [WF2]...[WFX]. Not a show stopper but would be nice to have Multi-plot WF .
As long as you are comfortable converting between them, the data types are interchangeable to the graph. There are a number of measurement-analysis APIs that operate on waveforms and array of waveforms, so that may be something to consider if you are saving data for some later post processing. Specifically, the SV Toolkit reflects group preference for operating on 1D array of waveform rather than 2D array of data - we prefer for code to be very clear whether it is indexing through channels versus indexing through time/samples.