Skip to main content

Instrument driver package for the CS580 Voltage Controlled Current Source from Stanford Research Systems

Project description

srsinst.cs580

srsinst.cs580 is a Python package to control Stanford Research Systems (SRS) CS580 Voltage Controlled Current Source.

Installation

You need a working Python 3.7 or later with pip installed.

To install srsinst.cs580 as an instrument driver, use pip from the command line:

python -m pip install srsinst.cs580

Use srsinst.cs580 as instrument driver

from srsinst.cs580 import CS580

cs580 = CS580('serial', 'COM3')
cs580.check_id()

# Configure
cs580.config.gain = '1uA'          # 1 uA/V gain
cs580.config.isolation = 'float'   # floating output
cs580.config.shield = 'return'     # inner shield to return
cs580.settings.voltage = 10.0      # 10 V compliance limit
cs580.settings.current = 1e-6      # 1 uA DC current

# Enable output
cs580.config.output = True

# Check status
print(cs580.get_status())
print('Overload:', cs580.status.overload)

# Disable output and reset
cs580.config.output = False
cs580.reset()

See test_cs580.py for a full set of examples excercising all of the CS580 commands and methods.

CS580 is built on srsgui.

Components

Attribute Class Description
cs580.config Configuration Gain, input, speed, shield, isolation, output
cs580.settings Settings DC current, compliance voltage
cs580.setup Setup Audible alarms
cs580.interface Interface IDN, token mode, operation complete
cs580.status Status Overload, status registers, error codes

Remote interface

The CS580 communicates via RS-232 at a fixed 9600 baud, 8-bit, no parity, no flow control. Isolated connectivity to GPIB, RS-232, and Ethernet is available through the SX199 Optical Interface Controller (not yet implemented in this driver).

Running the integration tests

The test suite exercises every driver command and method against a live CS580 over RS-232. pytest must be installed:

pip install pytest

Connect the CS580 to the PC via RS-232, then run:

pytest -v -s tests/ --port COM3

Replace COM3 with the actual COM port. The -s flag is required so the confirmation prompt is visible in the terminal.

If --port is omitted you will be prompted to enter the port interactively. Either way, a confirmation prompt is shown before any commands are sent to the instrument, giving you a chance to verify the connection first.

Note: These tests require physical hardware. All 98 tests should pass against a normally functioning CS580. Unexpected failures most likely indicate a driver issue rather than an instrument fault.

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

srsinst_cs580-0.2.3.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

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

srsinst_cs580-0.2.3-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file srsinst_cs580-0.2.3.tar.gz.

File metadata

  • Download URL: srsinst_cs580-0.2.3.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for srsinst_cs580-0.2.3.tar.gz
Algorithm Hash digest
SHA256 c431beda847f3ed3509caeaa1e9d69102ba97f5811f12f14be89079c162e0540
MD5 256ae2f57202a803653c4c9e07e29b72
BLAKE2b-256 a4b1012b794c14db78f105d090944ce6f2c09f51ecf258f0fc61f4b9e79d1e6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for srsinst_cs580-0.2.3.tar.gz:

Publisher: python-publish.yml on thinkSRS/srsinst.cs580

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file srsinst_cs580-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: srsinst_cs580-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for srsinst_cs580-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 18f09fc85537d22ec86b1d8132601ef6027834ab5f376c02418ce4e7c0006fb2
MD5 d281583da5b46f389ee01b0fac931211
BLAKE2b-256 91d5d95e4d191efe73ef6224f1797bc6b924ef3e78e4cfbc14e0944082df5d92

See more details on using hashes here.

Provenance

The following attestation bundles were made for srsinst_cs580-0.2.3-py3-none-any.whl:

Publisher: python-publish.yml on thinkSRS/srsinst.cs580

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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