Skip to content

Commit

Permalink
Merge pull request #1302 from liambeguin/pyvisa-sim
Browse files Browse the repository at this point in the history
driver/pyvisadriver: add optional backend property
  • Loading branch information
jluebbe committed Mar 20, 2024
2 parents d8835d5 + a89eb64 commit 51ea81f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,7 @@ Arguments:
ASRL, TCPIP...
- url (str): device identifier on selected resource, e.g. <ip> for TCPIP
resource
- backend (str): Visa library backend, e.g. '@sim' for pyvisa-sim backend

Used by:
- `PyVISADriver`_
Expand Down
2 changes: 1 addition & 1 deletion labgrid/driver/pyvisadriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PyVISADriver(Driver):
def __attrs_post_init__(self):
super().__attrs_post_init__()
_py_pyvisa_module = import_module('pyvisa')
self._pyvisa_resource_manager = _py_pyvisa_module.ResourceManager()
self._pyvisa_resource_manager = _py_pyvisa_module.ResourceManager(self.pyvisa_resource.backend)
self.pyvisa_device = None

def on_activate(self):
Expand Down
2 changes: 2 additions & 0 deletions labgrid/resource/pyvisa.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class PyVISADevice(Resource):
Args:
type (str): device resource type following the pyVISA resource syntax, e.g. ASRL, TCPIP...
url (str): device identifier on selected resource, e.g. <ip> for TCPIP resource
backend (str, default=''): Visa library backend, e.g. '@sim' for pyvisa-sim backend
"""
type = attr.ib(validator=attr.validators.instance_of(str))
url = attr.ib(validator=attr.validators.instance_of(str))
backend = attr.ib(default='', validator=attr.validators.instance_of(str))

0 comments on commit 51ea81f

Please sign in to comment.