Qudi
|
Pulse generator using NI-DAQmx. More...
Public Member Functions | |
def | on_activate (self) |
Activate module. | |
def | on_deactivate (self) |
Deactivate module. | |
def | init_constraints (self) |
Build a pulser constraints dictionary with information from the NI card. | |
def | configure_pulser_task (self) |
Clear pulser task and set to current settings. More... | |
def | close_pulser_task (self) |
Clear tasks. 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 | upload_asset (self, asset_name=None) |
Upload an already hardware conform file to the device mass memory. More... | |
def | load_asset (self, asset_name, load_dict=None) |
Loads a sequence or waveform to the specified channel of the pulsing device. More... | |
def | get_loaded_asset (self) |
Retrieve the currently loaded asset name 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) |
def | get_uploaded_asset_names (self) |
Retrieve the names of all uploaded assets on the device. More... | |
def | get_saved_asset_names (self) |
Retrieve the names of all sampled and saved assets on the host PC. More... | |
def | delete_asset (self, asset_name) |
Delete all files associated with an asset with the passed asset_name from the device memory (mass storage as well as i.e. More... | |
def | set_asset_dir_on_device (self, dir_path) |
Change the directory where the assets are stored on the device. More... | |
def | get_asset_dir_on_device (self) |
Ask for the directory where the hardware conform files are stored on the device. 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 | tell (self, command) |
Sends a command string to the device. More... | |
def | ask (self, question) |
Asks the device a 'question' and receive and return an answer from it. 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 | |
pulsed_file_dir | |
host_waveform_directory | |
pulser_task | |
current_status | |
current_loaded_asset | |
min_volts | |
max_volts | |
sample_rate | |
a_names | |
d_names | |
channel_map | |
constraints | |
samples | |
![]() | |
module_state | |
connectors | |
Static Public Attributes | |
device = ConfigOption('device', default='Dev0', missing='warn') | |
Pulse generator using NI-DAQmx.
Example config for copy-paste:
ni_pulser: module 'national_instruments_pulser.NationalInstrumentsPulser' device 'Dev0' #pulsed_file_dir: 'C:\Software\qudi_pulsed_files' # optional, path
def national_instruments_pulser.NationalInstrumentsPulser.ask | ( | self, | |
question | |||
) |
Asks the device a 'question' and receive and return an answer from it.
string | question: string containing the command |
def national_instruments_pulser.NationalInstrumentsPulser.clear_all | ( | self | ) |
Clears all loaded waveforms from the pulse generators RAM/workspace.
def national_instruments_pulser.NationalInstrumentsPulser.close_pulser_task | ( | self | ) |
Clear tasks.
def national_instruments_pulser.NationalInstrumentsPulser.configure_pulser_task | ( | self | ) |
Clear pulser task and set to current settings.
def national_instruments_pulser.NationalInstrumentsPulser.delete_asset | ( | self, | |
asset_name | |||
) |
Delete all files associated with an asset with the passed asset_name from the device memory (mass storage as well as i.e.
awg workspace/channels).
@param str asset_name: The name of the asset to be deleted Optionally a list of asset names can be passed. @return list: a list with strings of the files which were deleted. Unused for pulse generators without sequence storage capability (PulseBlaster, FPGA).
def national_instruments_pulser.NationalInstrumentsPulser.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 national_instruments_pulser.NationalInstrumentsPulser.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}
The major difference to digital signals is that analog signals are always oscillating or changing signals, otherwise you can use just digital output. In contrast to digital output levels, analog output levels are defined by an amplitude (here total signal span, denoted in Voltage peak to peak) and an offset (a value around which the signal oscillates, denoted by an (absolute) voltage).
In general there is no bijective correspondence between (amplitude, offset) and (value high, value low)!
def national_instruments_pulser.NationalInstrumentsPulser.get_asset_dir_on_device | ( | self | ) |
Ask for the directory where the hardware conform files are stored on the device.
Unused for pulse generators without changeable file structure (i.e. PulseBlaster, FPGA).
def national_instruments_pulser.NationalInstrumentsPulser.get_constraints | ( | self | ) |
Retrieve the hardware constrains from the Pulsing device.
def national_instruments_pulser.NationalInstrumentsPulser.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).
The major difference to analog signals is that digital signals are either ON or OFF, whereas analog channels have a varying amplitude range. In contrast to analog output levels, digital output levels are defined by a voltage, which corresponds to the ON status and a voltage which corresponds to the OFF status (both denoted in (absolute) voltage)
In general there is no bijective correspondence between (amplitude, offset) and (value high, value low)!
def national_instruments_pulser.NationalInstrumentsPulser.get_interleave | ( | self | ) |
Check whether Interleave is ON or OFF in AWG.
Will always return False for pulse generator hardware without interleave.
def national_instruments_pulser.NationalInstrumentsPulser.get_loaded_asset | ( | self | ) |
Retrieve the currently loaded asset name of the device.
def national_instruments_pulser.NationalInstrumentsPulser.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 national_instruments_pulser.NationalInstrumentsPulser.get_saved_asset_names | ( | self | ) |
Retrieve the names of all sampled and saved assets on the host PC.
This is no list of the file names.
def national_instruments_pulser.NationalInstrumentsPulser.get_status | ( | self | ) |
Retrieves the status of the pulsing hardware.
def national_instruments_pulser.NationalInstrumentsPulser.get_uploaded_asset_names | ( | self | ) |
Retrieve the names of all uploaded assets on the device.
Unused for pulse generators without sequence storage capability (PulseBlaster, FPGA).
def national_instruments_pulser.NationalInstrumentsPulser.has_sequence_mode | ( | self | ) |
Asks the pulse generator whether sequence mode exists.
def national_instruments_pulser.NationalInstrumentsPulser.load_asset | ( | self, | |
asset_name, | |||
load_dict = None |
|||
) |
Loads a sequence or waveform to the specified channel of the pulsing device.
For devices that have a workspace (i.e. AWG) this will load the asset from the device workspace into the channel. For a device without mass memory this will transfer the waveform/sequence/pattern data directly to the device so that it is ready to play.
str | asset_name: The name of the asset to be loaded |
dict | load_dict: a dictionary with keys being one of the available channel numbers and items being the name of the already sampled waveform/sequence files. Examples {1: rabi_Ch1, 2: rabi_Ch2} {1: rabi_Ch2, 2: rabi_Ch1} This parameter is optional. If none is given then the channel association is invoked from the file name, i.e. the appendix (_ch1, _ch2 etc.) |
def national_instruments_pulser.NationalInstrumentsPulser.pulser_off | ( | self | ) |
Switches the pulsing device off.
def national_instruments_pulser.NationalInstrumentsPulser.pulser_on | ( | self | ) |
Switches the pulsing device on.
def national_instruments_pulser.NationalInstrumentsPulser.reset | ( | self | ) |
Reset the device.
def national_instruments_pulser.NationalInstrumentsPulser.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.
The major difference to digital signals is that analog signals are always oscillating or changing signals, otherwise you can use just digital output. In contrast to digital output levels, analog output levels are defined by an amplitude (here total signal span, denoted in Voltage peak to peak) and an offset (a value around which the signal oscillates, denoted by an (absolute) voltage).
In general there is no bijective correspondence between (amplitude, offset) and (value high, value low)!
def national_instruments_pulser.NationalInstrumentsPulser.set_asset_dir_on_device | ( | self, | |
dir_path | |||
) |
Change the directory where the assets are stored on the device.
str | dir_path: The target directory |
Unused for pulse generators without changeable file structure (PulseBlaster, FPGA).
def national_instruments_pulser.NationalInstrumentsPulser.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.
The major difference to analog signals is that digital signals are either ON or OFF, whereas analog channels have a varying amplitude range. In contrast to analog output levels, digital output levels are defined by a voltage, which corresponds to the ON status and a voltage which corresponds to the OFF status (both denoted in (absolute) voltage)
In general there is no bijective correspondence between (amplitude, offset) and (value high, value low)!
def national_instruments_pulser.NationalInstrumentsPulser.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 national_instruments_pulser.NationalInstrumentsPulser.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 national_instruments_pulser.NationalInstrumentsPulser.tell | ( | self, | |
command | |||
) |
Sends a command string to the device.
string | command: string containing the command |
def national_instruments_pulser.NationalInstrumentsPulser.upload_asset | ( | self, | |
asset_name = None |
|||
) |
Upload an already hardware conform file to the device mass memory.
Also loads these files into the device workspace if present. Does NOT load waveforms/sequences/patterns into channels.
asset_name | string, name of the ensemble/sequence to be uploaded |
If nothing is passed, method will be skipped.
This method has no effect when using pulser hardware without own mass memory (i.e. PulseBlaster, FPGA)