public void StartSweep() { try { SetSweepMode(EnumSweepMode.SINGle);//设置扫描模式为single gb.GPIBwr("* CLS"); gb.GPIBwr(":INITIATE"); //get sweep status, the last bit of status is 1 when a sweep ends gb.GPIBwr(":stat:oper:even?"); byte status = Convert.ToByte(gb.GPIBrd(100)); while ((status & 1) != 1) { } ExcuteAnalysis(); ReadAnalysisData(); } catch (Exception ex) { throw new Exception($"AQ6370D执行扫描出错{ex.Message}"); } }
public object Query(string objCmd) { try { GPIBDevice.GPIBwr(objCmd); string res = GPIBDevice.GPIBrd(200); return(res);; } catch (Exception ex) { throw ex; } }
/// <summary> /// /// </summary> /// <param name="o"></param> /// <returns>单位是nA</returns> public double Fetch(object o = null) { SetContinuous(false); Thread.Sleep(50); K2000.GPIBwr(":READ?"); string str = K2000.GPIBrd(200); string[] meas_ret = str.Split(','); if (meas_ret.Length == 1) { Double.TryParse(meas_ret[0], out MeasureValue[0]); //读出来的电流是nA } // MeasureValue[0] = MeasureValue[0] * 1000; return(MeasureValue[0]); }
/// <summary> /// 获取设备描述 /// </summary> /// <returns></returns> public string Description() { GPIBDevice.GPIBwr("*IDN?"); return(GPIBDevice.GPIBrd(100)); }