hvl_ccb.dev.visa¶
-
class
VisaDevice
(com: Union[hvl_ccb.comm.visa.VisaCommunication, hvl_ccb.comm.visa.VisaCommunicationConfig, dict], dev_config: Optional[Union[hvl_ccb.dev.visa.VisaDeviceConfig, dict]] = None)[source]¶ Bases:
hvl_ccb.dev.base.SingleCommDevice
Device communicating over the VISA protocol using VisaCommunication.
-
static
config_cls
()[source]¶ Return the default configdataclass class.
- Returns
a reference to the default configdataclass class
-
static
default_com_cls
() → Type[hvl_ccb.comm.visa.VisaCommunication][source]¶ Return the default communication protocol for this device type, which is VisaCommunication.
- Returns
the VisaCommunication class
-
get_identification
() → str[source]¶ Queries “*IDN?” and returns the identification string of the connected device.
- Returns
the identification string of the connected device
-
spoll_handler
()[source]¶ Reads the status byte and decodes it. The status byte STB is defined in IEEE 488.2. It provides a rough overview of the instrument status.
- Returns
-
stop
() → None[source]¶ Stop the VisaDevice. Stops the polling thread and closes the communication protocol.
- Returns
-
wait_operation_complete
(timeout: Optional[float] = None) → bool[source]¶ Waits for a operation complete event. Returns after timeout [s] has expired or the operation complete event has been caught.
- Parameters
timeout – Time in seconds to wait for the event; None for no timeout.
- Returns
True, if OPC event is caught, False if timeout expired
-
static
-
class
VisaDeviceConfig
(spoll_interval: Union[int, float] = 0.5, spoll_start_delay: Union[int, float] = 2)[source]¶ Bases:
hvl_ccb.dev.visa._VisaDeviceConfigDefaultsBase
,hvl_ccb.dev.visa._VisaDeviceConfigBase
Configdataclass for a VISA device.
-
force_value
(fieldname, value)¶ Forces a value to a dataclass field despite the class being frozen.
NOTE: you can define post_force_value method with same signature as this method to do extra processing after value has been forced on fieldname.
- Parameters
fieldname – name of the field
value – value to assign
-
classmethod
keys
() → Sequence[str]¶ Returns a list of all configdataclass fields key-names.
- Returns
a list of strings containing all keys.
-
classmethod
optional_defaults
() → Dict[str, object]¶ Returns a list of all configdataclass fields, that have a default value assigned and may be optionally specified on instantiation.
- Returns
a list of strings containing all optional keys.
-
classmethod
required_keys
() → Sequence[str]¶ Returns a list of all configdataclass fields, that have no default value assigned and need to be specified on instantiation.
- Returns
a list of strings containing all required keys.
-