Skip to content

Restore simulated instrument state without closing sessions - #252

Open
CAOShurong wants to merge 2 commits into
pyvisa:mainfrom
CAOShurong:feat/reset-simulated-devices
Open

CAOShurong wants to merge 2 commits into
pyvisa:mainfrom
CAOShurong:feat/reset-simulated-devices

Conversation

@CAOShurong

Copy link
Copy Markdown

Add a simulator-only rm.visalib.reset_devices() method for tests that need a clean instrument between runs. Pass a resource name to reset just that device. Open sessions keep their handles and VISA settings, and see the restored device and channel properties immediately. Reset also discards pending messages and errors.

The YAML example from #83 now returns its original value through the same open resource. The full simulator suite passed on Python 3.10–3.13.

Fixes #83.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is there a "reset instrument to defaults from yaml file" function or similar?

1 participant