Skip to main content

srsinst.dc205

srsinst.dc205 is a Python package to control the DC205 Voltage source from Stanford Research Systems (SRS).

srsinst.dc205 is based on srsgui, which you do not need to install separately, but is included with this install.

Installation

You need a working Python 3.7 or later with pip (Python package installer) installed. If you don't, install Python to your system.

To install srsinst.dc2052 as an instrument driver , use Python package installer pip from the command line.

python -m pip install srsinst.dc205

To use it as a GUI application, create a virtual environment, if necessary, and install:

python -m pip install srsinst.dc205[full]

Run srsinst.dc205 as GUI application

If the Python Scripts directory is in your PATH environment variable, start the application by typing from the command line:

dc205

If not,

python -m srsinst.dc205

will start the GUI application.

Once running the GUI, you can:

  • Connect to an DC205 from the Instruments menu.
  • Select a task from the Task menu.
  • Press the green arrow to run the selected task.

You can write your own task(s) or modify an existing one and run it from the GUI application, too.

Use srsinst.dc205 as instrument driver

  • Start a Python interpreter, a Jupyter notebook, or an editor of your choice to write a Python script.
  • Import the DC205 class from srsinst.dc205 package.
  • Create an instance of the DC205 and establish a remote connection.

|

C:\>python
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from srsinst.dc205 import DC205
>>> vs = DC205('serial','COM7',115200)
>>> vs.check_id()
('DC205', 's/n20500476', 'ver1.80')

DC205 is comprised of multiple Components, which provides groupings of related commands and class methods. The Component class has a convenience attribute dir to show available attributes and methods in the Python dictionary format.

>>> vs.dir.keys()
dict_keys(['components', 'commands', 'methods'])

DC205 has 5 components that contain remote commands and methods as organized in the Remote Operation chapter of the DC205 Operating and Service Manual.

>>> vs.dir['components'].keys()
dict_keys(['config', 'setting', 'scan', 'setup', 'interface', 'status'])

Configure DC205 components

Let's set the DC205 Configuration.

>>> vs.config.dir
{'components': {},
 'commands': {'voltage_range': ('DictCommand', 'RNGE'),
              'isolation': ('DictCommand', 'ISOL'),
              'remote_sensing': ('DictCommand', 'SENS'),
              'output': ('DictCommand', 'SOUT')},
              'methods': ['set_range', 'enable_output', 'disable_output']}

If a command is a DictCommand instance, it uses mapped keys and values. Use get_command_info() to find out the mapping dictionary information.

>>> vs.config.get_command_info('voltage_range')
{'command class': 'DictCommand',
 'raw remote command': 'RNGE',
 'set_dict': {'range1': 0, 'range10': 1, 'range100': 2},
 'get_dict': {'range1': 0, 'range10': 1, 'range100': 2},
 'index_dict': None
}

The command vs.config.voltage_range encapsulates the raw command 'RNGE' explained in the Setion 4.4.4 of the manual. The token integers (0, 1, and 2) are mapped to the strings ('range1', 'range10', and 'range100')

>>> vs.config.voltage_range
'range1'
>>> vs.config.voltage_range='range10'
>>> print(vs.config.voltage_range)
range10

You can configure other parameters in the similar way.

>>> vs.setting.voltage
0.0
>>> vs.setting.voltage = 0.5
>>> vs.setting.voltage
0.5
>>> vs.config.get_command_info('output')
{'command class': 'DictCommand',
 'raw remote command': 'SOUT',
 'set_dict': {'off': 0, 'on': 1},
 'get_dict': {'off': 0, 'on': 1},
 'index_dict': None
}
>>> vs.config.output
'off'
>>> vs.config.output = 'on'
>>> vs.config.output
'on'

Metadata

Release files for srsinst.dc205 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for srsinst.dc205 0.0.5
File Size Uploaded
srsinst.dc205-0.0.5.tar.gz 11.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for srsinst.dc205 0.0.5
File Interpreter ABI Platform
srsinst.dc205-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 22.2 kB

Release files / srsinst.dc205-0.0.5.tar.gz

Download URL srsinst.dc205-0.0.5.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6d4dc3a9171caa681d51ae2ccf729a7fc52ae10f326b323064d4c8dbd4adb296
BLAKE2b-256 checksum
How to use checksums
19fe0210828e7bb21dcde8f03449d0a5912d6769e513fee9a5b6d59a0958af1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.3

Release files / srsinst.dc205-0.0.5-py3-none-any.whl

Download URL srsinst.dc205-0.0.5-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2dfc9cb301e81d90161f922da72106772ee66752058e90a7bd467ac7d1381712
BLAKE2b-256 checksum
How to use checksums
69937037e527e246da432e99b17c4234f64b9ef892abaa65313ea636e6d16d7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page