Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

AnalogWaveform creation error

Hi,

 

I want to create a waveformgraph and i use the part of the code below:

 

private AnalogWaveform<double> CreateWaveformFromData(DateTime[] timeStamps, double[] data)
{
   try
   {
      AnalogWaveform<double> wave;
      wave = AnalogWaveform<double>.FromArray1D(data);
      wave.Timing = WaveformTiming.CreateWithIrregularInterval(timeStamps);
      return wave;
   }
   catch (Exception ex)
   { ex = ex; return null; }
}

The compilation passed, but when i run the code to "wave = AnalogWaveform<double>.FromArray1D(data);"

 

I got a exception: [System.TypeInitializationException] = {"The type initializer for 'NationalInstruments.PrecisionWaveformTiming' threw an exception."}

 

Here, i don't think i define the waveform timing here, why do i receive this type initialization error?

 

Thanks a lot!

 

Kevin

0 Kudos
Message 1 of 5
(4,019 Views)

Kevin,

 

Is this error occurring on the development computer or the deployment machine? Which version(s) of MS and VS are you using, and on which OS? 

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 5
(4,004 Views)

It's in development computer. WinOS: Win7, MS: visual studio 2010, VS: visual studio 8.0.1

 

Thanks!

 

Kevin

0 Kudos
Message 3 of 5
(3,991 Views)

Kevin,

 

Is this happening every time you try to create a waveform or only when in a specific program? 

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments

0 Kudos
Message 4 of 5
(3,984 Views)

Yes, it happen every time.

 

Actually we don't need make things complicated. I just want to draw a simple graph by x array and y array. The x values should be DateTime values.

 

I use this kind of control long time ago. we use ActiveX control that time. I remember the method something like plotXY(x array, y array) is ok. But the rule looks like changed for the new version MeasurementStudio. If you have similiar example code i can borrow, that will be good. 🙂

 

Thanks!

 

Kevin

0 Kudos
Message 5 of 5
(3,982 Views)