public double GetLowFreq(string channel) { HandlerError.ClearErrors(); double measures = 0; try { //GPIBVisa.WriteCommand("SENS:DIG:DATA:BYTE? (@" + Channel + ")"); WriteCommand("CONF:FREQ (@" + channel + ")"); WriteCommand("SENS:FREQ:RANG:LOW 3, (@" + channel + ")"); WriteCommand("INIT"); WriteCommand("FETCh?"); //System.Threading.Thread.Sleep(2000); ReadCommand(out measures); //return measures; } catch (Exception e) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Data Adquisition Agilent 34970A. " + e.Message; throw new Exception(HandlerError.ErrorMsg); } return(measures); }
public virtual void Initialization() { HandlerError.ClearErrors(); try { //SeaMaxDeviceHandler = new SeaMAX(); } catch (Exception e) { throw new Exception("SEA LEVEL Error: " + e.Message); } }
public void Close() { HandlerError.ClearErrors(); try { _serialPort.Close(); } catch (Exception ex) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Closed port. " + ex.Message; throw new Exception(HandlerError.ErrorMsg); } }
public void Write(string message) { HandlerError.ClearErrors(); try { _serialPort.Write(message); } catch (Exception ex) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Write port. " + ex.Message; throw new Exception(HandlerError.ErrorMsg); } }
/// <summary> /// Reset Device /// </summary> public void Reset() { HandlerError.ClearErrors(); try { WriteCommand("*RST"); } catch (Exception ex) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Reset command VisaCom Method. " + ex.Message; throw new Exception(HandlerError.ErrorMsg); } }
/// <summary> /// Abort Device /// </summary> public void Abort() { HandlerError.ClearErrors(); try { ResourceIO.WriteString("ABOR", true); } catch (Exception ex) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Abort command VisaCom Method. " + ex.Message; throw new Exception(HandlerError.ErrorMsg); } }
/// <summary> /// Clear Device /// </summary> public void ClearDevice() { HandlerError.ClearErrors(); try { ResourceIO.IO.Clear(); } catch (Exception ex) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Clear Device command VisaCom Method. " + ex.Message; throw new Exception(HandlerError.ErrorMsg); } }
/// <summary> /// Poll /// </summary> public void Poll() { HandlerError.ClearErrors(); try { ResourceIO.WriteString("*STB?", true); } catch (Exception ex) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Find Device command VisaCom Method. " + ex.Message; throw new Exception(HandlerError.ErrorMsg); } }
public virtual void Initialization() { HandlerError.ClearErrors(); try { _serialPort = new SerialPort(PortName, BaudRate, Parity, DataBits, StopBits); _serialPort.DataReceived += DataReceivedHandler; } catch (Exception ex) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Open port. " + ex.Message; throw new Exception(HandlerError.ErrorMsg); } }
/// <summary> /// Triger Device /// </summary> public void Trigger() { HandlerError.ClearErrors(); try { ResourceIO.IO.AssertTrigger(Ivi.Visa.Interop.TriggerProtocol.TRIG_PROT_ON); HandlerCpu.Delay(1); } catch (Exception ex) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Trigger command VisaCom Method. " + ex.Message; throw new Exception(HandlerError.ErrorMsg); } }
/// <summary> /// Clean the Device Buffer /// </summary> public void Flush() { HandlerError.ClearErrors(); try { ResourceIO.FlushWrite(false); ResourceIO.IO.Clear(); } catch (Exception ex) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Flush command VisaCom Method. " + ex.Message; throw new Exception(HandlerError.ErrorMsg); } }
public void SM_Close() { HandlerError.ClearErrors(); try { SeaMaxDeviceHandler.SM_Close(); } catch (Exception e) { HandlerError.ErrorCode = -1; HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Close Returned Error Code: " + HandlerError.ErrorCode + ", when try to Open Port"; throw new Exception(e.Message); } }
public double Fetch() { HandlerError.ClearErrors(); try { WriteCommand("INIT"); WriteCommand("FETCh?"); double measure = 0; ReadCommand(out measure); return(measure); } catch (Exception e) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Data Adquisition Agilent 34970A. " + e.Message; throw new Exception(HandlerError.ErrorMsg); } }
public double GetMeasure(MeasType command, int channel) { HandlerError.ClearErrors(); double measures = 0; try { WriteCommand(MeasureType.GetMeasure(command) + " (@" + channel + ")"); ReadCommand(out measures); } catch (Exception e) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Data Adquisition Agilent 34970A. " + e.Message; throw new Exception(HandlerError.ErrorMsg); } return(measures); }
public void Open() { HandlerError.ClearErrors(); try { if (_serialPort.IsOpen) { throw new Exception("its Open the ports"); } _serialPort.Open(); } catch (Exception ex) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Open port. " + ex.Message; throw new Exception(HandlerError.ErrorMsg); } }
/// <summary> /// Device Agilent Initialization /// </summary> public virtual void Initialization() { HandlerError.ClearErrors(); ResourceManager = new ResourceManagerClass(); ResourceIO = new FormattedIO488Class(); try { ResourceManager.Open(DeviceAddress, AccessMode.NO_LOCK, 0, ""); ResourceIO.IO = (IMessage)ResourceManager.Open(DeviceAddress, AccessMode.NO_LOCK, 0, ""); } catch (Exception e) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Init resource Agilent Method. " + e.Message; throw new Exception(HandlerError.ErrorMsg); } }