pylab_ml.base_instrument.GeneralVisa

class GeneralVisa(**kwargs)[source]

Bases: Instrument

Interface to any Visa Instrument.

The GeneralVisa baseclass can connect to Visa usbserial & gpib instruments Very limited capabilities, but general purpose for low level access to inst Use this class to debug an instrument.inst, note there is no init()

Initialization arguments:
addr (int):

interface address

interface (Interface):

gpib, usbserial

backend (str):

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

Example: Initialization
>>> instrument = GeneralVisa(addr=24)       # GPIB or USB address
close()

terminate interface

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)

close([force])

Close connection to instrument.

find_names()

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

help()

identify([showInstName])

Identify message.

init([identify])

Optional init for interlock startup after identification.

message([msg])

There is no message implemented.

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

There is no reset implemented.

setup_inst()

Setup the instrument settings.

Attributes

command

id

Query IDN.

idtry

Query IDN.

interchoices

mqtt_enable

mqtt_list

mqtt_status

Getter for the mqtt_status.

close(force=False)

Close connection to instrument.

find_names()

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

property id

Query IDN.

identify(showInstName=False)

Identify message.

property idtry

Query IDN.

init(identify=False)

Optional init for interlock startup after identification.

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

There is no message implemented.

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]

There is no reset implemented.

setup_inst()

Setup the instrument settings.