qcodes_contrib_drivers.drivers.Spectrum package¶
Subpackages¶
Submodules¶
qcodes_contrib_drivers.drivers.Spectrum.M4i module¶
- class qcodes_contrib_drivers.drivers.Spectrum.M4i.M4i(*args: Any, **kwargs: Any)[source]¶
Bases:
Instrument
- __init__(name, cardid='spcm0', **kwargs)[source]¶
Driver for the Spectrum M4i.44xx-x8 cards.
For more information see: http://spectrum-instrumentation.com/en/m4i-platform-overview
Example
Example usage for acquisition with channel 2 using an external trigger that triggers multiple times with trigger mode HIGH:
m4 = M4i(name='M4i', server_name=None) m4.enable_channels(pyspcm.CHANNEL2) m4.set_channel_settings(2,mV_range, input_path, termination, coupling, compensation) m4.set_ext0_OR_trigger_settings(pyspcm.SPC_TM_HIGH,termination,coupling,level0) calc = m4.multiple_trigger_acquisition(mV_range,memsize,seg_size,posttrigger_size)
Note
Error generated by the card can be retrieved with the method
get_error_info32bit()
. The card can be reset withreset()
. Sometimes when an error occurs (including validation errors) the python console needs to be restarted
- blockavg_hardware_trigger_acquisition(mV_range, nr_averages=10, verbose=0, post_trigger=None)[source]¶
Acquire data using block averaging and hardware triggering
To read out multiple channels, use initialize_channels. This methods updates the external_trigger_mode and trigger_or_mask parameters.
- gated_trigger_acquisition(mV_range, memsize, pretrigger_size, posttrigger_size)[source]¶
doesn’t work completely as expected, it triggers even when the trigger level is set outside of the signal range it also seems to additionally acquire some wrong parts of the wave, but this also exists in SBench6, so it is not a problem caused by this code.
- get_data()[source]¶
Reads measurement data from the digitizer.
The data acquisition must have been started by start_acquisition() or start_triggered().
- Returns:
2D array with voltages per channel in V.
- get_error_info32bit(verbose=False)[source]¶
Read an error from the error register.
- Parameters:
verbose (bool) – If True then print the error message to stdout
- Returns:
errorreg (int) errorvalue (int)
- get_idn()[source]¶
Parse a standard VISA
*IDN?
response into an ID dict.Even though this is the VISA standard, it applies to various other types as well, such as IPInstruments, so it is included here in the Instrument base class.
Override this if your instrument does not support
*IDN?
or returns a nonstandard IDN string. This string is supposed to be a comma-separated list of vendor, model, serial, and firmware, but semicolon and colon are also common separators so we accept them here as well.- Returns:
A dict containing vendor, model, serial, and firmware.
- initialize_channels(channels=None, mV_range=1000, input_path=0, termination=0, coupling=0, compensation=None, memsize=4096, pretrigger_memsize=16, lp_filter=None)[source]¶
Setup channels of the digitizer for simple readout using Parameters
The channels can be read out using the Parameters channel_0, channel_1, …
- Parameters:
channels (list) – list of channels to setup. mV_range, input_path, termination, coupling, compensation. Passed to the set_channel_settings function
memsize (int) – memory size to use for simple channel readout
pretrigger_memsize (int) – Pretrigger memory size to use. The default value used is 16, which is the smallest value possible.
- multiple_trigger_acquisition(mV_range, memsize, seg_size, posttrigger_size)[source]¶
Acquire traces with the SPC_REC_STD_MULTI mode
This method does not update the triggering properties.
- retrieve_data(trace)[source]¶
Retrieve data from the digitizer
The data acquisition must have been started by start_acquisition.
- Parameters:
trace (dict) – dictionary with acquisition settings.
- Returns:
voltages (array)
- set_channel_OR_trigger_settings(i, trig_mode, bitlevel0, bitlevel1=None)[source]¶
When a channel is used for triggering it must be enabled during the acquisition.
- set_channel_settings(channel_index, mV_range, input_path, termination, coupling, compensation=None, lp_filter=None)[source]¶
Update settings of the specified channel
- Parameters:
channel_index (int) – channel to update
mV_range (float) – measurement range for the channel (buffered path: 200, 500, 1000, 2000, 5000, or 10000) (HF path: 500, 1000, 2500, or 5000)
input_path (int) – input path (0: default/buffered; 1: HF/50 Ohm)
termination (None or int) – If None, then do not update the termination (0: 1 MOhm; 1: 50 Ohm)
coupling (None or int) – Set the ACDC_coupling.If None, then do not update the coupling (0: DC; 1 AC)
compensation (None or int) – If None, then do not update the compensation (0: off, 1: off)
lp_filter (Optional[int]) – enable (1) or disable (0) the 20 MHz low pass filter
- set_ext0_OR_trigger_settings(trig_mode, termination, coupling, level0, level1=None)[source]¶
Configures ext0 trigger
- Parameters:
trig_mode – 0: None, 1: Positive edge, 2: Negative edge, 4: Both, 8: High, 16: Low, 32: Enter window, 64: Leave window, 128: Inside window, 256: Outside window, 0x01000001: Positive + re-arm, 0x01000002: Negative + re-arm
termination – input termination 0: 1 MOhm, 1: 50 Ohm
coupling – DC/AC input coupling (0: DC, 1: AC)
level0 – trigger level [mV]
level1 – 2nd level for re-arm and windowed modes. [mV]
- setup_multi_recording(posttrigger_size, n_triggers=1, pretrigger_size=None, boxcar_average=False)[source]¶
Setup multi recording.
Triggering must have been configured separately. Data acquisition must started with start_triggered(). The collected data can be acquired with the function get_data().
- Parameters:
Example
digitizer.setup_multi_recording(size, n_triggers) digitizer.start_triggered() data = digitizer.get_data() # do another measurement with same settings digitizer.start_triggered() data = digitizer.get_data()
- single_software_trigger_acquisition(mV_range, memsize, posttrigger_size)[source]¶
Acquire a single data trace
- single_software_trigger_acquisition_boxcar(mV_range, memsize, posttrigger_size)[source]¶
Acquire a single data trace with boxcar averaging
- single_trigger_acquisition(mV_range, memsize, posttrigger_size)[source]¶
Acquire traces with the SPC_REC_STD_SINGLE mode
This method does not update the triggering properties.