Keithley 2450 SourceMeter
- class pymeasure.instruments.keithley.Keithley2450(adapter, name='Keithley 2450 SourceMeter', **kwargs)
Bases:
KeithleyBuffer,SCPIMixin,InstrumentRepresents the Keithley 2450 SourceMeter and provides a high-level interface for interacting with the instrument.
NOTE: The default buffer handling SCPI command set of the Keithley 2450 model is currently unsupported. The instrument works if made to emulate a 2400 model by setting its command set to “SCPI 2400” through the instrument’s system settings.
keithley = Keithley2450("GPIB::1") keithley.apply_current() # Sets up to source current keithley.source_current_range = 10e-3 # Sets the source current range to 10 mA keithley.compliance_voltage = 10 # Sets the compliance voltage to 10 V keithley.source_current = 0 # Sets the source current to 0 mA keithley.enable_source() # Enables the source output keithley.measure_voltage() # Sets up to measure voltage keithley.ramp_to_current(5e-3) # Ramps the current to 5 mA print(keithley.voltage) # Prints the voltage in Volts keithley.shutdown() # Ramps the current to 0 mA and disables output
- apply_current(current_range=None, compliance_voltage=0.1)
Configures the instrument to apply a source current, and uses an auto range unless a current range is specified. The compliance voltage is also set.
- Parameters:
compliance_voltage – A float in the correct range for a
compliance_voltage(default:0.1)current_range – A
current_rangevalue or None (default:None)
- apply_voltage(voltage_range=None, compliance_current=0.1)
Configures the instrument to apply a source voltage, and uses an auto range unless a voltage range is specified. The compliance current is also set.
- Parameters:
compliance_current – A float in the correct range for a
compliance_current(default:0.1)voltage_range – A
voltage_rangevalue or None (default:None)
- auto_range_source()
Configures the source to use an automatic range.
- beep(frequency, duration)
Sounds a system beep.
- Parameters:
frequency – A frequency in Hz between 65 Hz and 2 MHz
duration – A time in seconds between 0 and 7.9 seconds
- property buffer_data
Get a numpy array of values from the buffer.
- property buffer_points: Any
Control (integer) the number of buffer points. This does not represent actual points in the buffer, but the configuration value instead.
- check_errors()
Read all errors from the instrument.
- Returns:
List of error entries.
- check_get_errors()
Check for errors after having gotten a property and log them.
Called if
check_get_errors=Trueis set for that property.If you override this method, you may choose to raise an Exception for certain errors.
- Returns:
list– List of error entries.
- check_set_errors()
Check for errors after having set a property and log them.
Called if
check_set_errors=Trueis set for that property.If you override this method, you may choose to raise an Exception for certain errors.
- Returns:
list– List of error entries.
- clear()
Clear the instrument status byte.
- property complete: Any
Get the synchronization bit.
This property allows synchronization between a controller and a device. The Operation Complete query places an ASCII character 1 into the device’s Output Queue when all pending selected device operations have been finished.
- property compliance_current: Any
Control (floating) the compliance current in Amps.
- property compliance_voltage: Any
Control (floating) the compliance voltage in Volts.
- config_buffer(points=64, delay=0)
Configure the measurement buffer for a number of points, to be taken with a specified delay.
- Parameters:
points – The number of points in the buffer. (default:
64)delay – The delay time in seconds. (default:
0)
- property current: Any
Get the current in Amps, if configured for this reading.
- property current_filter_count: Any
Control (integer) the number of readings that are acquired and stored in the filter buffer for the averaging
- property current_filter_state: Any
Control (string) if the filter is active.
- property current_filter_type: Any
Control (String) the filter’s type for the current. REP : Repeating filter MOV : Moving filter
- property current_nplc: Any
Control (floating) the number of power line cycles (NPLC) for the DC current measurements, which sets the integration period and measurement speed. Takes values from 0.01 to 10, where 0.1, 1, and 10 are Fast, Medium, and Slow respectively.
- property current_output_off_state: Any
Control SourceMeter output. HIMP : output relay is open, disconnects external circuitry. NORM : V-Source is selected and set to 0V, Compliance is set to 0.5% full scale of the present current range. ZERO : V-Source is selected and set to 0V, compliance is set to the programmed Source I value or to 0.5% full scale of the present current range, whichever is greater. GUAR : I-Source is selected and set to 0A
- property current_range: Any
Control (floating) the measurement current range in Amps, which can take values between -1.05 and +1.05 A. Auto-range is disabled when this property is set.
- disable_buffer()
Disable the connection between measurements and the buffer, but does not abort the measurement process.
- disable_source()
Disables the source of current or voltage depending on the configuration of the instrument.
- enable_source()
Enables the source of current or voltage depending on the configuration of the instrument.
- property error
Get the next error from the queue.
Deprecated since version 0.15: Use next_error instead.
- property id: Any
Get the identification of the instrument.
- is_buffer_full()
Return True if the buffer is full of measurements.
- property max_current
Get the maximum current from the buffer
- property max_resistance
Get the maximum resistance from the buffer
- property max_voltage
Get the maximum voltage from the buffer
- property maximums: Any
Get the calculated maximums for voltage, current, and resistance from the buffer data as a list.
- property mean_current
Get the mean current from the buffer
- property mean_resistance
Get the mean resistance from the buffer
- property mean_voltage
Get the mean voltage from the buffer
- property means: Any
Get the calculated means (averages) for voltage, current, and resistance from the buffer data as a list.
- measure_current(nplc=1, current=0.000105, auto_range=True)
Configures the measurement of current.
- Parameters:
nplc – Number of power line cycles (NPLC) from 0.01 to 10 (default:
1)current – Upper limit of current in Amps, from -1.05 A to 1.05 A (default:
0.000105)auto_range – Enables auto_range if True, else uses the set current (default:
True)
- measure_resistance(nplc=1, resistance=210000.0, auto_range=True)
Configures the measurement of resistance.
- Parameters:
nplc – Number of power line cycles (NPLC) from 0.01 to 10 (default:
1)resistance – Upper limit of resistance in Ohms, from -210 MOhms to 210 MOhms (default:
210000.0)auto_range – Enables auto_range if True, else uses the set resistance (default:
True)
- measure_voltage(nplc=1, voltage=21.0, auto_range=True)
Configures the measurement of voltage.
- Parameters:
nplc – Number of power line cycles (NPLC) from 0.01 to 10 (default:
1)voltage – Upper limit of voltage in Volts, from -210 V to 210 V (default:
21.0)auto_range – Enables auto_range if True, else uses the set voltage (default:
True)
- property min_current
Get the minimum current from the buffer
- property min_resistance
Get the minimum resistance from the buffer
- property min_voltage
Get the minimum voltage from the buffer
- property minimums: Any
Get the calculated minimums for voltage, current, and resistance from the buffer data as a list.
- property next_error: Any
Get the next error in the queue. If you want to read and log all errors, use
check_errors()instead.
- property options: Any
Get the device options installed.
- ramp_to_current(target_current, steps=30, pause=0.02)
Ramps to a target current from the set current value over a certain number of linear steps, each separated by a pause duration.
- Parameters:
target_current – A current in Amps
steps – An integer number of steps (default:
30)pause – A pause duration in seconds to wait between steps (default:
0.02)
- ramp_to_voltage(target_voltage, steps=30, pause=0.02)
Ramps to a target voltage from the set voltage value over a certain number of linear steps, each separated by a pause duration.
- Parameters:
target_voltage – A voltage in Amps
steps – An integer number of steps (default:
30)pause – A pause duration in seconds to wait between steps (default:
0.02)
- read(**kwargs)
Read up to (excluding) read_termination or the whole read buffer.
- Return type:
str
- read_binary_values(**kwargs)
Read binary values from the device.
- read_bytes(count, **kwargs)
Read a certain number of bytes from the instrument.
- Parameters:
count (int) – Number of bytes to read. A value of -1 indicates to read the whole read buffer.
kwargs – Keyword arguments for the adapter.
- Returns bytes:
Bytes response of the instrument (including termination).
- Return type:
bytes
- reset()
Resets the instrument and clears the queue.
- reset_buffer()
Reset the buffer.
- property resistance: Any
Get the resistance in Ohms, if configured for this reading.
- property resistance_nplc: Any
Control (floating) the number of power line cycles (NPLC) for the 2-wire resistance measurements, which sets the integration period and measurement speed. Takes values from 0.01 to 10, where 0.1, 1, and 10 are Fast, Medium, and Slow respectively.
- property resistance_range: Any
Control (floating) the resistance range in Ohms, which can take values from 0 to 210 MOhms. Auto-range is disabled when this property is set.
- shutdown()
Ensures that the current or voltage is turned to zero and disables the output.
- property source_current: Any
Control (floating) the source current in Amps.
- property source_current_delay: Any
Control (floating) a manual delay for the source after the output is turned on before a measurement is taken. When this property is set, the auto delay is turned off. Valid values are between 0 [seconds] and 999.9999 [seconds].
- property source_current_delay_auto: Any
Control (bool) auto delay. Valid values are True and False.
- property source_current_range: Any
Control (floating) the source current range in Amps, which can take values between -1.05 and +1.05 A. Auto-range is disabled when this property is set.
- property source_enabled: Any
Get a boolean value that is True if the source is enabled.
- property source_mode: Any
Control (string) the source mode, which can take the values ‘current’ or ‘voltage’. The convenience methods
apply_current()andapply_voltage()can also be used.
- property source_voltage: Any
Control (floating) the source voltage in Volts.
- property source_voltage_delay: Any
Control (floating) a manual delay for the source after the output is turned on before a measurement is taken. When this property is set, the auto delay is turned off. Valid values are between 0 [seconds] and 999.9999 [seconds].
- property source_voltage_delay_auto: Any
Control (bool) auto delay. Valid values are True and False.
- property source_voltage_range: Any
Control (floating) the source voltage range in Volts, which can take values from -210 to 210 V. Auto-range is disabled when this property is set.
- property standard_devs: Any
Get the calculated standard deviations for voltage, current, and resistance from the buffer data as a list.
- start_buffer()
Starts the buffer.
- property status: Any
Get the status byte and Master Summary Status bit.
- property std_current
Get the current standard deviation from the buffer
- property std_resistance
Get the resistance standard deviation from the buffer
- property std_voltage
Get the voltage standard deviation from the buffer
- stop_buffer()
Abort the buffering measurement, by stopping the measurement arming and triggering sequence. If possible, a Selected Device Clear (SDC) is used.
- triad(base_frequency, duration)
Sounds a musical triad using the system beep.
- Parameters:
base_frequency – A frequency in Hz between 65 Hz and 1.3 MHz
duration – A time in seconds between 0 and 7.9 seconds
- trigger()
Executes a bus trigger.
- use_front_terminals()
Enables the front terminals for measurement, and disables the rear terminals.
- use_rear_terminals()
Enables the rear terminals for measurement, and disables the front terminals.
- property voltage: Any
Get the voltage in Volts, if configured for this reading.
- property voltage_filter_count: Any
Control (integer) the number of readings that are acquired and stored in the filter buffer for the averaging
- property voltage_filter_type: Any
Control (String) the filter’s type for the current. REP : Repeating filter MOV : Moving filter
- property voltage_nplc: Any
Control (floating) the number of power line cycles (NPLC) for the DC voltage measurements, which sets the integration period and measurement speed. Takes values from 0.01 to 10, where 0.1, 1, and 10 are Fast, Medium, and Slow respectively.
- property voltage_output_off_state: Any
Control the SourceMeter output. HIMP : output relay is open, disconnects external circuitry. NORM : V-Source is selected and set to 0V, Compliance is set to 0.5% full scale of the present current range. ZERO : V-Source is selected and set to 0V, compliance is set to the programmed Source I value or to 0.5% full scale of the present current range, whichever is greater. GUAR : I-Source is selected and set to 0A
- property voltage_range: Any
Control (floating) the measurement voltage range in Volts, which can take values from -210 to 210 V. Auto-range is disabled when this property is set.
- wait_for(query_delay=None)
Wait for some time. Used by ‘ask’ to wait before reading.
- Parameters:
query_delay (
Optional[float]) – Delay between writing and reading in seconds. None is default delay. (default:None)- Return type:
None
- wait_for_buffer(should_stop=<function KeithleyBuffer.<lambda>>, timeout=60, interval=0.1)
Block the program, waiting for a full buffer. This function returns early if the
should_stopfunction returns True or the timeout is reached before the buffer is full.- Parameters:
should_stop – A function that returns True when this function should return early (default:
<function KeithleyBuffer.<lambda> at 0x76f1f4519800>)timeout – A time in seconds after which this function should return early (default:
60)interval – A time in seconds for how often to check if the buffer is full (default:
0.1)
- property wires: Any
Control (integer) the number of wires in use for resistance measurements, which can take the value of 2 or 4.
- write(command, **kwargs)
Write a string command to the instrument appending write_termination.
- Parameters:
command (
str) – command string to be sent to the instrumentkwargs – Keyword arguments for the adapter.
- Return type:
None
- write_binary_values(command, values, *args, **kwargs)
Write binary values to the device.
- Parameters:
command (
str) – Command to send.values (
Sequence[Union[int,float]]) – The values to transmit.**kwargs (*args,) – Further arguments to hand to the Adapter.
- Return type:
None
- write_bytes(content, **kwargs)
Write the bytes content to the instrument.
- Return type:
None