pylab_ml.example.eg.eg_generic.EG_Generic

class EG_Generic(**kwargs)[source]

Bases: Example

Interface to the Keithley SMU Instruments.

The Keithley baseclass can connect to Keithley SMU instruments

Initialization arguments:
addr (int):

interface address

interface (dev_interface.Instrument):

gpib, usbserial

backend (str):

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

Example: Initialization
>>> instrument = Keithley(addr=24)   # GPIB or USB address
>>> instrument.init()                # connect and initialize instrument
init()[source]

connect and initialize

local()[source]

switch back to instrument control

reset()[source]

reset

identify()

instrument message, reflect address & interface

message("")[source]

instrument message (“string”) or ()

error_list()[source]

list of instrument errors

close()

terminate interface

com_recover(bool)[source]

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:

id get IDN string

__init__(**kwargs)[source]

Methods

__init__(**kwargs)

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 this routine can diagnose such loss of coherency and attempt to fix it, when fix=True

create_session()

Create an Instrument Session for Instrument.inst, example Keithley2000 or Keithley2400 on Linux usbserial.

error_list()

list of outstanding errors

find_names()

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

help()

identify([showInstName])

Identify message.

init([identify])

Connect to Keithley instrument and initialize.

local()

Switch back to local instrument control

message([message])

Message display.

mqtt_add(client, instrument[, liste, qos])

Add the instrument to mqtt.

mqtt_disconnect()

Remove the instrument from mqtt.

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()

Setup the instrument settings.

Attributes

command

id

Query IDN.

interchoices

mqtt_enable

mqtt_list

mqtt_status

Getter for the mqtt_status.

clear()[source]

Clear error status

close(force=False)

Close connection to instrument.

com_recover(fix=False)[source]

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

create_session()[source]

Create an Instrument Session for Instrument.inst, example Keithley2000 or Keithley2400 on Linux usbserial.

error_list()[source]

list of outstanding errors

find_names()

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

property id

Query IDN.

identify(showInstName=False)

Identify message.

init(identify=False)[source]

Connect to Keithley instrument and initialize.

json = <module 'json' from '/home/runner/miniconda3/envs/test/lib/python3.9/json/__init__.py'>
local()[source]

Switch back to local instrument control

message(message=None)[source]

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.

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()[source]

Reset and switch beep off

setup_inst()

Setup the instrument settings.