VisaDriver#
- class VisaDriver(visa_resource: str | VisaConfig)[source]#
Bases:
TransportBaseTransport for VISA-attached instruments. Composed by concrete drivers, not extended.
Supports shared ownership: a device serving several categories holds one connection for all of them, passing each category view as the holder to
open()/close(), and it closes only when the last owner closes it. Thread-safe at the I/O level via an internal lock; uselock()to keep a multi-step VISA sequence atomic.Construct from a VISA resource string (uses defaults) or a full
VisaConfig.
Attributes
Whether the underlying VISA resource is currently open. |
Methods
VISA device clear — aborts any pending operation. |
|
Close and teardown; with a holder, remove it and tear down only when the last owner leaves. |
|
Return the reentrant resource lock for atomic multi-step sequences; the holder may write/query/read inside it. |
|
Open the connection (idempotent); with a holder, admit it and return True only for the first owner. |
|
Write |
|
Send |
|
Write |
|
Read a response, stripping the configured read terminator. |
|
Read raw bytes from the instrument. |
|
Hold the lock and override the operation timeout to |
|
Write |
|
Write raw bytes verbatim. |