11-25-2014 05:33 AM
Hello,
I am reading some bluetooth data from a LabVIEW VST instrument. X is Freq and Y is Amplitude. The data appears to me a a cluster containing "x0", "dx" and an array of "y". I would like to place this data into a TDMS file. How would I go about this.
Many thanks, Alec
11-25-2014 06:48 AM
build waveform from that cluster and write it to tdms?
11-25-2014 07:38 AM
If you write a waveform data type to a TDMS file, the Y values will be written as samples to a channel. The d0 and dt will be written as properties of that channel. This is an efficient way of recording the data, but some times you might want it to be presented as XY data, where you have a time value for each Y value. For this you need to generate the two 1D arrays, one for time, one for the Y values. This is less efficient because you are writing two data points for each sample, instead of just one with some meta data.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-25-2014 08:28 AM
@pawhan11 wrote:
build waveform from that cluster and write it to tdms?
I just knew somone would suggest that
That "Clustery looking thing" the OP is seeing is a waveform indicator.
Hooovahh is absolutly correct just wire it to a channel and write to TDMS handles it fine. If you do need to record each time point as well use "Get Waveform Time Array.vi" On the waveform pallete. (Hard to find since the displayed name is odd)
it looks like this:
11-25-2014 11:06 AM - edited 11-25-2014 11:28 AM
I don't understand. When I wire it directly I get an error.
11-25-2014 12:06 PM
Ah, I missed that its in the freq domain!
I would use something like this
11-25-2014 12:26 PM
I kudo'd you because I never knew that function existed, but am curious why the always copy is needed. Also is a sub VI really needed for finding the size of the waveform?
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-25-2014 12:32 PM - edited 11-25-2014 12:38 PM
@Hooovahh wrote:
I kudo'd you because I never knew that function existed, but am curious why the always copy is needed. Also is a sub VI really needed for finding the size of the waveform?
(Speaking of the AC inside get waveform time array)
Probably because some improper buffer sharing bug used to exist and the subvi is likely used all over that library "Code it ONCE!"
The darn thing is hard to find on the palette with the screwy display name in the *mnu. The palatte commitee overlooked that problem or had to compromize for some other localization.
11-26-2014 03:43 AM
Thank you! Just out of interest, how did you take that 'snippet' that I can drag onto a block diagram?
May thanks!
11-26-2014 07:17 AM - edited 11-26-2014 07:27 AM
Hmm, is that correct? All is seems to do is mangle my data.
An example of the created TDMS file can be found here
Root Name | Title | Author | Date/Time | Groups | Description | dx | x0 | |
26.11.2014-10.23.45 _ TP-TRM-CA-05-C- TX Output Spectrum - 20dB Bandwidth_Data | 1 | 10000 | 2478500000 | |||||
Group | Channels | Description | ||||||
Untitled | 456 | |||||||
Untitled | ||||||||
Channel | Datatype | Unit | Length | Minimum | Maximum | Description | NI_ArrayColumn | Start Index |
Channel 00 - Power (dBm) | DT_DOUBLE | 2 | 0 | |||||
Channel 00 - Frequency (Hz) | DT_DOUBLE | 2 | 1 | |||||
Untitled 2 | DT_DOUBLE | 158 | 2 | |||||
Untitled 3 | DT_DOUBLE | 158 | 3 | |||||
Untitled 4 | DT_DOUBLE | 158 | 4 |
Channel 01 - Power (dBm) | DT_DOUBLE | 2 | 0 |
Channel 01 - Frequency (Hz) | DT_DOUBLE | 2 | 1 |
Channel 02 - Power (dBm) | DT_DOUBLE | 2 | 0 |
Channel 02 - Frequency (Hz) | DT_DOUBLE | 2 | 1 |
Channel 03 - Power (dBm) | DT_DOUBLE | 2 | 0 |
Channel 03 - Frequency (Hz) | DT_DOUBLE | 2 | 1 |
Channel 04 - Power (dBm) | DT_DOUBLE | 2 | 0 |
Channel 04 - Frequency (Hz) | DT_DOUBLE | 2 | 1 |