11-20-2009 01:32 PM
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)
11-23-2009 11:23 AM
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.
11-23-2009 11:53 AM
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?
11-24-2009 11:00 AM
This shouldn't be a problem.