Package: instrumentkit
InstrumentKit is an open source Python library designed to help the
end-user get straight into communicating with their equipment via a PC.
InstrumentKit aims to accomplish this by providing a connection- and
vendor-agnostic API. Users can freely swap between a variety of
connection types (ethernet, gpib, serial, usb) without impacting their
code. Since the API is consistent across similar instruments, a user
can, for example, upgrade from their 1980’s multimeter using GPIB to a
modern Keysight 34461a using ethernet with only a single line change.Supported means of communication are:Galvant Industries GPIBUSB adapter (open_gpibusb)Serial (open_serial)Sockets (open_tcpip)VISA (open_visa)Read/write from unix files (open_file)USBTMC (open_usbtmc)VXI11 over Ethernet (open_vxi11)There is planned support for HiSLIP someday, but a good Python HiSLIP library will be needed first.If you have any problems or have code you wish to contribute back to the
project please feel free to open an issue or a pull request!InstallationTheinstrumentspackage can be installed from this repository by the
following means:From Git:$gitclonegit@github.com:Galvant/InstrumentKit.git$cdInstrumentKit$pythonsetup.pyinstallFrom Github using pip:$pipinstall-egit+https://www.github.com/Galvant/InstrumentKit.git#egg=instrumentkitFrom pypi using pip:$pipinstallinstrumentkitUsage ExampleTo open a connection to a generic SCPI-compatible multimeter using a Galvant
Industries’ GPIBUSB adapter:>>>importinstrumentsasik>>>inst=ik.generic_scpi.SCPIMultimeter.open_gpibusb("/dev/ttyUSB0",1)From there, various built-in properties and functions can be called. For
example, the instrument’s identification information can be retrieved by
calling the name property:>>>print(inst.name)Or, since in the demo we connected to anSCPIMultimeter, we can preform
multimeter-specific tasks, such as switching functions, and taking a
measurement reading:>>>reading=inst.measure(inst.Mode.voltage_dc)>>>print("Value:{}, units:{}".format(reading.magnitude,reading.units))Due to the sheer number of commands most instruments support, not every single
one is included in InstrumentKit. If there is a specific command you wish to
send, one can use the following functions to do so:>>>inst.sendcmd("DATA")# Send command with no response>>>resp=inst.query("*IDN?")# Send command and retrieve responsePython Version CompatibilityAt this time, Python 2.7, 3.5, 3.6, and 3.7 are supported. Should you encounter
any problems with this library that occur in one version or another, please
do not hesitate to let us know.DocumentationYou can find the project documentation at our ReadTheDocs pages located athttp://instrumentkit.readthedocs.org/en/latest/index.htmlContributingThe InstrumentKit team always welcome additional contributions to the project.
However, we ask that you please review our contributing developer guidelines
which can be found in the documentation. We also suggest that you look at
existing classes which are similar to your work to learn more about the
structure of this project.To run the tests against all supported version of Python, you will need to
have the binary for each installed, as well as any requirements needed to
installnumpyunder each Python version. On Debian/Ubuntu systems this means
you will need to install thepython-devpackage for each version of Python
supported (python2.7-dev,python3.7-dev, etc).With the required system packages installed, all tests can be run withtox:$pipinstalltox$toxLicenseAll code in this repository is released under the AGPL-v3 license. Please see
thelicensefolder for more information.