From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best approach to using Componentworks Data ANalysys tools on continuous acquired data?



Specifically, using refft on multi-channel data acquisition? Currently the method i know to use is:
a) Acquire multiple channels of data
b) process the data into 1d arrays, one for each channel
c) process the data with refft

The issue lies in the processing of data.. after processing the data into 1d arrays, while passing to refft, refft doesn't always process the array of data. It may process a few returned arrays but quickly returns a type mismatch.

To get around this, i set up a single channel acquisition and passed the scaleddata array (power of 2) to refft, and yes it works, but that's only for one channel.

I created more CWAI's and c
ascaded acquisition, processing, stop acquisition, move to next CWAI but it's way too slow for my needs. But it's the only way i could get multichannel data aquisition and processing with refft 😃

Anyway, thanks in advance.
0 Kudos
Message 1 of 3
(3,256 Views)
shost:

I've been able to successfully call ReFTT on multichannel acquisition. The difficulty with this sort of application is usually properly splitting the channels from the matrix returned by the ComponentWorks AI control. The easiest way to do this is to use the ComponentWorks Array control. For example, the following code splits the ScaledData matrix into two arrays and plots each on a different graph.

Private Sub CWAI1_AcquiredData(ScaledData As Variant, BinaryCodes As Variant)
CWGraph1.PlotY CWArray1.IndexArray(ScaledData, Array(0, Null))
CWGraph2.PlotY CWArray1.IndexArray(ScaledData, Array(1, Null))
End Sub

I hope this helps.

Good Luck,

Chris Wood
Applications Engineer
National Instruments
Message 2 of 3
(3,256 Views)
That's exactly what i ended up doing. So any of you farting with the same issue, you now have your answer 😃
0 Kudos
Message 3 of 3
(3,256 Views)