I am using Measurement Studio .NET 7.0
I have the following code:
private void PlotData(System.Byte[] oDataArray)
{
double nNumberOfPoints = 65536.0;
double nSampleRate = 1000000.0;
// Convert and Normalize the Data Byte[] to a Double[]
double[] oYData = new double[nNumberOfPoints];
for(Int32 nIndex = 0; nIndex < nNumberOfPoints; nIndex++)
{
oYData[nIndex] = System.Convert.ToDouble(oDataArray[nIndex]) / System.Convert.ToDouble(System.Byte.MaxValue);
}
// Set the X Delta to milliseconds
double nDeltaX = (1.0 / nSampleRate) * 1000.0;
// Plot the Data Double[]
this._oGraph.PlotY(oYData, 0.0, nDeltaX);
// Change the X-Axis range of the Time Domain
this._oXAxis.Range = new NationalInstruments.UI.Range(0.0, (nDeltaX * nNumberOfPoints)); // 0.0 to 65.536 milliseconds
// Change the Y-Axis range of the Time Domain
this._oYAxis.Range = new NationalInstruments.UI.Range(0.0, 1.0); // Always Normalized
// Set an initial zoom for the user, he needs to be able to zoom out from this point if he wants to.
// ZoomX into the first 10 milliseconds of data.
this._oGraph.ZoomXY(this._oTimeDomainPlot, 0.0, 0.0, 10.0, 1.0); // <--*** This never works ***
}