Example #1
0
        public double MeasureResistance()
        {
            if (_currentMeasureFunction != Keithley26xxBMeasureFunctions.MEASURE_OHMS)
            {
                _currentMeasureFunction    = Keithley26xxBMeasureFunctions.MEASURE_OHMS;
                _display.smuX.measure.func = Keithley26xxBMeasureFunctions.MEASURE_OHMS;
            }

            var response = _driver.RequestQuery(string.Format("MeasureResistance_smu{0}({1}, {2}, {3})", ChannelIdentifier, _currentAveraging, _currentNPLC.ToString(CultureInfo.InvariantCulture), _currentDelay.ToString(CultureInfo.InvariantCulture)));

            var result  = 0.0;
            var success = double.TryParse(response, NumberStyles.Float, CultureInfo.InvariantCulture, out result);

            if (success)
            {
                return(result);
            }
            else
            {
                throw new Exception("Can't read resistance!");
            }
        }
        public double MeasureVoltage()
        {
            if (_currentMeasureFunction != Keithley26xxBMeasureFunctions.MEASURE_DCVOLTS)
            {
                _currentMeasureFunction = Keithley26xxBMeasureFunctions.MEASURE_DCVOLTS;
                _display.smuX.measure.func = Keithley26xxBMeasureFunctions.MEASURE_DCVOLTS;
            }

            var responce = _driver.RequestQuery(string.Format("MeasureVoltage_smu{0}({1}, {2}, {3})", ChannelIdentifier, _currentAveraging, _currentNPLC.ToString(CultureInfo.InvariantCulture), _currentDelay.ToString(CultureInfo.InvariantCulture)));

            var result = 0.0;
            var success = double.TryParse(responce, NumberStyles.Float, CultureInfo.InvariantCulture, out result);

            if (success)
                return result;
            else
                throw new Exception("Can't read voltage!");
        }
        public void Initialize(IDeviceIO Driver, string channelID)
        {
            _driver = Driver;
            ChannelIdentifier = channelID;

            _display = new Keithley26xxB_Display(ref Driver, ChannelIdentifier);
            _SetBeeperEnabled(true);

            _currentMeasureFunction = Keithley26xxBMeasureFunctions.MEASURE_DCAMPS;
            _display.smuX.measure.func = Keithley26xxBMeasureFunctions.MEASURE_DCAMPS;

            _LoadDeviceFunctions();

            _stopWatch = new Stopwatch();
        }