pylab_ml.smu.rohde_schwarz.hmp4040.HMP4040

class HMP4040(addr=None, interface=None, backend=None, identify=True, instName=None)[source]

Bases: Rohde_Schwarz

Interface to the Power-Measuremet-Unit (SMU) HMP4040.

The HMP4040 can source and sink power in all four voltage/current quadrants and measure voltage and current precisely

Initialization arguments:

addr (int): interface address

interface (Instrument):

gpib, usbserial

backend (str):

visa backend is either @ni’ for NI-Library or @py’ for pure python pyvisa-py backend. By default it uses @ni’ on win32 and @py’ on other platforms.

Example: Initialization
>>> vdd = HMP4040(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
init()

connect and initialize

local()

switch back to instrument control

clear()

clear

reset()

reset

identify()

instrument message, reflect address & interface

message("")

instrument message (“string”) or ()

error_list()

list of instrument errors

off()[source]

deactivate outputs

on()[source]

reactivate outputs

query_onoff()[source]

return with True=device is on, or False=device off

stair_sweep(start, stop, dstep, stime=0, typ='VIvirts-', stair='Lin', nplc=0.1, wait=False)[source]

sweep V or I, measure v,i,r at time t with state s, change by dstep, steptime stime, wait for response if dstep is None then stime is slopetime (>1ms) & nplc is min : 0.01

get_values(typ='virts')[source]

get response of previous stair_sweep(), choosing result rows from previous request typ

close()

terminate interface

com_recover(bool)

detect & attempt to recover out of step communication (maybe after timeout)

inst.write('*RST')

write direct to instrument

ask=inst.query('

READ?’) write and read the answer

Properties:
voltage

get/set voltage

current

get/set current

measure

get voltage,current,resistance, set “vir” to get

stair_step

set incremental ramp to target or (target,dstep) or (target,dstep,stime)

stair_slope

set incremental ramp to target or (target,slopetime)

nplc

set conversion accuracy (number of powerline cycles), [10.0 - 0.1 - 0.01]

i_clamp

set current clamping and current measurement range

v_clamp

set voltage clamping and voltage measurement range

i_range

set current measurement range (and voltage clamping)

v_range

set voltage measurement range (and current clamping)

I_range

set current drive range

V_range

set voltage drive range

i_autorange

set current measurement autorange

v_autorange

set voltage measurement autorange

I_autorange

set current drive autorange

V_autorange

set voltage drive autorange

v_protection

set voltage protection limit

onoff

get/set on state (True)

id

get IDN string

__init__(addr=None, interface=None, backend=None, identify=True, instName=None)[source]

Initialize the smu class.

Methods

__init__([addr, interface, backend, ...])

Initialize the smu class.

channel([ch])

Set channel A, B, C & D.

clear()

Clear error status.

close([force])

Close connection to instrument.

com_recover([fix])

Can lose coherency between read request and data, usually because of Timeout.

error_list()

List of outstanding errors.

find_names()

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.

mqtt_disconnect()

Remove the instrument from mqtt.

off()

Switch output off.

on()

Switch output on.

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.

query_onoff()

query_output_function()

reset()

Reset and switch beep off.

setup_inst()

Set the Setup instrument settings.

stair_sweep(start, stop, dstep[, stime, ...])

Make a stair sweep.

Attributes

A

B

C

D

I_autorange

Autorange drive current on or off.

I_range

Set the current drive range (A).

V_autorange

Autorange drive voltage on or off.

V_range

Set the voltage drive range (V).

ch

Get or Set channel A or B.

command

current

Get or set output current.

i_autorange

Autorange current measurement on or off.

i_clamp

Set the current clamping (A), will adjust current measurement range.

i_range

Set the current measurement range (A), will adjust current clamping.

id

Query IDN.

instName

Return with instname or instname[ch] if it has channels.

interchoices

measure

Get or set measure.

measurecnt

Set/get the number of measurement to be carried out in a loop.

mqtt_enable

mqtt_list

mqtt_status

Getter for the mqtt_status.

nplc

Set the conversion number of power line cycles accuracy, for all converters.

onoff

stair_slope

stair_slope to target or target,slope_time using previous stair_sweep() parameters.

stair_step

stair_step to target or target,dstep or target,dstep,stime, using previous stair_sweep() parameters.

v_autorange

Autorange voltage measurement on or off.

v_clamp

Set the voltage clamping (V), will adjust voltage measurement range.

v_protection

Set the voltage protection limit|default|min|max, get 4 value tuple.

v_range

Set the voltage measurement range, will adjust voltage clamping.

voltage

Get or set output voltage.

property I_autorange

Autorange drive current on or off.

property I_range

Set the current drive range (A).

property V_autorange

Autorange drive voltage on or off.

property V_range

Set the voltage drive range (V).

property ch

Get or Set channel A or B.

channel(ch='A')[source]

Set channel A, B, C & D.

clear()

Clear error status.

close(force=False)

Close connection to instrument.

com_recover(fix=False)

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=True

property current

Get or set output current.

If the current is set the output is switched on immediately.

error_list()

List of outstanding errors.

find_names()

find_names() returns list of identifiers strings, lhs of = assignments

get_values(typ='')[source]

Transfer last requested measurement sweep results.

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), will adjust current clamping.

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 “vir” flags (VOLTAGE,CURRENT,RESISTANCE)

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.

message(message=None)

Message display.

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 1.0, conversion rate is 1/50s = 20ms. Accuracy max 10, min 0.01

off()[source]

Switch output off.

on()[source]

Switch output on.

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.

setup_inst()[source]

Set the Setup instrument settings.

property stair_slope

stair_slope to target or target,slope_time using previous stair_sweep() parameters.

property stair_step

stair_step 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]

Make a stair sweep.

typ: ‘Vvirts-’, ‘Ivirts-’ = Voltage / Current sourced, ‘-’ changes direction.

volts, amps, ohms, timestamp, status are sensed

start: Start value in volts or amps, None implies incremental stop: Stop value in volts or amps dstep: Delta amplitude for Lin, Points to interpolate for Log, stime is slope time for None (>1ms) 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_protection

Set the voltage protection limit|default|min|max, get 4 value tuple.

property v_range

Set the voltage measurement range, will adjust voltage clamping.

property voltage

Get or set output voltage.

If the voltage is set the output is switched on immediately.