herosdevices.core.bus.visa¶
Primitive functions and classes representing visa connections.
Module Contents¶
- herosdevices.core.bus.visa.pyvisa = None¶
- class herosdevices.core.bus.visa.VisaConnection(resource: str, keep_alive: bool = True, **kwargs)[source]¶
A class to manage VISA communication connections.
This class provides functionality to handle visa connections including opening/closing connections, reading data, and writing data.
- Parameters:
resource – The resource name of the visa instrument (e.g.
TCPIP::my_device_hostname::INSTR).keep_alive – Flag indicating whether to keep the connection open between operations.
**kwargs – Keyword arguments passed to
pyvisa.open_resource
- resource: str¶
- connection: pyvisa.resources.MessageBasedResource | None = None¶
- keep_alive = True¶
- operation() collections.abc.Iterator[None][source]¶
Context manager for handling visa connection operations.
Ensures the visa connection is open before performing operations and closes it afterward if
self.keep_aliveis False.- Yields:
Yields control back to the caller for performing operations within the context.