Skip to content

Use URNs to reference instrument models #102

Description

@arnobaer

This is a proposal for using URNs (Uniform Resource Names) to create drivers and running emulators in a unified way, eg. urn:comet:model:keithley:2410 instead of referencing Python module names like keithley.k2410.

Proposed URN format:

urn:comet:model:<vendor>:<model>

Example usage

import pyvisa
from comet.driver import driver_factory

rm = pyvisa.ResourceManager("@py)

with rm.open_resource("...") as res:
    instr = driver_factory("urn:comet:model:keithley:2410")(res)
    instr.identify()
from comet.station import Station

config = {"instruments":
    "smu": {"model": "urn:comet:model:keithley:2470", ...},
    "laser": {"model": "urn:comet:model:nkt_photonics:pilas", ...},
}
with Station.from_config(config) as station:
    station.smu.identify()
    station.laser.identify()

Example emulator configuration

emulators:
  dmm:
    model: urn:comet:model:keithley:2700
    port: 11002
    termination: "\n"
  stage:
    model: urn:comet:model:itk:corvustt
    port: 11003
  laser:
    model: urn:comet:model:nkt_photonics:pilas
    port: 11004

Note: for an all-numeric model name the Python module and it's class must be prefixed with the first character of the vendor name (eg. resolve urn:comet:model:keithley:2410 to module keithley.k2410 and class K2410).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions