//public override string WaveformSource //{ // get // { // return base.Query(":WAVeform:SOURce?"); // } // set // { // base.Send(":WAVeform:SOURce"+ value); // base.WaitOpc(); // } //} /// <summary> /// /// </summary> /// <param name="tracename"></param> /// <returns></returns> //public override double[] GetTraceData(SourceForMeas tracename) //{ // base.Send(string.Format(":WAVeform:SOURce"+ tracename)); // string m_results = base.Query(":WAVeform:DATA?"); // string[] Getdatalis = m_results.Split(','); // double[] getdata = new double[Getdatalis.Length - 1]; // for (int i = 0; i < Getdatalis.Length - 1; i++) // { // getdata[i] = double.Parse(Getdatalis[i].Trim()); // } // return getdata; //} /// <summary> /// 获取轴测试数据 /// </summary> /// <param name="ChanNumber"></param> /// <returns></returns> public override double[] GetTraceData(SourceForMeas tracename) { this.Send(string.Format(":WAVeform:SOURce " + tracename)); WaitOpc(); this.Send(":WAVeform:FORMat WORD"); WaitOpc(); this.Send(":WAVeform:BYTeorder LSBFirst"); WaitOpc(); this.Send(":WAVeform:STReaming 0"); WaitOpc(); double yInc = this.QueryNumber(":WAVeform:YINCrement?"); double yOrg = this.QueryNumber(":WAVeform:YORigin?"); //tmpRawData:第一个字节是#,第二个字符为0,其余为波形数据 //:WAVeform:VIEW 选取类型 this.Send(":WAVeform:VIEW ALL"); WaitOpc(); byte[] tmpRawData = this.ReadBlock(":WAVeform:DATA?"); //第一个点? int tmpTraceDataLen = (tmpRawData.Length) / 2; double[] getdata = new double[tmpTraceDataLen]; //double pointData; for (int i = 0; i < getdata.Length; i++) { getdata[i] = (Int16)((UInt16)tmpRawData[2 * i] + (((UInt16)tmpRawData[2 * i + 1]) << 8)); getdata[i] = getdata[i] * yInc + yOrg; } return(getdata); }
/// <summary> /// 获取去时间间隔 /// </summary> /// <param name="ref_1">参考迹线</param> /// <param name="meas_1">测试迹线</param> /// <returns></returns> public override double GetDeltaTime(SourceForMeas ref_1, SourceForMeas meas_1) { //this.Single(); //this.WaitOpc(); //System.Threading.Thread.Sleep(10000); double DeltaTime = base.QueryNumber(string.Format(":MEASure:DELTatime? {0},{1}", ref_1, meas_1)); return(DeltaTime); }
/// <summary> /// 测量时延差 /// </summary> /// <param name="ref_1">参考</param> /// <param name="meas_1">测试</param> /// <returns></returns> public override void MeasureDeltaTime(SourceForMeas ref_1, SourceForMeas meas_1) { string reference = SourceForMeasSwitchToStr(ref_1); string measurement = SourceForMeasSwitchToStr(meas_1); this.Send(":MEASure:DELTatime:DEFine RISing,1,MIDDle,RISing,1,MIDDle"); this.WaitOpc(); this.Send(string.Format(":MEASure:DELTatime {0},{1}", reference, measurement)); this.WaitOpc(); }
/// <summary> /// 测试指定迹线的时延差 /// </summary> /// <param name="ref_1">参考迹线</param> /// <param name="startEdgeType">参考迹线沿类型</param> /// <param name="statEdegePosition">参考位置</param> /// <param name="statPulseNumber">参考脉冲数</param> /// <param name="meas_1">测试迹线</param> /// <param name="stopEdgeType">测试边沿类型</param> /// <param name="stopEdegePosition">测试迹线测试位置</param> /// <param name="stopPulseNumber">测试脉冲边缘数</param> public override void SetMeasureDeltaTime(SourceForMeas ref_1, TestEdgeType startEdgeType, TestEdgePosition statEdegePosition, int statPulseNumber, SourceForMeas meas_1, TestEdgeType stopEdgeType, TestEdgePosition stopEdegePosition, int stopPulseNumber) { string reference = SourceForMeasSwitchToStr(ref_1); string measurement = SourceForMeasSwitchToStr(meas_1); this.Send(string.Format(":MEASure:DELTatime:DEFine {0},{1},{2},{3},{4},{5}", startEdgeType, statPulseNumber, statEdegePosition, stopEdgeType, stopPulseNumber, stopEdegePosition)); this.WaitOpc(); this.Send(string.Format(":MEASure:DELTatime {0},{1}", reference, measurement)); this.WaitOpc(); }
/// <summary> /// 获取X轴时间数据 /// </summary> /// <param name="tracename"></param> /// <returns></returns> public override double[] GetTimePosition(SourceForMeas tracename) { this.Send(string.Format(":WAVeform:SOURce " + tracename)); WaitOpc(); double XRange = this.QueryNumber(":WAVeform:XRANge?"); double XStart = this.QueryNumber(":WAVeform:XDISplay?"); double[] YData = this.GetTraceData(tracename); int number = YData.Length; double step = XRange / (number - 1); double[] XData = new double[number]; for (int xi = 0; xi < number; xi++) { XData[xi] = XStart + step * xi; } return(XData); }
/// <summary> /// 将通道变成string名称 /// </summary> /// <param name="source_1">测试通道名称</param> /// <returns></returns> private string SourceForMeasSwitchToStr(SourceForMeas source_1) { string str = "Channel1"; //str = source_1.ToString(); switch (source_1) { case SourceForMeas.Channel1: str = "CHANnel1"; break; case SourceForMeas.Channel2: str = "CHANnel2"; break; case SourceForMeas.Channel3: str = "CHANnel3"; break; case SourceForMeas.Channel4: str = "CHANnel4"; break; case SourceForMeas.Function1: str = "FUNCtion1"; break; case SourceForMeas.Function2: str = "FUNCtion2"; break; case SourceForMeas.Function3: str = "FUNCtion3"; break; default: str = "FUNCtion4"; break; } return(str); }
/// <summary> /// 测试指定迹线的时延差 /// </summary> /// <param name="ref_1">参考迹线</param> /// <param name="startEdgeType">参考迹线沿类型</param> /// <param name="statEdegePosition">参考位置</param> /// <param name="statPulseNumber">参考脉冲数</param> /// <param name="meas_1">测试迹线</param> /// <param name="stopEdgeType">测试边沿类型</param> /// <param name="stopEdegePosition">测试迹线测试位置</param> /// <param name="stopPulseNumber">测试脉冲边缘数</param> public override void SetMeasureDeltaTime(SourceForMeas ref_1, TestEdgeType startEdgeType, TestEdgePosition statEdegePosition, int statPulseNumber, SourceForMeas meas_1, TestEdgeType stopEdgeType, TestEdgePosition stopEdegePosition, int stopPulseNumber) { string reference = SourceForMeasSwitchToStr(ref_1); string measurement = SourceForMeasSwitchToStr(meas_1); string refname = ""; string measname = ""; if (startEdgeType == TestEdgeType.FALLing) { refname = "-" + statPulseNumber; statEdegePosition = TestEdgePosition.LOWer; } else { refname = "+" + statPulseNumber; statEdegePosition = TestEdgePosition.UPPer; } if (stopEdgeType == TestEdgeType.FALLing) { measname = "-" + stopPulseNumber; stopEdegePosition = TestEdgePosition.LOWer; } else { measname = "+" + stopPulseNumber; stopEdegePosition = TestEdgePosition.UPPer; } this.Send(string.Format(":MEASure:DEFine DELay,{0},{1}", refname, measname)); this.WaitOpc(); this.Send(string.Format(":MEASure:DEFine THResholds,{0},{1}", statEdegePosition, stopEdegePosition)); this.WaitOpc(); this.Send(string.Format(":MEASure:DELTatime {0},{1}", reference, measurement)); this.WaitOpc(); }
/// <summary> /// 脉冲带内最大有效值 /// </summary> /// <param name="meas_1"></param> abstract public void MeasureVTop(SourceForMeas meas_1);
/// <summary> /// 下降沿测试 /// </summary> /// <param name="meas_1"></param> abstract public void MeasureRiseTime(SourceForMeas meas_1);
/// <summary> /// 上升沿测试 /// </summary> /// <param name="meas_1"></param> abstract public void MeasureFallTime(SourceForMeas meas_1);
/// <summary> /// 过冲测试 /// </summary> /// <param name="meas_1"></param> abstract public void MeasureOverShoot(SourceForMeas meas_1);
abstract public void MeasureDeltaTime(SourceForMeas ref_1, SourceForMeas meas_1);
/// <summary> /// 获取时间迹线 /// </summary> /// <param name="tracename"></param> /// <returns></returns> abstract public double[] GetTimePosition(SourceForMeas tracename);
public override void MeasureFallTime(SourceForMeas meas_1) { this.Send(":MEASure:FALLTIME " + meas_1.ToString()); this.WaitOpc(); }
public override double GetVTopData(SourceForMeas meas_1) { double vtop = this.QueryNumber(":MEASURE:VTOP? " + meas_1.ToString()); return(vtop); }
/// <summary> /// 读取峰峰值 /// </summary> /// <param name="ChannelNumber">选取测试通道</param> /// <returns>返回通道峰峰值</returns> ///abstract public double ReadPeakToPeak(string ChannelNumber); /// <summary> /// 读取通道间相位值 /// </summary> /// <param name="referenceChannel">参考通道</param> /// <param name="measurementChannel">测试通道</param> /// <returns></returns> abstract public double GetDeltaTime(SourceForMeas ref_1, SourceForMeas meas_1);
public override double GetFallTme(SourceForMeas meas_1) { double fall = this.QueryNumber(":MEASURE:FALLTIME? " + meas_1.ToString()); return(fall); }
/// <summary> /// 读取全部测试数据 /// </summary> /// <returns></returns> ///abstract public List<OSCResult> ReadResult(); /// <summary> /// 读取全部原始测试数据 /// </summary> /// <returns></returns> abstract public double[] GetTraceData(SourceForMeas tracename);
public override void MeasureOverShoot(SourceForMeas meas_1) { this.Send(":MEASure:VOVershoot " + meas_1.ToString()); this.WaitOpc(); }
/// <summary> /// 测试指定迹线的时延差 /// </summary> /// <param name="ref_1">参考迹线</param> /// <param name="startEdgeType">参考迹线沿类型</param> /// <param name="statEdegePosition">参考位置</param> /// <param name="statPulseNumber">参考脉冲数</param> /// <param name="meas_1">测试迹线</param> /// <param name="stopEdgeType">测试边沿类型</param> /// <param name="stopEdegePosition">测试迹线测试位置</param> /// <param name="stopPulseNumber">测试脉冲边缘数</param> abstract public void SetMeasureDeltaTime(SourceForMeas ref_1, TestEdgeType startEdgeType, TestEdgePosition statEdegePosition, int statPulseNumber, SourceForMeas meas_1, TestEdgeType stopEdgeType, TestEdgePosition stopEdegePosition, int stopPulseNumber);
public override double GetOverShotData(SourceForMeas meas_1) { double VOVershoot = this.QueryNumber(":MEASURE:VOVershoot? " + meas_1.ToString()); return(VOVershoot); }
/// <summary> /// 获取过冲测试结果 /// </summary> /// <param name="meas_1"></param> /// <returns></returns> abstract public double GetOverShotData(SourceForMeas meas_1);
public override double GetRiseTimeData(SourceForMeas meas_1) { double shot = this.QueryNumber(":MEASURE:RiseTimeData? " + meas_1.ToString()); return(shot); }
/// <summary> /// 获取上升沿时间 /// </summary> /// <param name="meas_1"></param> /// <returns></returns> abstract public double GetFallTme(SourceForMeas meas_1);
public override void MeasureRiseTime(SourceForMeas meas_1) { this.Send(":MEASure:RISetime " + meas_1.ToString()); this.WaitOpc(); }
/// <summary> /// 获取下降沿时间 /// </summary> /// <param name="meas_1"></param> /// <returns></returns> abstract public double GetRiseTimeData(SourceForMeas meas_1);
public override void MeasureVTop(SourceForMeas meas_1) { this.Send(":MEASure:VTOP " + meas_1.ToString()); this.WaitOpc(); }
/// <summary> /// 获取脉冲最大有效值 /// </summary> /// <param name="meas_1"></param> /// <returns></returns> abstract public double GetVTopData(SourceForMeas meas_1);
public override double GetVMaxData(SourceForMeas meas_1) { double max = this.QueryNumber(":MEASURE:VMAX? " + meas_1.ToString()); return(max); }