Qudi
|
Hardware class to control the PulseBlasterESR-PRO card from SpinCore. More...
Public Member Functions | |
def | __init__ (self, kwargs) |
def | on_activate (self) |
Initialization performed during activation of the module. More... | |
def | on_deactivate (self) |
Deinitialization performed during deactivation of the module. More... | |
def | check (self, func_val) |
Check routine for the received error codes. More... | |
def | get_error_string (self) |
Return the most recent error string. More... | |
def | count_boards (self) |
Return the number of SpinCore boards present in your system. More... | |
def | select_board (self, board_num=0) |
Select the proper SpinCore card, if multiple are present. More... | |
def | set_debug_mode (self, value) |
Set the debug mode. More... | |
def | get_debug_mode (self) |
Retrieve whether debug mode is set. More... | |
def | get_version (self) |
Get the version date of this library. More... | |
def | get_firmware_id (self) |
Gets the current version of the SpinPTS API being used. More... | |
def | start (self) |
Send a software trigger to the board. More... | |
def | stop (self) |
Stops output of board. More... | |
def | reset_device (self) |
Stops the output of board and resets the PulseBlaster Core. More... | |
def | open_connection (self) |
Initializes the board. More... | |
def | close_connection (self) |
End communication with the board. More... | |
def | start_programming (self) |
Tell the board to start programming one of the onboard devices. More... | |
def | stop_programming (self) |
Finishes the programming for a specific onboard devices. More... | |
def | get_status_bit (self) |
Read status from the board. More... | |
def | get_status_message (self) |
Read status message from the board. More... | |
def | write_pulse_form (self, sequence_list, loop=True) |
The higher level function, which creates the actual sequences. More... | |
def | activate_channels (self, ch_list, length=100e-9, immediate_start=True) |
Set specific channels to high, all others to low. More... | |
def | getNumberOfSwitches (self) |
Gives the number of switches connected to this hardware. More... | |
def | getSwitchState (self, switch_num) |
Gives state of switch. More... | |
def | getCalibration (self, switch_num, switch_state) |
Get calibration parameter for switch. More... | |
def | setCalibration (self, switch_num, switch_state, value) |
Set calibration parameter for switch. More... | |
def | switchOn (self, switch_num) |
Switch on. More... | |
def | switchOff (self, switch_num) |
Switch off. More... | |
def | getSwitchTime (self, switch_num) |
Give switching time for switch. More... | |
def | get_constraints (self) |
Retrieve the hardware constrains from the Pulsing device. More... | |
def | pulser_on (self) |
Switches the pulsing device on. More... | |
def | pulser_off (self) |
Switches the pulsing device off. More... | |
def | load_waveform (self, load_dict) |
Loads a waveform to the specified channel of the pulsing device. More... | |
def | load_sequence (self, sequence_name) |
Loads a sequence to the channels of the device in order to be ready for playback. More... | |
def | get_loaded_assets (self) |
Retrieve the currently loaded asset names for each active channel of the device. More... | |
def | clear_all (self) |
Clears all loaded waveforms from the pulse generators RAM/workspace. More... | |
def | get_status (self) |
Retrieves the status of the pulsing hardware. More... | |
def | get_sample_rate (self) |
Get the sample rate of the pulse generator hardware. More... | |
def | set_sample_rate (self, sample_rate) |
Set the sample rate of the pulse generator hardware. More... | |
def | get_analog_level (self, amplitude=None, offset=None) |
Retrieve the analog amplitude and offset of the provided channels. More... | |
def | set_analog_level (self, amplitude=None, offset=None) |
Set amplitude and/or offset value of the provided analog channel(s). More... | |
def | get_digital_level (self, low=None, high=None) |
Retrieve the digital low and high level of the provided/all channels. More... | |
def | set_digital_level (self, low=None, high=None) |
Set low and/or high value of the provided digital channel. More... | |
def | get_active_channels (self, ch=None) |
Get the active channels of the pulse generator hardware. More... | |
def | set_active_channels (self, ch=None) |
Set the active channels for the pulse generator hardware. More... | |
def | write_waveform (self, name, analog_samples, digital_samples, is_first_chunk, is_last_chunk, total_number_of_samples) |
Write a new waveform or append samples to an already existing waveform on the device memory. More... | |
def | write_sequence (self, name, sequence_parameters) |
Write a new sequence on the device memory. More... | |
def | get_waveform_names (self) |
Retrieve the names of all uploaded waveforms on the device. More... | |
def | get_sequence_names (self) |
Retrieve the names of all uploaded sequence on the device. More... | |
def | delete_waveform (self, waveform_name) |
Delete the waveform with name "waveform_name" from the device memory. More... | |
def | delete_sequence (self, sequence_name) |
Delete the sequence with name "sequence_name" from the device memory. More... | |
def | get_interleave (self) |
Check whether Interleave is ON or OFF in AWG. More... | |
def | set_interleave (self, state=False) |
Turns the interleave of an AWG on or off. More... | |
def | reset (self) |
Reset the device. More... | |
def | has_sequence_mode (self) |
Asks the pulse generator whether sequence mode exists. More... | |
![]() | |
def | __init__ (self, manager, name, config=None, callbacks=None, kwargs) |
Initialise Base class object and set up its state machine. More... | |
def | log (self) |
Returns a logger object. | |
def | is_module_threaded (self) |
Returns whether the module shall be started in a thread. | |
def | on_activate (self) |
Method called when module is activated. More... | |
def | on_deactivate (self) |
Method called when module is deactivated. More... | |
def | getStatusVariables (self) |
Return a dict of variable names and their content representing the module state for saving. More... | |
def | setStatusVariables (self, variableDict) |
Give a module a dict of variable names and their content representing the module state. More... | |
def | getConfiguration (self) |
Return the configration dictionary for this module. More... | |
def | get_connector (self, connector_name) |
Return module connected to the given named connector. More... | |
![]() | |
def | __new__ (cls, name, bases, attrs) |
Collect declared Connectors, ConfigOptions and StatusVars into dictionaries. More... | |
Public Attributes | |
threadlock | |
GRAN_MIN | |
LEN_MIN | |
SAMPLE_RATE | |
channel_states | |
![]() | |
module_state | |
connectors | |
Hardware class to control the PulseBlasterESR-PRO card from SpinCore.
This file is compatible with the PCI version SP18A of the PulseBlasterESR. The wrapped commands based on the 'spinapi.h' and the 'pulseblaster.h' header file and can be looked up in the SpinAPI Documentation (Version 2013-09-25) on the website:
http://www.spincore.com/support/spinapi/reference/production/2013-09-25/index.html
The recommended version for the manual is the PDF file from SpinCore: http://www.spincore.com/CD/PulseBlasterESR/SP4/PBESR-Pro_Manual.pdf
Another manual describes the functions a bit better: http://spincore.com/CD/PulseBlasterESR/SP1/PBESR_Manual.pdf
The SpinCore programming library (spinapi.dll, spinapi64.dll, libspinapi.so or libspinapi64.so) is written in C and its data types correspond to standard C/C++ data types as follows:
char 8 bit, byte (or characters in ASCII) short int 16 bit signed integer unsigned short int 16 bit unsigned integer int 32 bit signed integer long int 32 bit signed integer unsigned int 32 bit unsigned integer unsigned long int 32 bit unsigned integer float 32 bit floating point number double 64 bit floating point number
Example config for copy-paste:
pulseblaster:
module 'spincore.pulse_blaster_esrpro.PulseBlasterESRPRO' clock_frequency 500e6 # in Hz min_instr_len 5 # number of clock cycles for minimal instruction debug_mode False # optional, to set the debug mode on or off. use_smart_pulse_creation False # optinal, default is false, try to
#library_file: 'spinapi64.dll' # optional, name of the library file
Remark to the config values: library_file if the library does not lay in the default directory of your OS (for windows it is 'C:/Windows/System32'), then you need to specify the path. clock_frequency the Spincore board contains a oscillator crystal, which is attached to it and whose value cannot be determined by the hardware. This number should be specified on the board. The PulseBlasterESR-PRO can have the values [300e6, 400e6, 500e6]. Select the correct one! min_instr_len number of clock cycles for minimal instruction, default is 5. Normally it is 5 but for some boards it is 6 or for old boards it might be even 7. This corresponds to a minimal instruction length of (1/clock_frequency)*min_instr_len channel_delays Specify the delay of some channels to correct it automatically by this module. For example : channel_delays: '0': 200-9 '2': 500-9 tell the card the line 0 and 2 have a delay of 200 ns and 500 ns respectively so that the pulse are emitted sooner relatively to other channels. The first line is 0 and the last is 20.
def pulse_blaster_esrpro.PulseBlasterESRPRO.activate_channels | ( | self, | |
ch_list, | |||
length = 100e-9 , |
|||
immediate_start = True |
|||
) |
Set specific channels to high, all others to low.
list | ch_list: the list of active channels like e.g. [0,4,7]. Note that the channels start from 0. Note, an empty list will set all channels to low. |
int | length: optional, length of the activated channel output in s. Since there will be no switching of channels within this mode, the length of the pulsing time can be chosen arbitrary. Here 100e-9s is the default value. A larger number does not make a lot of sense. |
bool | immediate_start: optional, indicate whether output should directly be switch on, default is True. |
This is a high level command mostly used not for pulsing but just rather for switching something on or off.
def pulse_blaster_esrpro.PulseBlasterESRPRO.check | ( | self, | |
func_val | |||
) |
Check routine for the received error codes.
int | func_val: return error code of the called function. |
Each called function in the dll has an 32-bit return integer, which indicates, whether the function was called and finished successfully (then func_val = 0) or if any error has occurred (func_val < 0).
def pulse_blaster_esrpro.PulseBlasterESRPRO.clear_all | ( | self | ) |
Clears all loaded waveforms from the pulse generators RAM/workspace.
def pulse_blaster_esrpro.PulseBlasterESRPRO.close_connection | ( | self | ) |
End communication with the board.
This is generally called as the last line in a program. Once this is called, no further communication can take place with the board unless the board is reinitialized with pb_init(). However, any pulse program that is loaded and running at the time of calling this function will continue to run indefinitely.
def pulse_blaster_esrpro.PulseBlasterESRPRO.count_boards | ( | self | ) |
Return the number of SpinCore boards present in your system.
def pulse_blaster_esrpro.PulseBlasterESRPRO.delete_sequence | ( | self, | |
sequence_name | |||
) |
Delete the sequence with name "sequence_name" from the device memory.
str | sequence_name: The name of the sequence to be deleted Optionally a list of sequence names can be passed. |
def pulse_blaster_esrpro.PulseBlasterESRPRO.delete_waveform | ( | self, | |
waveform_name | |||
) |
Delete the waveform with name "waveform_name" from the device memory.
str | waveform_name: The name of the waveform to be deleted Optionally a list of waveform names can be passed. |
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_active_channels | ( | self, | |
ch = None |
|||
) |
Get the active channels of the pulse generator hardware.
list | ch: optional, if specific analog or digital channels are needed to be asked without obtaining all the channels. |
Example for an possible input (order is not important):
ch = ['a_ch2', 'd_ch2', 'a_ch1', 'd_ch5', 'd_ch1']
then the output might look like
{'a_ch2': True, 'd_ch2': False, 'a_ch1': False, 'd_ch5': True, 'd_ch1': False}
If no parameter (or None) is passed to this method all channel states will be returned.
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_analog_level | ( | self, | |
amplitude = None , |
|||
offset = None |
|||
) |
Retrieve the analog amplitude and offset of the provided channels.
list | amplitude: optional, if the amplitude value (in Volt peak to peak, i.e. the full amplitude) of a specific channel is desired. |
list | offset: optional, if the offset value (in Volt) of a specific channel is desired. |
If nothing (or None) is passed then the levels of all channels will be returned. If no analog channels are present in the device, return just empty dicts.
Example of a possible input:
amplitude = ['a_ch1', 'a_ch4'], offset = None
to obtain the amplitude of channel 1 and 4 and the offset of all channels
{'a_ch1': -0.5, 'a_ch4': 2.0} {'a_ch1': 0.0, 'a_ch2': 0.0, 'a_ch3': 1.0, 'a_ch4': 0.0}
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_constraints | ( | self | ) |
Retrieve the hardware constrains from the Pulsing device.
Provides all the constraints (e.g. sample_rate, amplitude, total_length_bins, channel_config, ...) related to the pulse generator hardware to the caller.
SEE PulserConstraints CLASS IN pulser_interface.py FOR AVAILABLE CONSTRAINTS!!!
If you are not sure about the meaning, look in other hardware files to get an impression. If still additional constraints are needed, then they have to be added to the PulserConstraints class.
Each scalar parameter is an ScalarConstraints object defined in core.util.interfaces. Essentially it contains min/max values as well as min_step_size, default_value and unit of the parameter.
PulserConstraints.activation_config differs, since it contain the channel configuration/activation information of the form:
{<descriptor_str>: <channel_set>, <descriptor_str>: <channel_set>, ...}
If the constraints cannot be set in the pulsing hardware (e.g. because it might have no sequence mode) just leave it out so that the default is used (only zeros).
constraints = PulserConstraints()
constraints.sample_rate.min = 10.0e6 constraints.sample_rate.max = 12.0e9 constraints.sample_rate.step = 10.0e6 constraints.sample_rate.default = 12.0e9
constraints.a_ch_amplitude.min = 0.02 constraints.a_ch_amplitude.max = 2.0 constraints.a_ch_amplitude.step = 0.001 constraints.a_ch_amplitude.default = 2.0
constraints.a_ch_offset.min = -1.0 constraints.a_ch_offset.max = 1.0 constraints.a_ch_offset.step = 0.001 constraints.a_ch_offset.default = 0.0
constraints.d_ch_low.min = -1.0 constraints.d_ch_low.max = 4.0 constraints.d_ch_low.step = 0.01 constraints.d_ch_low.default = 0.0
constraints.d_ch_high.min = 0.0 constraints.d_ch_high.max = 5.0 constraints.d_ch_high.step = 0.01 constraints.d_ch_high.default = 5.0
constraints.waveform_length.min = 80 constraints.waveform_length.max = 64800000 constraints.waveform_length.step = 1 constraints.waveform_length.default = 80
constraints.waveform_num.min = 1 constraints.waveform_num.max = 32000 constraints.waveform_num.step = 1 constraints.waveform_num.default = 1
constraints.sequence_num.min = 1 constraints.sequence_num.max = 8000 constraints.sequence_num.step = 1 constraints.sequence_num.default = 1
constraints.subsequence_num.min = 1 constraints.subsequence_num.max = 4000 constraints.subsequence_num.step = 1 constraints.subsequence_num.default = 1
constraints.repetitions.min = 0 constraints.repetitions.max = 65539 constraints.repetitions.step = 1 constraints.repetitions.default = 0
constraints.event_triggers = ['A', 'B'] constraints.flags = ['A', 'B', 'C', 'D']
constraints.sequence_steps.min = 0 constraints.sequence_steps.max = 8000 constraints.sequence_steps.step = 1 constraints.sequence_steps.default = 0
activation_conf = OrderedDict() activation_conf['yourconf'] = {'a_ch1', 'd_ch1', 'd_ch2', 'a_ch2', 'd_ch3', 'd_ch4'} activation_conf['different_conf'] = {'a_ch1', 'd_ch1', 'd_ch2'} activation_conf['something_else'] = {'a_ch2', 'd_ch3', 'd_ch4'} constraints.activation_config = activation_conf
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_debug_mode | ( | self | ) |
Retrieve whether debug mode is set.
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_digital_level | ( | self, | |
low = None , |
|||
high = None |
|||
) |
Retrieve the digital low and high level of the provided/all channels.
list | low: optional, if the low value (in Volt) of a specific channel is desired. |
list | high: optional, if the high value (in Volt) of a specific channel is desired. |
If nothing (or None) is passed then the levels of all channels are being returned. If no digital channels are present, return just an empty dict.
Example of a possible input:
low = ['d_ch1', 'd_ch4']
to obtain the low voltage values of digital channel 1 an 4. A possible answer might be
{'d_ch1': -0.5, 'd_ch4': 2.0} {'d_ch1': 1.0, 'd_ch2': 1.0, 'd_ch3': 1.0, 'd_ch4': 4.0}
Since no high request was performed, the high values for ALL channels are returned (here 4).
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_error_string | ( | self | ) |
Return the most recent error string.
Anytime a function (such as pb_init(), pb_start_programming(), etc.) encounters an error, this function will return a description of what went wrong.
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_firmware_id | ( | self | ) |
Gets the current version of the SpinPTS API being used.
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_interleave | ( | self | ) |
Check whether Interleave is ON or OFF in AWG.
Will always return False for pulse generator hardware without interleave.
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_loaded_assets | ( | self | ) |
Retrieve the currently loaded asset names for each active channel of the device.
The returned dictionary will have the channel numbers as keys. In case of loaded waveforms the dictionary values will be the waveform names. In case of a loaded sequence the values will be the sequence name appended by a suffix representing the track loaded to the respective channel (i.e. '<sequence_name>_1').
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_sample_rate | ( | self | ) |
Get the sample rate of the pulse generator hardware.
Do not return a saved sample rate from an attribute, but instead retrieve the current sample rate directly from the device.
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_sequence_names | ( | self | ) |
Retrieve the names of all uploaded sequence on the device.
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_status | ( | self | ) |
Retrieves the status of the pulsing hardware.
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_status_bit | ( | self | ) |
Read status from the board.
Not all boards support this, see your manual. Each bit of the returned integer indicates whether the board is in that state. Bit 0 is the least significant bit. *Note on Reset Bit: The Reset Bit will be true as soon as the board is initialized. It will remain true until a hardware or software trigger occurs, at which point it will stay false until the board is reset again. *Note on Activation Levels: The activation level of each bit depends on the board, please see your product's manual for details. Bits 5-31 are reserved for future use. It should not be assumed that these will be set to 0. The output is converted to integer representation directly, and not bit representation, as it is mentioned in the spinapi documentation.
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_status_message | ( | self | ) |
Read status message from the board.
Not all boards support this, see your manual. The returned string will either have the board's status or an error message.
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_version | ( | self | ) |
Get the version date of this library.
def pulse_blaster_esrpro.PulseBlasterESRPRO.get_waveform_names | ( | self | ) |
Retrieve the names of all uploaded waveforms on the device.
def pulse_blaster_esrpro.PulseBlasterESRPRO.getCalibration | ( | self, | |
switch_num, | |||
switch_state | |||
) |
Get calibration parameter for switch.
int | switch_num: number of switch for which to get calibration parameter |
str | switch_state: state ['On', 'Off'] for which to get calibration parameter |
def pulse_blaster_esrpro.PulseBlasterESRPRO.getNumberOfSwitches | ( | self | ) |
Gives the number of switches connected to this hardware.
def pulse_blaster_esrpro.PulseBlasterESRPRO.getSwitchState | ( | self, | |
switch_num | |||
) |
Gives state of switch.
int | switch_num: number of switch, numbering starts with 0 |
def pulse_blaster_esrpro.PulseBlasterESRPRO.getSwitchTime | ( | self, | |
switch_num | |||
) |
Give switching time for switch.
int | switch_num: number of switch |
def pulse_blaster_esrpro.PulseBlasterESRPRO.has_sequence_mode | ( | self | ) |
Asks the pulse generator whether sequence mode exists.
def pulse_blaster_esrpro.PulseBlasterESRPRO.load_sequence | ( | self, | |
sequence_name | |||
) |
Loads a sequence to the channels of the device in order to be ready for playback.
dict|list | sequence_name: a dictionary with keys being one of the available channel index and values being the name of the already written waveform to load into the channel. Examples: {1: rabi_ch1, 2: rabi_ch2} or {1: rabi_ch2, 2: rabi_ch1} |
If just a list of waveform names if given, the channel association will be invoked from the channel suffix '_ch1', '_ch2' etc.
For devices that have a workspace (i.e. AWG) this will load the sequence from the device workspace into the channels. For a device without mass memory this will make the waveform/pattern that has been previously written with self.write_waveform ready to play.
def pulse_blaster_esrpro.PulseBlasterESRPRO.load_waveform | ( | self, | |
load_dict | |||
) |
Loads a waveform to the specified channel of the pulsing device.
dict|list | load_dict: a dictionary with keys being one of the available channel index and values being the name of the already written waveform to load into the channel. Examples: {1: rabi_ch1, 2: rabi_ch2}or {1: rabi_ch2, 2: rabi_ch1} |
If just a list of waveform names if given, the channel association will be invoked from the channel suffix '_ch1', '_ch2' etc. A possible configuration can be e.g.
['rabi_ch1', 'rabi_ch2', 'rabi_ch3']
For devices that have a workspace (i.e. AWG) this will load the waveform from the device workspace into the channel. For a device without mass memory, this will make the waveform/pattern that has been previously written with self.write_waveform ready to play.
def pulse_blaster_esrpro.PulseBlasterESRPRO.on_activate | ( | self | ) |
Initialization performed during activation of the module.
def pulse_blaster_esrpro.PulseBlasterESRPRO.on_deactivate | ( | self | ) |
Deinitialization performed during deactivation of the module.
def pulse_blaster_esrpro.PulseBlasterESRPRO.open_connection | ( | self | ) |
Initializes the board.
This must be called before any other functions are used which communicate with the board. If you have multiple boards installed in your system, pb_select_board() may be called first to select which board to initialize.
def pulse_blaster_esrpro.PulseBlasterESRPRO.pulser_off | ( | self | ) |
Switches the pulsing device off.
def pulse_blaster_esrpro.PulseBlasterESRPRO.pulser_on | ( | self | ) |
Switches the pulsing device on.
def pulse_blaster_esrpro.PulseBlasterESRPRO.reset | ( | self | ) |
Reset the device.
def pulse_blaster_esrpro.PulseBlasterESRPRO.reset_device | ( | self | ) |
Stops the output of board and resets the PulseBlaster Core.
This also resets the PulseBlaster Core so that the board can be run again using self.start() or a hardware trigger.
def pulse_blaster_esrpro.PulseBlasterESRPRO.select_board | ( | self, | |
board_num = 0 |
|||
) |
Select the proper SpinCore card, if multiple are present.
int | board_num: Specifies which board to select. Counting starts at 0. |
If multiple boards from SpinCore Technologies are present in your system, this function allows you to select which board to talk to. Once this function is called, all subsequent commands (such as pb_init(), pb_core_clock(), etc.) will be sent to the selected board. You may change which board is selected at any time. If you have only one board, it is not necessary to call this function.
def pulse_blaster_esrpro.PulseBlasterESRPRO.set_active_channels | ( | self, | |
ch = None |
|||
) |
Set the active channels for the pulse generator hardware.
dict | ch: dictionary with keys being the analog or digital string generic names for the channels (i.e. 'd_ch1', 'a_ch2') with items being a boolean value. True: Activate channel, False: Deactivate channel |
If nothing is passed then the command will simply return the unchanged current state.
Example for possible input:
ch True, 'd_ch1': False, 'd_ch3': True, 'd_ch4': True}
to activate analog channel 2 digital channel 3 and 4 and to deactivate digital channel 1. The hardware itself has to handle, whether separate channel activation is possible.
def pulse_blaster_esrpro.PulseBlasterESRPRO.set_analog_level | ( | self, | |
amplitude = None , |
|||
offset = None |
|||
) |
Set amplitude and/or offset value of the provided analog channel(s).
dict | amplitude: dictionary, with key being the channel descriptor string (i.e. 'a_ch1', 'a_ch2') and items being the amplitude values (in Volt peak to peak, i.e. the full amplitude) for the desired channel. |
dict | offset: dictionary, with key being the channel descriptor string (i.e. 'a_ch1', 'a_ch2') and items being the offset values (in absolute volt) for the desired channel. |
If nothing is passed then the command will return the current amplitudes/offsets.
def pulse_blaster_esrpro.PulseBlasterESRPRO.set_debug_mode | ( | self, | |
value | |||
) |
Set the debug mode.
bool | value: State to set the debug mode to. |
def pulse_blaster_esrpro.PulseBlasterESRPRO.set_digital_level | ( | self, | |
low = None , |
|||
high = None |
|||
) |
Set low and/or high value of the provided digital channel.
dict | low: dictionary, with key being the channel descriptor string (i.e. 'd_ch1', 'd_ch2') and items being the low values (in volt) for the desired channel. |
dict | high: dictionary, with key being the channel descriptor string (i.e. 'd_ch1', 'd_ch2') and items being the high values (in volt) for the desired channel. |
If nothing is passed then the command will return the current voltage levels.
def pulse_blaster_esrpro.PulseBlasterESRPRO.set_interleave | ( | self, | |
state = False |
|||
) |
Turns the interleave of an AWG on or off.
bool | state: The state the interleave should be set to (True: ON, False: OFF) |
Unused for pulse generator hardware other than an AWG.
def pulse_blaster_esrpro.PulseBlasterESRPRO.set_sample_rate | ( | self, | |
sample_rate | |||
) |
Set the sample rate of the pulse generator hardware.
float | sample_rate: The sampling rate to be set (in Hz) |
def pulse_blaster_esrpro.PulseBlasterESRPRO.setCalibration | ( | self, | |
switch_num, | |||
switch_state, | |||
value | |||
) |
Set calibration parameter for switch.
int | switch_num: number of switch for which to get calibration parameter |
str | switch_state: state ['On', 'Off'] for which to get calibration parameter |
int | value: calibration parameter to be set. |
def pulse_blaster_esrpro.PulseBlasterESRPRO.start | ( | self | ) |
Send a software trigger to the board.
This will start execution of a pulse program.It will also trigger a program which is currently paused due to a WAIT instruction. Triggering can also be accomplished through hardware, please see your board's manual for details on how to accomplish this.
def pulse_blaster_esrpro.PulseBlasterESRPRO.start_programming | ( | self | ) |
Tell the board to start programming one of the onboard devices.
@ return int: A negative number is returned on failure, and spinerr is set to a description of the error. 0 is returned on success.
For all the devices, the method of programming follows the following form: a call to pb_start_programming(), a call to one or more functions which transfer the actual data, and a call to pb_stop_programming(). Only one device can be programmed at a time.
There are actually several programming methods possible, but since this card has only pulsing outputs, without DDS (Direct Digital Synthesis) or RadioProcessor output, the programming will be set by default to the PULSE_PROGRAM = 0.
def pulse_blaster_esrpro.PulseBlasterESRPRO.stop | ( | self | ) |
Stops output of board.
Analog output will return to ground, and TTL outputs will either remain in the same state they were in when the reset command was received or return to ground. This also resets the PulseBlaster so that the PulseBlaster Core can be run again using pb_start() or a hardware trigger.
def pulse_blaster_esrpro.PulseBlasterESRPRO.stop_programming | ( | self | ) |
Finishes the programming for a specific onboard devices.
def pulse_blaster_esrpro.PulseBlasterESRPRO.switchOff | ( | self, | |
switch_num | |||
) |
Switch off.
int | switch_num: number of switch to be switched |
def pulse_blaster_esrpro.PulseBlasterESRPRO.switchOn | ( | self, | |
switch_num | |||
) |
Switch on.
int | switch_num: number of switch to be switched, number starts from zero. |
def pulse_blaster_esrpro.PulseBlasterESRPRO.write_pulse_form | ( | self, | |
sequence_list, | |||
loop = True |
|||
) |
The higher level function, which creates the actual sequences.
list | sequence_list: a list with dictionaries. The dictionaries have the elements 'active_channels' and 'length. The 'active_channels' is a numpy list, which contains the channel number, which should be switched on. The channel numbers start with 0. E.g. |
[{'active_channels':[0], 'length': 10e-6}, {'active_channels':[], 'length': 20e-6}] which will switch on
bool | loop: optional, set if sequence should be looped (so that it runs continuously) or not, default it True. |
This method should called with the general sequence_list to program the PulseBlaster.
def pulse_blaster_esrpro.PulseBlasterESRPRO.write_sequence | ( | self, | |
name, | |||
sequence_parameters | |||
) |
Write a new sequence on the device memory.
str | name: the name of the waveform to be created/append to |
dict | sequence_parameters: dictionary containing the parameters for a sequence |
def pulse_blaster_esrpro.PulseBlasterESRPRO.write_waveform | ( | self, | |
name, | |||
analog_samples, | |||
digital_samples, | |||
is_first_chunk, | |||
is_last_chunk, | |||
total_number_of_samples | |||
) |
Write a new waveform or append samples to an already existing waveform on the device memory.
str | name: the name of the waveform to be created/append to |
numpy.ndarray | analog_samples: array of type float32 containing the voltage samples |
numpy.ndarray | digital_samples: array of type bool containing the marker states (if analog channels are active, this must be the same length as analog_samples) |
bool | is_first_chunk: flag indicating if it is the first chunk to write. If True this method will create a new empty waveform. If False the samples are appended to the existing waveform. |
bool | is_last_chunk: flag indicating if it is the last chunk to write. Some devices may need to know when to close the appending waveform file. |
int | total_number_of_samples: The number of sample points for the entire waveform (not only the currently written chunk) |
The flags is_first_chunk and is_last_chunk can be used as indicator, if a new waveform should be created or if the write process to a waveform should be terminated.
|
static |
|
static |