/// <summary> /// Makes a measurement using the built in meter of the power supply over a period of time. /// </summary> /// <param name="MeasurementType">Type of measurement to configure power supply for.</param> /// <param name="NumMeasurements">The number of measurements to take.</param> /// <param name="value">Average reading of all measurements.</param> /// <param name="ErrorResponse">Error reponse of instrument. (+0,"No error") is a normal response with no error</param> /// <returns></returns> public bool MeasurementPowerSupplyAverage(SOURceSubsystem_e MeasurementType, int NumMeasurements, out double value, out string ErrorResponse) { value = 0; string DataOut = null; ErrorResponse = null; for (int loopcount = 0; loopcount < NumMeasurements; loopcount += 1) { Add(MeasurementType); if (SendCommand(out DataOut, out ErrorResponse) != true) return false; value += Convert.ToDouble(DataOut); } value = value / NumMeasurements; return true; }
/// <summary> /// Sets the power supply voltage and current parameters, then enables the output. /// </summary> /// <param name="Voltage">The voltage to set the output at.</param> /// <param name="CurrentLimit">The maximum current allowed before causing an overload condition.</param> /// <param name="VoltageRange">Set the range according to the output voltage, 0-8VDC or up to 30VDC.</param> /// <param name="DataOut">If requesting a measurement, measured value will be stored here.</param> /// <param name="ErrorResponse">Error reponse of instrument. (+0,"No error") is a normal response with no error</param> /// <param name="range">Measurement range</param> /// <param name="resolution">Measurement resolution</param> /// <returns></returns> public bool ApplyPower(double Voltage, double CurrentLimit, SOURceSubsystem_e VoltageRange, out string DataOut, out string ErrorResponse, MEASurementRange_e range = MEASurementRange_e.DC100mA, MEASurementResolution_e resolution = MEASurementResolution_e.DC1mA) { ErrorResponse = DataOut = null; Add(CONFigureSubsystem_e.CurrentDC, range, resolution); Add(VoltageRange); Add(SOURceSubsystem_e.VoltageImmediateAmplitude, Voltage); Add(SOURceSubsystem_e.CurrentLimit, CurrentLimit); Add(OUTPutSubsystem_e.EnableOutput); return SendCommand(out DataOut, out ErrorResponse); }
/// <summary> /// Makes a measurement using the built in meter of the power supply. /// </summary> /// <param name="MeasurementType">Type of measurement to configure power supply for.</param> /// <param name="DataOut">If requesting a measurement, measured value will be stored here.</param> /// <param name="ErrorResponse">Error reponse of instrument. (+0,"No error") is a normal response with no error</param> /// <returns></returns> public bool MeasurementPowerSupply(SOURceSubsystem_e MeasurementType, out string DataOut, out string ErrorResponse) { Add(MeasurementType); return SendCommand(out DataOut, out ErrorResponse); }