Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

cwStat in a C# application

I'm trying to use the StdDev method of the cwstat ActiveX control in a c# program. The signature is:

StdDev(object x, ref object meanValue, ref object stdDev)

My call looks like:

cwStat.StdDev(data, ref mean, ref dev);

where data is a double[], and mean and dev are objects. I keep getting a type mismatch error. Does anyone know what I need to pass in?

Thank You,
Philip
0 Kudos
Message 1 of 3
(3,728 Views)

What are you initializing the mean and dev objects to? Try initializing them to null - if you initialize them to a double value, you will get a type mismatch error. If you are already initializing them to null, please post a code snippet that demonstrates how you are declaring, initializing, and passing the variables to the StdDev method.

Also, you may want to take a look at the recently released Measurement Studio 7.0. Measurement Studio 7.0 has a .NET analysis library that you'll find much easier to use in .NET development. In this case, the Measurement Studio .NET analysis library provides a Statistics class which has a StandardDeviation method and a Mean method. Both of these
methods take a double[] and return a double.

- Elton

0 Kudos
Message 2 of 3
(3,728 Views)
Thanks Elton....I was initializing them to a double value.

I'm upgrading my LabWindows/CVI Full Development Suite just so I get the new Measurement Studio with the .NET classes. It will be nice to have to trial and error my way through code trying to figure out the underlying data types 🙂

Philip
0 Kudos
Message 3 of 3
(3,728 Views)