LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1xn array of clusters of 3 elements to array of 3xn elements

I'm new to using a NI-Scope, and quite new to Labview in general.

I'm trying to read a waveform from an NI-5133, and I'd like to write it to a spreadsheet file. I don't know how to go about this, though, as the write-to-spreadsheet sink is for a 2-D array of doubles and the data coming out of the NI-Scope Multi-read cluster is a 1D-array of 3-element clusters.

Basically I need to break the clusters up so that instead of a 1-d array of n clusters, it becomes a 2-d array of n rows of 3 elements.

How can I do this?

I'm using Labview 2011 and Scope 3.9.4

 

Thanks!
Wolley

0 Kudos
Message 1 of 3
(2,616 Views)

The data type returned is an array of waveforms. A waveform is a specific type of cluster with 4 elements (the attributes element is hidden).

 

So the elements in the waveform cluster are:

t0 = timestamp

dt = delta time (time between samples)

Y = array of data points

attributes = variant data type to contain all sorts of information such as NI_ChannelName

 

From what you have described you want to extract the Y values.

If you run the array of waveforms through a for loop and using the "Get Waveform Components" primative you can extract the values.

WaveformComponents.png

 

Having said that, it may not be the best way to store your data. This method does not store any timing information and all the values are stored as ascii which can result in a very large file with reduced accuracy due to the conversion to text.

You may wish to look into storing your data in a TDMS file. Programming > File I/O > TDMS Streaming.

Have a look at some of the built in examples for how to use it.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 2 of 3
(2,582 Views)
The Export Waveforms to Spreadsheet could also be used. This writes the timing information to a text file.
0 Kudos
Message 3 of 3
(2,573 Views)