Qudi
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
pulse_blaster_esrpro.PulseBlasterESRPRO Class Reference

Hardware class to control the PulseBlasterESR-PRO card from SpinCore. More...

Inheritance diagram for pulse_blaster_esrpro.PulseBlasterESRPRO:
Inheritance graph
[legend]
Collaboration diagram for pulse_blaster_esrpro.PulseBlasterESRPRO:
Collaboration graph
[legend]

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...
 
- Public Member Functions inherited from core.module.BaseMixin
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...
 
- Public Member Functions inherited from core.module.ModuleMeta
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
 
- Public Attributes inherited from core.module.BaseMixin
 module_state
 
 connectors
 

Static Public Attributes

int PULSE_PROGRAM = 0
 
int CONTINUE = 0
 
int STOP = 1
 
int LOOP = 2
 
int END_LOOP = 3
 
int JSR = 4
 
int RTS = 5
 
int BRANCH = 6
 
int LONG_DELAY = 7
 
int WAIT = 8
 
int RTI = 9
 
int ONE_PERIOD = 0x200000
 
int TWO_PERIOD = 0x400000
 
int THREE_PERIOD = 0x600000
 
int FOUR_PERIOD = 0x800000
 
int FIVE_PERIOD = 0xA00000
 
int ON = 0xE00000
 
int SIX_PERIOD = 0xC00000
 
int ALL_FLAGS_ON = 0x1FFFFF
 
int ALL_FLAGS_OFF = 0x0
 
dictionary STATUS_DICT
 
dictionary switch_states
 
dictionary channel_states = switch_states.copy()
 

Detailed Description

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

optimize the memory used on the device.

#library_file: 'spinapi64.dll' # optional, name of the library file

or whole path to the 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.

Member Function Documentation

◆ activate_channels()

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.

Parameters
listch_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.
intlength: 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.
boolimmediate_start: optional, indicate whether output should directly be switch on, default is True.
Returns
int: the number of created pulse instructions, normally it should output just the number 1.

This is a high level command mostly used not for pulsing but just rather for switching something on or off.

◆ check()

def pulse_blaster_esrpro.PulseBlasterESRPRO.check (   self,
  func_val 
)

Check routine for the received error codes.

Parameters
intfunc_val: return error code of the called function.
Returns
int: pass the error code further so that other functions have the possibility to use it.

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).

◆ clear_all()

def pulse_blaster_esrpro.PulseBlasterESRPRO.clear_all (   self)

Clears all loaded waveforms from the pulse generators RAM/workspace.

Returns
int: error code (0:OK, -1:error)

◆ close_connection()

def pulse_blaster_esrpro.PulseBlasterESRPRO.close_connection (   self)

End communication with the board.

Returns
: A negative number is returned on failure, and spinerr is set to a description of the error. 0 is returned on success.

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.

◆ count_boards()

def pulse_blaster_esrpro.PulseBlasterESRPRO.count_boards (   self)

Return the number of SpinCore boards present in your system.

Returns
int: The number of boards present is returned. -1 is returned on error, and spinerr is set to a description of the error.

◆ delete_sequence()

def pulse_blaster_esrpro.PulseBlasterESRPRO.delete_sequence (   self,
  sequence_name 
)

Delete the sequence with name "sequence_name" from the device memory.

Parameters
strsequence_name: The name of the sequence to be deleted Optionally a list of sequence names can be passed.
Returns
list: a list of deleted sequence names.

◆ delete_waveform()

def pulse_blaster_esrpro.PulseBlasterESRPRO.delete_waveform (   self,
  waveform_name 
)

Delete the waveform with name "waveform_name" from the device memory.

Parameters
strwaveform_name: The name of the waveform to be deleted Optionally a list of waveform names can be passed.
Returns
list: a list of deleted waveform names.

◆ get_active_channels()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_active_channels (   self,
  ch = None 
)

Get the active channels of the pulse generator hardware.

Parameters
listch: optional, if specific analog or digital channels are needed to be asked without obtaining all the channels.
Returns
dict: where keys denoting the channel string and items boolean expressions whether channel are active or not.

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.

◆ get_analog_level()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_analog_level (   self,
  amplitude = None,
  offset = None 
)

Retrieve the analog amplitude and offset of the provided channels.

Parameters
listamplitude: optional, if the amplitude value (in Volt peak to peak, i.e. the full amplitude) of a specific channel is desired.
listoffset: optional, if the offset value (in Volt) of a specific channel is desired.
Returns
: (dict, dict): tuple of two dicts, with keys being the channel descriptor string (i.e. 'a_ch1') and items being the values for those channels. Amplitude is always denoted in Volt-peak-to-peak and Offset in volts.
Note
Do not return a saved amplitude and/or offset value but instead retrieve the current amplitude and/or offset directly from the device.

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}

◆ get_constraints()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_constraints (   self)

Retrieve the hardware constrains from the Pulsing device.

Returns
constraints object: object with pulser constraints as attributes.

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).

Example for configuration with default values:

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

If sequencer mode is available then these should be specified

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

the name a_ch<num> and d_ch<num> are generic names, which describe

UNAMBIGUOUSLY the channels. Here all possible channel configurations

are stated, where only the generic names should be used. The names for

the different configurations can be customary chosen.

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

◆ get_debug_mode()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_debug_mode (   self)

Retrieve whether debug mode is set.

Returns
bool: the current debug mode

◆ get_digital_level()

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.

Parameters
listlow: optional, if the low value (in Volt) of a specific channel is desired.
listhigh: optional, if the high value (in Volt) of a specific channel is desired.
Returns
: (dict, dict): tuple of two dicts, with keys being the channel descriptor strings (i.e. 'd_ch1', 'd_ch2') and items being the values for those channels. Both low and high value of a channel is denoted in volts.
Note
Do not return a saved low and/or high value but instead retrieve the current low and/or high value directly from the device.

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).

◆ get_error_string()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_error_string (   self)

Return the most recent error string.

Returns
str: A string describing the last error is returned. A string containing "No Error" is returned if the last function call was successful.

Anytime a function (such as pb_init(), pb_start_programming(), etc.) encounters an error, this function will return a description of what went wrong.

◆ get_firmware_id()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_firmware_id (   self)

Gets the current version of the SpinPTS API being used.

Returns
int: Returns the firmware id containing the version string.

◆ get_interleave()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_interleave (   self)

Check whether Interleave is ON or OFF in AWG.

Returns
bool: True: ON, False: OFF

Will always return False for pulse generator hardware without interleave.

◆ get_loaded_assets()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_loaded_assets (   self)

Retrieve the currently loaded asset names for each active channel of the device.

Returns
(dict, str): Dictionary with keys being the channel number and values being the respective asset loaded into the channel, string describing the asset type ('waveform' or 'sequence')

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').

◆ get_sample_rate()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_sample_rate (   self)

Get the sample rate of the pulse generator hardware.

Returns
float: The current sample rate of the device (in Hz)

Do not return a saved sample rate from an attribute, but instead retrieve the current sample rate directly from the device.

◆ get_sequence_names()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_sequence_names (   self)

Retrieve the names of all uploaded sequence on the device.

Returns
list: List of all uploaded sequence name strings in the device workspace.

◆ get_status()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_status (   self)

Retrieves the status of the pulsing hardware.

Returns
(int, dict): tuple with an integer value of the current status and a corresponding dictionary containing status description for all the possible status variables of the pulse generator hardware.

◆ get_status_bit()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_status_bit (   self)

Read status from the board.

Returns
int: Word that indicates the state of the current board like the representation 2^(<bit>), whereas the value of bit is bit Stopped (2^0 = 1) bit Reset (2^1 = 2) bit Running (2^2 = 4) bit Waiting (2^3 = 8) bit Scanning (RadioProcessor boards only, 2^4 = 16)
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.

◆ get_status_message()

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.

Returns
str: containing the status message of the board.

◆ get_version()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_version (   self)

Get the version date of this library.

Returns
string: A string indicating the version of this library is returned. The version is a string in the form YYYYMMDD.

◆ get_waveform_names()

def pulse_blaster_esrpro.PulseBlasterESRPRO.get_waveform_names (   self)

Retrieve the names of all uploaded waveforms on the device.

Returns
list: List of all uploaded waveform name strings in the device workspace.

◆ getCalibration()

def pulse_blaster_esrpro.PulseBlasterESRPRO.getCalibration (   self,
  switch_num,
  switch_state 
)

Get calibration parameter for switch.

Parameters
intswitch_num: number of switch for which to get calibration parameter
strswitch_state: state ['On', 'Off'] for which to get calibration parameter
Returns
str: calibration parameter for switch and state.

◆ getNumberOfSwitches()

def pulse_blaster_esrpro.PulseBlasterESRPRO.getNumberOfSwitches (   self)

Gives the number of switches connected to this hardware.

Returns
int: number of swiches on this hardware

◆ getSwitchState()

def pulse_blaster_esrpro.PulseBlasterESRPRO.getSwitchState (   self,
  switch_num 
)

Gives state of switch.

Parameters
intswitch_num: number of switch, numbering starts with 0
Returns
bool: True if on, False if off, None on error

◆ getSwitchTime()

def pulse_blaster_esrpro.PulseBlasterESRPRO.getSwitchTime (   self,
  switch_num 
)

Give switching time for switch.

Parameters
intswitch_num: number of switch
Returns
float: time needed for switch state change

◆ has_sequence_mode()

def pulse_blaster_esrpro.PulseBlasterESRPRO.has_sequence_mode (   self)

Asks the pulse generator whether sequence mode exists.

Returns
: bool, True for yes, False for no.

◆ load_sequence()

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.

Parameters
dict|listsequence_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.

Returns
dict: Dictionary containing the actually loaded waveforms per channel.

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.

◆ load_waveform()

def pulse_blaster_esrpro.PulseBlasterESRPRO.load_waveform (   self,
  load_dict 
)

Loads a waveform to the specified channel of the pulsing device.

Parameters
dict|listload_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']
Returns
dict: Dictionary containing the actually loaded waveforms per channel.

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.

◆ on_activate()

def pulse_blaster_esrpro.PulseBlasterESRPRO.on_activate (   self)

Initialization performed during activation of the module.

◆ on_deactivate()

def pulse_blaster_esrpro.PulseBlasterESRPRO.on_deactivate (   self)

Deinitialization performed during deactivation of the module.

◆ open_connection()

def pulse_blaster_esrpro.PulseBlasterESRPRO.open_connection (   self)

Initializes the board.

Returns
int: A negative number is returned on failure, and spinerr is set to a description of the error. 0 is returned on success.

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.

◆ pulser_off()

def pulse_blaster_esrpro.PulseBlasterESRPRO.pulser_off (   self)

Switches the pulsing device off.

Returns
int: error code (0:OK, -1:error)

◆ pulser_on()

def pulse_blaster_esrpro.PulseBlasterESRPRO.pulser_on (   self)

Switches the pulsing device on.

Returns
int: error code (0:OK, -1:error)

◆ reset()

def pulse_blaster_esrpro.PulseBlasterESRPRO.reset (   self)

Reset the device.

Returns
int: error code (0:OK, -1:error)

◆ reset_device()

def pulse_blaster_esrpro.PulseBlasterESRPRO.reset_device (   self)

Stops the output of board and resets the PulseBlaster Core.

Returns
int: A negative number is returned on failure, and spinerr is set to a description of the error. 0 is returned on success.

This also resets the PulseBlaster Core so that the board can be run again using self.start() or a hardware trigger.

◆ select_board()

def pulse_blaster_esrpro.PulseBlasterESRPRO.select_board (   self,
  board_num = 0 
)

Select the proper SpinCore card, if multiple are present.

Parameters
intboard_num: Specifies which board to select. Counting starts at 0.
Returns
int: the selected board number or -1 for an error.

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.

◆ set_active_channels()

def pulse_blaster_esrpro.PulseBlasterESRPRO.set_active_channels (   self,
  ch = None 
)

Set the active channels for the pulse generator hardware.

Parameters
dictch: 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
Returns
dict: with the actual set values for ALL active analog and digital channels

If nothing is passed then the command will simply return the unchanged current state.

Note
After setting the active channels of the device, use the returned dict for further processing.

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.

◆ set_analog_level()

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).

Parameters
dictamplitude: 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.
dictoffset: 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.
Returns
(dict, dict): tuple of two dicts with the actual set values for amplitude and offset for ALL channels.

If nothing is passed then the command will return the current amplitudes/offsets.

Note
After setting the amplitude and/or offset values of the device, use the actual set return values for further processing.

◆ set_debug_mode()

def pulse_blaster_esrpro.PulseBlasterESRPRO.set_debug_mode (   self,
  value 
)

Set the debug mode.

Parameters
boolvalue: State to set the debug mode to.
Returns
: the current debug mode.

◆ set_digital_level()

def pulse_blaster_esrpro.PulseBlasterESRPRO.set_digital_level (   self,
  low = None,
  high = None 
)

Set low and/or high value of the provided digital channel.

Parameters
dictlow: 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.
dicthigh: 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.
Returns
(dict, dict): tuple of two dicts where first dict denotes the current low value and the second dict the high value for ALL digital channels. Keys are the channel descriptor strings (i.e. 'd_ch1', 'd_ch2')

If nothing is passed then the command will return the current voltage levels.

Note
After setting the high and/or low values of the device, use the actual set return values for further processing.

◆ set_interleave()

def pulse_blaster_esrpro.PulseBlasterESRPRO.set_interleave (   self,
  state = False 
)

Turns the interleave of an AWG on or off.

Parameters
boolstate: The state the interleave should be set to (True: ON, False: OFF)
Returns
bool: actual interleave status (True: ON, False: OFF)
Note
After setting the interleave of the device, retrieve the interleave again and use that information for further processing.

Unused for pulse generator hardware other than an AWG.

◆ set_sample_rate()

def pulse_blaster_esrpro.PulseBlasterESRPRO.set_sample_rate (   self,
  sample_rate 
)

Set the sample rate of the pulse generator hardware.

Parameters
floatsample_rate: The sampling rate to be set (in Hz)
Returns
float: the sample rate returned from the device (in Hz).
Note
After setting the sampling rate of the device, use the actually set return value for further processing.

◆ setCalibration()

def pulse_blaster_esrpro.PulseBlasterESRPRO.setCalibration (   self,
  switch_num,
  switch_state,
  value 
)

Set calibration parameter for switch.

Parameters
intswitch_num: number of switch for which to get calibration parameter
strswitch_state: state ['On', 'Off'] for which to get calibration parameter
intvalue: calibration parameter to be set.
Returns
bool: True if succeeds, False otherwise

◆ start()

def pulse_blaster_esrpro.PulseBlasterESRPRO.start (   self)

Send a software trigger to the board.

Returns
int: A negative number is returned on failure, and spinerr is set to a description of the error. 0 is returned on success.

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.

◆ start_programming()

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.

◆ stop()

def pulse_blaster_esrpro.PulseBlasterESRPRO.stop (   self)

Stops output of board.

Returns
int: A negative number is returned on failure, and spinerr is set to a description of the error. 0 is returned on success.

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.

◆ stop_programming()

def pulse_blaster_esrpro.PulseBlasterESRPRO.stop_programming (   self)

Finishes the programming for a specific onboard devices.

Returns
int: A negative number is returned on failure, and spinerr is set to a description of the error. 0 is returned on success.

◆ switchOff()

def pulse_blaster_esrpro.PulseBlasterESRPRO.switchOff (   self,
  switch_num 
)

Switch off.

Parameters
intswitch_num: number of switch to be switched
Returns
bool: True if suceeds, False otherwise

◆ switchOn()

def pulse_blaster_esrpro.PulseBlasterESRPRO.switchOn (   self,
  switch_num 
)

Switch on.

Parameters
intswitch_num: number of switch to be switched, number starts from zero.
Returns
bool: True if succeeds, False otherwise

◆ write_pulse_form()

def pulse_blaster_esrpro.PulseBlasterESRPRO.write_pulse_form (   self,
  sequence_list,
  loop = True 
)

The higher level function, which creates the actual sequences.

Parameters
listsequence_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

Parameters
boolloop: optional, set if sequence should be looped (so that it runs continuously) or not, default it True.
Returns
int: The number of created pulses with the given sequence.

This method should called with the general sequence_list to program the PulseBlaster.

◆ write_sequence()

def pulse_blaster_esrpro.PulseBlasterESRPRO.write_sequence (   self,
  name,
  sequence_parameters 
)

Write a new sequence on the device memory.

Parameters
strname: the name of the waveform to be created/append to
dictsequence_parameters: dictionary containing the parameters for a sequence
Returns
: int, number of sequence steps written (-1 indicates failed process)

◆ write_waveform()

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.

Parameters
strname: the name of the waveform to be created/append to
numpy.ndarrayanalog_samples: array of type float32 containing the voltage samples
numpy.ndarraydigital_samples: array of type bool containing the marker states (if analog channels are active, this must be the same length as analog_samples)
boolis_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.
boolis_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.
inttotal_number_of_samples: The number of sample points for the entire waveform (not only the currently written chunk)
Returns
(int, list): number of samples written (-1 indicates failed process) and list of created waveform names.

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.

Member Data Documentation

◆ STATUS_DICT

dictionary pulse_blaster_esrpro.PulseBlasterESRPRO.STATUS_DICT
static
Initial value:
= {1: 'Stopped',
2: 'Reset',
4: 'Running',
8: 'Waiting',
16: 'Scanning'}

◆ switch_states

dictionary pulse_blaster_esrpro.PulseBlasterESRPRO.switch_states
static
Initial value:
= {'d_ch1': False, 'd_ch2': False, 'd_ch3': False,
'd_ch4': False, 'd_ch5': False, 'd_ch6': False,
'd_ch7': False, 'd_ch8': False, 'd_ch9': False,
'd_ch10': False, 'd_ch11': False, 'd_ch12': False,
'd_ch13': False, 'd_ch14': False, 'd_ch15': False,
'd_ch16': False, 'd_ch17': False, 'd_ch18': False,
'd_ch19': False, 'd_ch20': False, 'd_ch21': False}

The documentation for this class was generated from the following file: