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); }
/// <summary> /// Get Voltage /// </summary> /// <returns>Get Measure Voltage</returns> public double GetVoltage() { HandlerError.ClearErrors(); double measure = 0; try { WriteCommand(MeasureType.GetMeasure(MeasType.VoltDc)); ReadCommand(out measure); OnVoltageEvent(measure.ToString(CultureInfo.InvariantCulture)); } catch (Exception e) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Get Voltage command Agilent Method. " + e.Message; throw new Exception(HandlerError.ErrorMsg); } return(measure); }
public double GetMeasure(MeasType command) { HandlerError.ClearErrors(); double measures = 0; try { var commandstring = MeasureType.GetMeasure(command); WriteCommand(commandstring); OnMeasureTypeEvent(commandstring); ReadCommand(out measures); OnMeasureEvent(Convert.ToString(measures, CultureInfo.InvariantCulture)); } catch (Exception e) { HandlerError.ErrorOccurred = true; HandlerError.ErrorMsg = "Data Adquisition Agilent 34401A. " + e.Message; throw new Exception(HandlerError.ErrorMsg); } return(measures); }