Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

how to build an array for opened TDMS file

Solved!
Go to solution

Hello

 

From the NI examples TDMS - Express write data (time domain).vi, I can build a TDMS file with 2 channels(sine and square waveforms) of data, which is stored as test.tdms.

 

By using Express read data (time domain).vi, the 2 channels of waveform data is read out. How to build an array afterwards? How to split the 2 channels of data into 2 1-D arrays and manipulate the data using array functions?

For example,

I want to take 100 sample starting from index100 from channel 0 and average them. I want to take 50 samples starting from index 50 from channel 1 and double each element.

 

Thank you for your help. 

 

Bing@NCL

0 Kudos
Message 1 of 4
(3,398 Views)

It looks like the entire file is being read. You can use the convert from dynamic data to get a 1D waveform, 2D DBL, etc. The split signal function can be used on the dynamic data but if you are going to convert to some sort of array, just use the index array function.

 

Your questions are pretty basic. Have you taken the LabVIEW tutorial?

0 Kudos
Message 2 of 4
(3,396 Views)
Solution
Accepted by topic author NCLbingji

Hey Bing,

 

You can perform operations on different channels in the 2D array using the index array function. This will allow you to choose the channel to operate on then you can perform the operation inside a loop to act on each element. In the snippet included I have used a shift register to find the cumulative total of the values in channel 0 then divided by the number of samples checked.

 

I would recommend reading some LabVIEW tutorials and KnowledgeBases on topics that are relative to yours. These might help alot.

 

Hope my suggestions help,

 

Chris

National Instruments - Tech Support
0 Kudos
Message 3 of 4
(3,377 Views)

Thank you. I will go through the tutorials

0 Kudos
Message 4 of 4
(3,339 Views)