IEEE488.2#
Every SCPI interface is based on the IEEE488.2 protocol. This Python implementation separates the protocol into two layers:
IEEE488.2 layer: IEEE488.2 layer that implements the protocol based on the transport layer.
Transport layer: Transport layers responsible for lowest level of communication (e.g. Ethernet or dummy).”
IEEE488.2 layer#
Transport layer#
- class IpTransport(host, port=5025, timeout=60.0, snd_buf_size=524288)[source]#
Bases:
TransportClass for data transport of IP socket.
- __init__(host, port=5025, timeout=60.0, snd_buf_size=524288)[source]#
Create IP socket transport class.
- readline()[source]#
Read data from instrument over IP socket.
- Return type:
- Returns:
str String with data.
- class ClusterDummyTransport(dummy_cfg)[source]#
Bases:
DummyTransportClass to replace Cluster device with dummy device to support software stack testing without hardware. The class implements all mandatory, required and Cluster specific SCPI calls. Call responses are largely artificially constructed to be inline with the call’s functionality (e.g. *IDN? returns valid, but artificial IDN data.) To assist development, the Q1ASM assembler has been completely implemented. Please have a look at the call’s implementation to know what to expect from its response.
- __init__(dummy_cfg)[source]#
Create Cluster dummy transport class.
- Parameters:
dummy_cfg (dict) – Dictionary of dummy module types (e.g. Cluster QCM, Cluster QRM). Each key of the dictionary is a slot index with a dummy type specification of type
ClusterType.
- delete_dummy_binned_acquisition_data(slot_idx, sequencer=None, acq_index_name=None)[source]#
Delete all dummy binned acquisition data for the dummy.
- delete_dummy_scope_acquisition_data(slot_idx)[source]#
Delete dummy scope acquisition data for the dummy.
- set_dummy_binned_acquisition_data(slot_idx, sequencer, acq_index_name, data)[source]#
Set dummy binned acquisition data for the dummy.
- Parameters:
slot_idx (int) – Slot of the hardware you want to set the data to on a cluster.
sequencer (int) – Sequencer.
acq_index_name (str) – Acquisition index name.
data (Iterable[Union[DummyBinnedAcquisitionData, None]]) – Dummy data for the binned acquisition. An iterable of all the bin values.
- Return type:
- set_dummy_scope_acquisition_data(slot_idx, data)[source]#
Set dummy scope acquisition data for the dummy.
- Parameters:
slot_idx (int) – Slot of the hardware you want to set the data to on a cluster.
data (DummyScopeAcquisitionData) – Dummy data for the scope acquisition.
- Return type:
Supporting classes and functions#
- class ModuleDummyTransport(dummy_type)[source]#
Bases:
DummyTransportClass to replace a module with a dummy device to support software stack testing without hardware. The class implements all mandatory, required and module specific SCPI calls. Call responses are largely artificially constructed to be inline with the call’s functionality (e.g. *IDN? returns valid, but artificial IDN data.) To assist development, the Q1ASM assembler has been completely implemented. Please have a look at the call’s implementation to know what to expect from its response.
- __init__(dummy_type)[source]#
Create module dummy transport class.
- Parameters:
dummy_type (ClusterType) – Dummy module type
- delete_dummy_binned_acquisition_data(sequencer=None, acq_index_name=None)[source]#
Set dummy binned acquisition data for the dummy.
- delete_dummy_scope_acquisition_data()[source]#
Delete dummy scope acquisition data for the dummy.
- Return type:
- set_dummy_binned_acquisition_data(sequencer, acq_index_name, data)[source]#
Set dummy binned acquisition data for the dummy.
- Parameters:
sequencer (int) – Sequencer.
acq_index_name (str) – Acquisition index name.
data (Iterable[Union[DummyBinnedAcquisitionData, None]]) – Dummy data for the binned acquisition. An iterable of all the bin values.
- Return type:
- set_dummy_scope_acquisition_data(data)[source]#
Set dummy scope acquisition data for the dummy.
- Parameters:
data (DummyScopeAcquisitionData) – Dummy data for the scope acquisition.
- Return type:
- property is_eom_type: bool#
Return if module is of type EOM.
- Returns:
bool True if module is of type EOM.
- property is_linq_type: bool#
Return if module is of type LINQ.
- Returns:
bool True if module is of type LINQ.
- property is_qcm_type: bool#
Return if module is of type QCM.
- Returns:
bool True if module is of type QCM.
- property is_qdm_type: bool#
Return if module is of type QDM.
- Returns:
bool True if module is of type QDM.
- property is_qrc_type: bool#
Return if module is of type QRC.
- Returns:
bool True if module is of type QRC.
- property is_qrm_type: bool#
Return if module is of type QRM.
- Returns:
bool True if module is of type QRM.
- property is_qsm_type: bool#
Return if module is of type QSM.
- Returns:
bool True if module is of type QSM.
- property is_qtm_type: bool#
Return if module is of type QTM.
- Returns:
bool True if module is of type QTM.
- property is_rf_type: bool#
Return if module is of type QCM-RF or QRM-RF.
- Returns:
bool True if module is of type QCM-RF or QRM-RF.
- property module_type: InstrumentType#
Return module type.
- Returns:
InstrumentType Module type.
- class DummyTransport(dummy_type)[source]#
-
Class to replace device with dummy device to support software stack testing without hardware. The class implements all mandatory and required SCPI calls. Call responses are largely artificially constructed to be inline with the call’s functionality (e.g. *IDN? returns valid, but artificial IDN data.)
- __init__(dummy_type)[source]#
Create dummy transport class.
- Parameters:
dummy_type (ClusterType) – Dummy instrument type
- abstract delete_dummy_binned_acquisition_data(sequencer=None, acq_index_name=None)[source]#
Delete all dummy binned acquisition data for the dummy.
- Parameters:
- Raises:
ValueError – If the slot_idx doesn’t make sense for the transport.
- Return type:
- abstract delete_dummy_scope_acquisition_data()[source]#
Delete dummy scope acquisition data for the dummy.
- Raises:
ValueError – If the slot_idx doesn’t make sense for the transport.
- Return type:
- get_cmd_hist()[source]#
Get list of every executed command since the initialization or reset of the class.
- Return type:
- Returns:
list List of executed command strings including arguments (does not include binary data argument).
- abstract set_dummy_binned_acquisition_data(sequencer, acq_index_name, data)[source]#
Set dummy binned acquisition data for the dummy.
- Parameters:
sequencer (int) – Sequencer.
acq_index_name (str) – Acquisition index name.
data (Iterable[Union[DummyBinnedAcquisitionData, None]]) – Dummy data for the binned acquisition. An iterable of all the bin values.
- Raises:
ValueError – If the slot_idx doesn’t make sense for the transport.
- Return type:
- abstract set_dummy_scope_acquisition_data(data)[source]#
Set dummy scope acquisition data for the dummy.
- Parameters:
data (DummyScopeAcquisitionData) – Dummy data for the scope acquisition.
- Raises:
ValueError – If the slot_idx doesn’t make sense for the transport.
- Return type:
- class Transport[source]#
Bases:
objectAbstract base class for data transport to instruments.
- abstract readline()[source]#
Abstract method to read data from instrument.
- Return type:
- Returns:
str String with data.
- class DummyBinnedAcquisitionData(data, thres, avg_cnt)[source]#
Bases:
objectClass to hold data for the dummy hardware for the binned acquisition. This class contains all values for one bin.
- __init__(data, thres, avg_cnt)#