{"id":24543,"library":"rsinstrument","title":"Rohde & Schwarz Instrument Control (RsInstrument)","description":"RsInstrument is a Python communication module for Rohde & Schwarz instruments using VISA or socket connections. It provides a high-level API for SCPI command control, data transfer, and instrument discovery. Current version is 1.124.0, requiring Python >= 3.10. The library is actively maintained with regular releases.","status":"active","version":"1.124.0","language":"python","source_language":"en","source_url":"https://github.com/Rohde-Schwarz/RsInstrument","tags":["scpi","instrument-control","rohde-schwarz","visa","socket"],"install":[{"cmd":"pip install rsinstrument","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for VISA connectivity","package":"pyvisa","optional":true},{"reason":"VISA backend for RsInstrument","package":"pyvisa-py","optional":true}],"imports":[{"note":"","wrong":"","symbol":"RsInstrument","correct":"from RsInstrument import RsInstrument"}],"quickstart":{"code":"from RsInstrument import RsInstrument\nimport os\n\nresource_string = os.environ.get('INSTR_RESOURCE', 'TCPIP::192.168.1.1::INSTR')\ninstr = RsInstrument(resource_string)\nprint(instr.query('*IDN?'))\ninstr.close()","lang":"python","description":"Initialize an instrument connection and query its identification."},"warnings":[{"fix":"Install pyvisa-py and set RsInstrument(resource, backend='pyvisa-py') or reinstall the legacy 'rs' backend.","message":"Version 1.100.0 changed the default VISA backend from 'rs' to 'pyvisa-py'. Existing scripts using the old backend must specify it explicitly.","severity":"breaking","affected_versions":">=1.100.0"},{"fix":"Use separate instrument instances per thread or implement proper mutex/lock.","message":"The library is not thread-safe. Do not share an RsInstrument instance across threads without external locking.","severity":"gotcha","affected_versions":"all"},{"fix":"Use format like 'TCPIP::192.168.1.1::INSTR' or 'USB::0x0AAD::0x0119::INSTR'. Validate with instr.utilities.check_resource_string()","message":"Resource strings must strictly follow VISA Resource Regular Expression pattern. Incorrect strings cause immediate connection failure.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `instr.visa_timeout = 5000` instead of `instr.io.timeout = 5000`.","message":"The method `instr.io.timeout` setter is deprecated in favor of `instr.visa_timeout`.","severity":"deprecated","affected_versions":">=1.50.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from RsInstrument import RsInstrument` to import the class.","cause":"Incorrect import statement; typically `import RsInstrument` then trying to use RsInstrument.RsInstrument","error":"AttributeError: module 'RsInstrument' has no attribute 'RsInstrument'"},{"fix":"Increase timeout: `instr.visa_timeout = 10000` (ms) or check instrument connection.","cause":"Timeout is too low or the instrument is not responding.","error":"VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed."},{"fix":"Upgrade to latest version: `pip install --upgrade rsinstrument`","cause":"Using an older version of RsInstrument (<1.0) that doesn't accept the 'backend' parameter.","error":"TypeError: __init__() got an unexpected keyword argument 'backend'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}