Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

WaveformGraph.PlotWaveformsMultiple

I can plot a single waveform using WaveformGraph.PlotWaveform, but I'm having difficulty formatting my parameters for WaveformGraph.PlotWaveformsMultiple.

I tried using the following code to accomplish this but I get a conversion error. 

    AnalogWaveform<double>[] waveforms = new AnalogWaveform<double>[2];

    for (int m = 0; m <2; m++)

    {

          double[] dblresult = (double[])waveformArrayList[m];     //waveformArrayList contains two 1D arrays

         AnalogWaveform<double> waveformCurrents = AnalogWaveform<double>.FromArray1D(dblResult);

         waveforms[m] = waveformCurrents;

    }

   myWaveformGraph.PlotWaveformsMultiple(waveforms, plotOptions);

On my call to PlotWaveformsMultiple I get the error "Error 3 Argument '1': cannot convert from 'NationalInstruments.AnalogWaveform<double>[]' to 'NationalInstruments.AnalogWaveform[*,*]'.

I would appreciate help in getting my variable declaration syntax corrected (or whatever I need to do) to fix this.  I'm not familiar with the syntax [*,*] in a parameter of a method.  What does that mean?

Thanks

0 Kudos
Message 1 of 3
(3,615 Views)
Hi SubseaFish,
 
The PlotWaveformsMultiple method accepts a 2D array of AnalogWaveform<TData> data and you are just passing in a 1D array of AnalogWaveform.  Since your are just wanting plot a 1D array of AnalogWaveform<double>, you can just ue the PlotWaveforms method.  That method accepts a 1D array of AnalogWaveform.
 
I posted a similar example to yours here where the only difference was I was using the FromArray2D method. Maybe that will help.
 
Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 2 of 3
(3,597 Views)
Thanks SO much.  I was so focused on the word "multiple" in the method name, I incorrectly assumed PlotWaveformsMultiple was needed in order to plot multiple waveforms. 
0 Kudos
Message 3 of 3
(3,573 Views)