Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Componentworks DSP Function ?

I am using Visual Basic 6 in a simple application with Measurement Studio 1.0.1 (ie:Componentworks v3 full edition).

We have a water tank that is hanging on a load cell. We fill the tank with water and measure the weight over a fairly long (30+seconds) period of time to determine a flow rate. What I am trying to do is sample the weight of the tank every second or so and calculate a instantaneous flow rate. The time interval I currently use is short enough and the flow rate low enough that the result is a noisy erratic reading. However, plotting the signal in excel shows a steady positive slope to the weight of the tank (ie: constant flow). It is the slope of that line that I want to calculate since it represents my flow rate. I ha
ve made my own home-made sliding window averaging functions to try to remove the noise but they leave a lot to be desired.

Looking at the Componentworks full edition help file I see a whole bunch of DSP functions that may help me but I have never used them. In particular, the CWDSP time domain processing has a function Differentiate. Sounds too good to be true that I could pass it an array and it would differentiate it and give me the slope of the dataset.

Has anyone used the CWDSP functions ? Will they work for my application ? Is there a better function I should be using? Any other advice you have would be appreciated.

Thank You
0 Kudos
Message 1 of 2
(5,854 Views)
Hi,

It looks like you can definatelly use some of the DSP or statistics functions from Measurement Studio. Here are a couple of pinters:


  1. Take multiple samples and perform averaging. Instead of recording a single point every second I would recoment acquires 100 samples @ 1000 Samples/Sec; get the average of those samples and send that to the graph and to the moving average. This will clean up a lot each data point (specially when working with load cells in something that is changing mass).
  2. Take a look at the functions in CWStat; there is a linear fit function that you could use to extrat the slope information without the need for averaging, It uses the least squares method; so the result should be accurate.
  3. If the data has lots of noise yo
    u can perform some filtering; probably a Butterworth low-pass filter (found in CWDSP) could help reduce the high frequency variations on your data and give you better results.


There are some good example that ship with MStudio that can help you get started with the DSA and Stat function. Also the MStudio reference help contains some valuable information and small pieces of code.


I hope this helps.

Regards,
Juan Carlos.
N.I.
0 Kudos
Message 2 of 2
(5,854 Views)