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.

Source Distribution

scpi-2.1.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scpi-2.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file scpi-2.1.0.tar.gz.

File metadata

  • Download URL: scpi-2.1.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for scpi-2.1.0.tar.gz
Algorithm Hash digest
SHA256 c236a9325aedac81cd08027eb18485c2c8448162f3a4dffb93196615914d2055
MD5 f42f5629f2d077f188ec103b7475b511
BLAKE2b-256 39bba7b9b5ab2409d5110f64869a2d38f4bb204a29e904067fb64159fe2ed272

See more details on using hashes here.

File details

Details for the file scpi-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: scpi-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for scpi-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9cd07443b7d77bf8ef6beb1439d77c314068a44a3f99f84ea86cc674b81a7b1
MD5 225528ee241565432f95b8988107981d
BLAKE2b-256 e83771320aa700524e2b3bfa1188c0f09d5d3a3aaaf467e37b7750e5067b5d82

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page