pylab_ml.smu.keithley.keithley2602.Keithley2602
- class Keithley2602(addr=None, interface=None, backend=None, identify=True, instName=None)[source]
Bases:
KeithleyInterface to the dual channel Power-Measuremet-Unit (SMU) Keithley2602.
- Date:
May 05, 2026
- Author:
Semi-ATE <info@Semi-ATE.org>
The Keithley2602 can source and sink power in all four voltage/current quadrants and measure voltage and current precisely on dual channels a & b
- __init__(addr=None, interface=None, backend=None, identify=True, instName=None)[source]
Connect and initialize.
- Parameters:
- Example: Initialization
>>> vdd = Keithley2400(addr=24) # GPIB or USB address >>> # validate displayed message Id on device >>> vdd.init() # connect and initialize instrument
- Example: Voltage source
>>> vdd.i_clamp = 0.01 # current protection >>> vdd.voltage = 3.3 # set output voltage >>> i = vdd.current # measure (supply) current
- Example: Current source
>>> vdd.v_clamp = 5 # voltage protection >>> vdd.current = 0.1 # set output current_range >>> v = vdd.voltage # measure voltage
Methods
__init__([addr, interface, backend, ...])Connect and initialize.
channel([ch])Set channel A or B.
clear()Clear error status.
clearbuffer(ch)Clear the instrument buffer.
close()Close the connection and switch off all outputs.
com_recover([fix])Detect & attempt to recover out of step communication (maybe after timeout).
List of instrument errors.
find_names() returns list of identifiers strings, lhs of = assignments
get_values([typ])Transfer last requested measurement sweep results.
help()identify([showInstName])Identify message.
init([identify])Connect to Keithley instrument and initialize.
local()Switch back to local instrument control.
message([message])Message display.
mfilter(input)mqtt_add(client, instrument[, liste, qos])Add the instrument to mqtt.
Remove the instrument from mqtt.
off()Deactivate output.
on()Reactivate output.
publish(topic, value)Publish topic as type='cmd' with paylad=value.
publish_get(function_name, value)Publish function_name as type='get' with paylad=value.
publish_set(function_name, value)Publish function_name as type='set' with paylad=value.
reset()Reset and switch beep off.
scriptin(msg)A multiline LUA script needs to have -- comments correctly handled and newlines.
scripts()Upload specific functionality : sweep DUT.
Start setup instrument settings, called from class instruments.
stair_sweep(start, stop, dstep[, stime, ...])Sweep V or I, measure v,i,r,p at time t with state s, wait for response.
Attributes
ABAutorange drive current on or off.
Set the current driver range (A).
Autorange drive voltage on or off.
Set the voltage driver range (V).
Get or Set channel A or B.
commandGet or set output current.
Autorange current measurement on or off.
Set the current clamping (A), will adjust current measurement range.
Set the current measurement range (A).
Query IDN.
Return with instname or instname[ch] if it has channels.
interchoicesGet or set measure.
Set/get the number of measurement to be carried out in a loop.
mqtt_enablemqtt_listGetter for the mqtt_status.
Set the conversion number of power line cycles accuracy, for all converters.
Set/get on state from output (True).
stair_slope to target or target, slope_time using previous stair_sweep() parameters.
Set incremental ramp to target or (target,dstep) or (target,dstep,stime).
Autorange voltage measurement on or off.
Set the voltage clamping (V), will adjust voltage measurement range.
Set the voltage measurement range (V).
Get or set output voltage.
- property I_autorange
Autorange drive current on or off.
- property I_range
Set the current driver range (A).
- property V_autorange
Autorange drive voltage on or off.
- property V_range
Set the voltage driver range (V).
- property ch
Get or Set channel A or B.
- clear()
Clear error status.
- com_recover(fix=False)[source]
Detect & attempt to recover out of step communication (maybe after timeout).
can lose coherency between read request and data, usually because of Timeout this routine can diagnose such loss of coherency and attempt to fix it, when fix=Tru
- property current
Get or set output current.
If the current is set the output is switched on immediately.
- find_names()
find_names() returns list of identifiers strings, lhs of = assignments
- get_values(typ='')[source]
Transfer last requested measurement sweep results.
Get response of previous stair_sweep(), choosing result rows from previous request typ
- Parameters:
typ (string, optional) – ‘virpts’. The default is ‘’.
- Returns:
values.
- Return type:
TYPE
- property i_autorange
Autorange current measurement on or off.
- property i_clamp
Set the current clamping (A), will adjust current measurement range.
- property i_range
Set the current measurement range (A).
- property id
Query IDN.
- identify(showInstName=False)
Identify message.
- init(identify=False)
Connect to Keithley instrument and initialize.
- property instName
Return with instname or instname[ch] if it has channels.
- json = <module 'json' from '/home/runner/miniconda3/envs/test/lib/python3.9/json/__init__.py'>
- local()
Switch back to local instrument control.
- property measure
Get or set measure.
where the measurements are defined by “virp” flags (VOLTAGE,CURRENT,RESISTANCE,POWER).
- property measurecnt
Set/get the number of measurement to be carried out in a loop.
TODO: this function is not running yet, it is only a dummy
if the result == None than this function not implemented. The return value for the measurement is calculated togetheer with the mfilter setting.
- mqtt_add(client, instrument, liste='#', qos=0)
Add the instrument to mqtt.
calling from base_instrument, after the instrument (device) has been create. Normally you have not to use this function, only base_instrument use it.
- Returns:
None.
- mqtt_disconnect()
Remove the instrument from mqtt.
calling from base_instrument, if the instrument are closing. Normally you have not to use this function, only base_instrument use it.
- Returns:
None.
- property mqtt_status
Getter for the mqtt_status.
- property nplc
Set the conversion number of power line cycles accuracy, for all converters.
for a plc of 0.1, conversion rate is 0.1/50s = 2ms. Accuracy max 25, min 0.001
- property onoff
Set/get on state from output (True).
- publish(topic, value)
Publish topic as type=’cmd’ with paylad=value.
- publish_get(function_name, value)
Publish function_name as type=’get’ with paylad=value.
- publish_set(function_name, value)
Publish function_name as type=’set’ with paylad=value.
- scriptin(msg)[source]
A multiline LUA script needs to have – comments correctly handled and newlines.
converted to returns
- property stair_slope
stair_slope to target or target, slope_time using previous stair_sweep() parameters.
- property stair_step
Set incremental ramp to target or (target,dstep) or (target,dstep,stime).
Step_stair to target or target,dstep or target,dstep,stime, using previous stair_sweep() parameters.
- stair_sweep(start, stop, dstep, stime=0, typ='V', stair='Lin', wait=False)[source]
Sweep V or I, measure v,i,r,p at time t with state s, wait for response.
- Parameters:
typ –
‘Vvirpts-?’, ‘Ivirpts-?’ = Voltage / Current sourced, ‘-’ changes direction,volts, amps, ohms, power, timestamp, status are sensed, ? animates displaystart – Start value in volts or amps
stop – Stop value in volts or amps
dstep – Delta amplitude for Lin, Points to interpolate for Log, stime is slope time for None (>0.2ms)
stime – Delay between steps or slope time if dstep == None
stair – (‘Lin’,’Log) = linear or log source
- property v_autorange
Autorange voltage measurement on or off.
- property v_clamp
Set the voltage clamping (V), will adjust voltage measurement range.
- property v_range
Set the voltage measurement range (V).
- property voltage
Get or set output voltage.
If the voltage is set the output is switched on immediately.