Skip to main content

Implement SCPI in pure Python

Project description

python-scpi

New asyncio version. Only for Python 3.5 and above

Since all the other wrappers either require VISA binary or are not generic (and do not implement the device I need)

Basic idea here is to make transport-independent command sender/parser and a device baseclass that implements the common SCPI commands

A device specific implementation can then add the device-specific commands.

Pro tip for thos wishing to work on the code http://guide.python-distribute.org/pip.html#installing-from-a-vcs

Usage

  • Instatiate a transport (for GPIB you will need GPIBDeviceTransport to be able to use the device helper class)
  • Instatiate SCPIProtocol with the transport (optional, see below)
  • Instantiate SCPIDevice with the protocol (or as a shorthand: with the transport directly)
  • Use the asyncio eventloop to run the device methods (all of which are coroutines)

Or if you're just playing around in the REPL use AIOWrapper to hide the eventloop handling for traditional non-concurrent approach.

See https://github.com/rambo/python-scpi/tree/master/examples for more.

TODO

Check Carrier-Detect for RS232 transport

in the RS232 transport check getCD to make sure the device is present before doing anything. CTS can also be checked even if hw flow control is not in use.

Basically wait for it for X seconds and abort if not found

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
scpi-2.1.0-py3-none-any.whl (15.5 kB) Copy SHA256 hash SHA256 Wheel py3 Jul 13, 2018
scpi-2.1.0.tar.gz (12.1 kB) Copy SHA256 hash SHA256 Source None Jul 13, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page