PyVISA-sim is a Python library that provides a simulated backend for PyVISA, allowing users to develop and test instrument control applications without needing physical hardware. It supports common resource types like TCPIP, GPIB, RS232, and USB, mimicking their behavior. The current version is 0.7.1, released on 2024-05-13, and it follows a regular, active release cadence.
pip install pyvisa-simVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize PyVISA with the simulated backend, list available simulated resources, open a default simulated USB instrument, perform basic SCPI write and read operations, and properly close the instrument and resource manager.
Ensure `pyvisa` is installed: `pip install pyvisa`.
Always initialize your resource manager with `rm = pyvisa.ResourceManager('@sim')`.For specific instrument models or complex scenarios, consult the `pyvisa-sim` documentation on how to customize or extend the simulated instrument behavior.
Check `rm.list_resources()` to see available resources. For custom resources, configure `pyvisa-sim` with a custom YAML file or by registering resources programmatically.
Install `pyvisa-sim` using `pip install pyvisa-sim`. Verify the backend string is exactly `'@sim'` when creating the resource manager.
`pyvisa-sim` acts as a backend for `pyvisa`. Most user interaction should be via `pyvisa.ResourceManager('@sim')` and standard PyVISA methods, not by importing symbols directly from `pyvisa_sim`.