Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

AutoScaleLoose exception

When displaying a WaveformGraph which has 1 Y-Axis with mode=AutoScaleLoose, I am running into the following exception.  Is this something I can correct?

 

************** Exception Text **************

System.ArgumentException: Specified minimum value is equal to the maximum value.

Parameter name: minimum

   at NationalInstruments.UI.Range..ctor(Double minimum, Double maximum)

   at NationalInstruments.UI.Internal.AxisScaler.AutoScaleLooseImpl.GetRange(Double[][] data, Int32[] dataLength, Double[] dataMinimum, Double[] dataMaximum, Range existingRange, ScaleType scaleType)

   at NationalInstruments.Restricted.XYGraphManager.ScaleAxis(AxisElement axis, Boolean disableRescaling)

   at NationalInstruments.Restricted.XYGraphManager.ScaleAxis(AxisElement axis)

   at NationalInstruments.Restricted.XYGraphManager.ScaleAxes(CartesianPlotElement sourcePlot)

   at NationalInstruments.Restricted.XYGraphManager.ScaleAxesOnPlotDataChanged(Object sender, ControlElementEventArgs e)

   at NationalInstruments.Restricted.ControlElementEventHandler.Invoke(Object sender, ControlElementEventArgs e)

   at NationalInstruments.UI.Internal.PlotElement.OnDataChanged(ControlElementEventArgs e)

   at NationalInstruments.UI.Internal.CartesianPlotElement.a(Object A_0, PlotDataChangedEventArgs A_1)

   at NationalInstruments.UI.Internal.PlotDataChangedEventHandler.Invoke(Object sender, PlotDataChangedEventArgs e)

   at NationalInstruments.UI.Internal.XYDataManager.a(PlotDataChangedEventArgs A_0)

   at NationalInstruments.UI.Internal.XYDataManager.CopyYData(Double[] yData, Int32 startIndex, Int32 length, Double start, Double increment, Boolean append)

   at NationalInstruments.UI.Internal.CartesianPlotElement.CopyYData(Double[] yData, Int32 startIndex, Int32 length, Double start, Double increment, Boolean append)

   at NationalInstruments.UI.Internal.WaveformPlotElement.PlotYAppend(Double[] yData, Int32 startIndex, Int32 length, Double increment)

   at NationalInstruments.UI.Internal.WaveformPlotElement.PlotYAppend(Double[] yData, Int32 startIndex, Int32 length, TimeSpan increment)

   at NationalInstruments.UI.Internal.WaveformPlotElement.PlotYAppend(Double[] yData, TimeSpan increment)

   at NationalInstruments.UI.WaveformPlot.PlotYAppend(Double[] yData, TimeSpan increment)

   at NationalInstruments.UI.WindowsForms.WaveformGraph.PlotYAppend(Double[] yData, TimeSpan increment)

 

0 Kudos
Message 1 of 4
(3,710 Views)

If you do not use AutiScaleLoose do you still get an exception? Also can you run any of the waveform examples such as this one?

 

C:\Documents and Settings\All Users\Documents\National Instruments\MStudioVS2008\DotNET\Examples\UI\WindowsForms\Graph\PlotWaveforms\cs

 

Based on the error below it looks like your minimum and maximum values have been set to equal one another, make sure this doesn't happen when you are graphing. 

Richard S -- National Instruments -- (former) Applications Engineer -- Data Acquisition with TestStand
0 Kudos
Message 2 of 4
(3,683 Views)

I have only seen the exception when using AutoScaleLoose.

 

It does appear that the min and max are being set to the same value, but those values are supposedly being set by the waveformgraph control itself, since the y-axis mode is set to AutoScaleLoose.  I'm not exactly sure what data was being plotted at the time this error occurred, but even if every point had the same y-value (a flatline graph) I would not expect the control to throw an exception.  Surely the waveformgraph control can handle a flat line signal?

0 Kudos
Message 3 of 4
(3,680 Views)

This shouldn't be a problem.

 

 

2009-11-24_105827.jpg

 

2009-11-24_105622.jpg

Richard S -- National Instruments -- (former) Applications Engineer -- Data Acquisition with TestStand
0 Kudos
Message 4 of 4
(3,665 Views)