Qudi
|
A National Instruments device that can count and control microvave generators. More...
Public Member Functions | |
def | on_activate (self) |
Starts up the NI Card at activation. | |
def | on_deactivate (self) |
Shut down the NI card. | |
def | get_constraints (self) |
Get hardware limits of NI device. More... | |
def | set_up_clock (self, clock_frequency=None, clock_channel=None, scanner=False, idle=False) |
Configures the hardware clock of the NiDAQ card to give the timing. More... | |
def | set_up_counter (self, counter_channels=None, sources=None, clock_channel=None, counter_buffer=None) |
Configures the actual counter with a given clock. More... | |
def | get_counter_channels (self) |
Returns the list of counter channel names. More... | |
def | get_counter (self, samples=None) |
Returns the current counts per second of the counter. More... | |
def | close_counter (self, scanner=False) |
Closes the counter or scanner and cleans up afterwards. More... | |
def | close_clock (self, scanner=False) |
Closes the clock and cleans up afterwards. More... | |
def | reset_hardware (self) |
Resets the NI hardware, so the connection is lost and other programs can access it. More... | |
def | get_scanner_axes (self) |
Scanner axes depends on how many channels tha analog output task has. | |
def | get_scanner_count_channels (self) |
Return list of counter channels. | |
def | get_position_range (self) |
Returns the physical range of the scanner. More... | |
def | set_position_range (self, myrange=None) |
Sets the physical range of the scanner. More... | |
def | set_voltage_range (self, myrange=None) |
Sets the voltage range of the NI Card. More... | |
def | set_up_scanner_clock (self, clock_frequency=None, clock_channel=None) |
Configures the hardware clock of the NiDAQ card to give the timing. More... | |
def | set_up_scanner (self, counter_channels=None, sources=None, clock_channel=None, scanner_ao_channels=None) |
Configures the actual scanner with a given clock. More... | |
def | scanner_set_position (self, x=None, y=None, z=None, a=None) |
Move stage to x, y, z, a (where a is the fourth voltage channel). More... | |
def | get_scanner_position (self) |
Get the current position of the scanner hardware. More... | |
def | scan_line (self, line_path=None, pixel_clock=False) |
Scans a line and return the counts on that line. More... | |
def | close_scanner (self) |
Closes the scanner and cleans up afterwards. More... | |
def | close_scanner_clock (self) |
Closes the clock and cleans up afterwards. More... | |
def | set_up_odmr_clock (self, clock_frequency=None, clock_channel=None) |
Configures the hardware clock of the NiDAQ card to give the timing. More... | |
def | set_up_odmr (self, counter_channel=None, photon_source=None, clock_channel=None, odmr_trigger_channel=None) |
Configures the actual counter with a given clock. More... | |
def | set_odmr_length (self, length=100) |
Sets up the trigger sequence for the ODMR and the triggered microwave. More... | |
def | count_odmr (self, length=100) |
Sweeps the microwave and returns the counts on that sweep. More... | |
def | close_odmr (self) |
Closes the odmr and cleans up afterwards. More... | |
def | get_odmr_channels (self) |
def | close_odmr_clock (self) |
Closes the odmr and cleans up afterwards. More... | |
def | get_status (self) |
Receives the current status of the Fast Counter and outputs it as return value. More... | |
def | set_up_gated_counter (self, buffer_length, read_available_samples=False) |
Initializes and starts task for external gated photon counting. More... | |
def | start_gated_counter (self) |
Actually start the preconfigured counter task. More... | |
def | get_gated_counts (self, samples=None, timeout=None, read_available_samples=False) |
Returns latest count samples acquired by gated photon counting. More... | |
def | stop_gated_counter (self) |
Actually start the preconfigured counter task. More... | |
def | close_gated_counter (self) |
Clear tasks, so that counters are not in use any more. More... | |
def | digital_channel_switch (self, channel_name, mode=True) |
![]() | |
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 | |
digital_out_task | |
digital_data | |
digital_read | |
digital_samples_channel | |
![]() | |
module_state | |
connectors | |
A National Instruments device that can count and control microvave generators.
!!!!!! NI USB 63XX, NI PCIe 63XX and NI PXIe 63XX DEVICES ONLY !!!!!!
See National Instruments X Series Documentation for details.
stable Kay Jahnke, Alexander Stark
Example config for copy-paste:
nicard_6343: module 'national_instruments_x_series.NationalInstrumentsXSeries' photon_sources:
clock_channel '/Dev1/Ctr0' default_clock_frequency 100 # optional, in Hz counter_channels:
odmr_trigger_channel '/Dev1/PFI7'
gate_in_channel '/Dev1/PFI9' default_samples_number 50 max_counts 3e7 read_write_timeout 10 counting_edge_rising True
def national_instruments_x_series.NationalInstrumentsXSeries.close_clock | ( | self, | |
scanner = False |
|||
) |
Closes the clock and cleans up afterwards.
bool | scanner: specifies if the counter- or scanner- function should be used to close the device. True = scanner False = counter |
def national_instruments_x_series.NationalInstrumentsXSeries.close_counter | ( | self, | |
scanner = False |
|||
) |
Closes the counter or scanner and cleans up afterwards.
bool | scanner: specifies if the counter- or scanner- function will be excecuted to close the device. True = scanner False = counter |
def national_instruments_x_series.NationalInstrumentsXSeries.close_gated_counter | ( | self | ) |
Clear tasks, so that counters are not in use any more.
def national_instruments_x_series.NationalInstrumentsXSeries.close_odmr | ( | self | ) |
Closes the odmr and cleans up afterwards.
def national_instruments_x_series.NationalInstrumentsXSeries.close_odmr_clock | ( | self | ) |
Closes the odmr and cleans up afterwards.
def national_instruments_x_series.NationalInstrumentsXSeries.close_scanner | ( | self | ) |
Closes the scanner and cleans up afterwards.
def national_instruments_x_series.NationalInstrumentsXSeries.close_scanner_clock | ( | self | ) |
Closes the clock and cleans up afterwards.
def national_instruments_x_series.NationalInstrumentsXSeries.count_odmr | ( | self, | |
length = 100 |
|||
) |
Sweeps the microwave and returns the counts on that sweep.
int | length: length of microwave sweep in pixel |
def national_instruments_x_series.NationalInstrumentsXSeries.get_constraints | ( | self | ) |
Get hardware limits of NI device.
FIXME ask hardware for limits when module is loaded
def national_instruments_x_series.NationalInstrumentsXSeries.get_counter | ( | self, | |
samples = None |
|||
) |
Returns the current counts per second of the counter.
int | samples: if defined, number of samples to read in one go. How many samples are read per readout cycle. The readout frequency was defined in the counter setup. That sets also the length of the readout array. |
def national_instruments_x_series.NationalInstrumentsXSeries.get_counter_channels | ( | self | ) |
Returns the list of counter channel names.
Most methods calling this might just care about the number of channels, though.
def national_instruments_x_series.NationalInstrumentsXSeries.get_gated_counts | ( | self, | |
samples = None , |
|||
timeout = None , |
|||
read_available_samples = False |
|||
) |
Returns latest count samples acquired by gated photon counting.
int | samples: if defined, number of samples to read in one go. How many samples are read per readout cycle. The readout frequency was defined in the counter setup. That sets also the length of the readout array. |
int | timeout: Maximal timeout for the read process. Since nidaq waits for all samples to be acquired, make sure this is long enough. |
bool | read_available_samples : if False, NiDaq waits for the sample you asked for to be in the buffer before, True it returns what is in buffer until 'samples' is full. |
def national_instruments_x_series.NationalInstrumentsXSeries.get_position_range | ( | self | ) |
Returns the physical range of the scanner.
def national_instruments_x_series.NationalInstrumentsXSeries.get_scanner_position | ( | self | ) |
Get the current position of the scanner hardware.
def national_instruments_x_series.NationalInstrumentsXSeries.get_status | ( | self | ) |
Receives the current status of the Fast Counter and outputs it as return value.
0 = unconfigured 1 = idle 2 = running 3 = paused -1 = error state
def national_instruments_x_series.NationalInstrumentsXSeries.reset_hardware | ( | self | ) |
Resets the NI hardware, so the connection is lost and other programs can access it.
def national_instruments_x_series.NationalInstrumentsXSeries.scan_line | ( | self, | |
line_path = None , |
|||
pixel_clock = False |
|||
) |
Scans a line and return the counts on that line.
float[c][m] | line_path: array of c-tuples defining the voltage points (m = samples per line) |
bool | pixel_clock: whether we need to output a pixel clock for this line |
The input array looks for a xy scan of 5x5 points at the position z=-2 like the following: [ [1, 2, 3, 4, 5], [1, 1, 1, 1, 1], [-2, -2, -2, -2] ] n is the number of scanner axes, which can vary. Typical values are 2 for galvo scanners, 3 for xyz scanners and 4 for xyz scanners with a special function on the a axis.
def national_instruments_x_series.NationalInstrumentsXSeries.scanner_set_position | ( | self, | |
x = None , |
|||
y = None , |
|||
z = None , |
|||
a = None |
|||
) |
Move stage to x, y, z, a (where a is the fourth voltage channel).
#FIXME: No volts
float | x: postion in x-direction (volts) |
float | y: postion in y-direction (volts) |
float | z: postion in z-direction (volts) |
float | a: postion in a-direction (volts) |
def national_instruments_x_series.NationalInstrumentsXSeries.set_odmr_length | ( | self, | |
length = 100 |
|||
) |
Sets up the trigger sequence for the ODMR and the triggered microwave.
int | length: length of microwave sweep in pixel |
def national_instruments_x_series.NationalInstrumentsXSeries.set_position_range | ( | self, | |
myrange = None |
|||
) |
Sets the physical range of the scanner.
float | [4][2] myrange: array of 4 ranges with an array containing lower and upper limit. The unit of the scan range is meters. |
def national_instruments_x_series.NationalInstrumentsXSeries.set_up_clock | ( | self, | |
clock_frequency = None , |
|||
clock_channel = None , |
|||
scanner = False , |
|||
idle = False |
|||
) |
Configures the hardware clock of the NiDAQ card to give the timing.
float | clock_frequency: if defined, this sets the frequency of the clock in Hz |
string | clock_channel: if defined, this is the physical channel of the clock within the NI card. |
bool | scanner: if set to True method will set up a clock function for the scanner, otherwise a clock function for a counter will be set. |
bool | idle: set whether idle situation of the counter (where counter is doing nothing) is defined as True = 'Voltage High/Rising Edge' False = 'Voltage Low/Falling Edge' |
def national_instruments_x_series.NationalInstrumentsXSeries.set_up_counter | ( | self, | |
counter_channels = None , |
|||
sources = None , |
|||
clock_channel = None , |
|||
counter_buffer = None |
|||
) |
Configures the actual counter with a given clock.
list(str) | counter_channels: optional, physical channel of the counter |
list(str) | sources: optional, physical channel where the photons are to count from |
str | clock_channel: optional, specifies the clock channel for the counter |
int | counter_buffer: optional, a buffer of specified integer length, where in each bin the count numbers are saved. |
def national_instruments_x_series.NationalInstrumentsXSeries.set_up_gated_counter | ( | self, | |
buffer_length, | |||
read_available_samples = False |
|||
) |
Initializes and starts task for external gated photon counting.
int | buffer_length: Defines how long the buffer to be filled with samples should be. If buffer is full, program crashes, so use upper bound. Some reference calculated with sample_rate (in Samples/second) divided by Buffer_size: sample_rate/Buffer_size = no rate / 10kS, (0-100S/s) / 10kS (101-10kS/s)/ 1kS, (10k-1MS/s) / 100kS, (>1MS/s) / 1Ms |
bool | read_available_samples: if False, NiDaq waits for the sample you asked for to be in the buffer before, if True it returns what is in buffer until 'samples' is full |
def national_instruments_x_series.NationalInstrumentsXSeries.set_up_odmr | ( | self, | |
counter_channel = None , |
|||
photon_source = None , |
|||
clock_channel = None , |
|||
odmr_trigger_channel = None |
|||
) |
Configures the actual counter with a given clock.
string | counter_channel: if defined, this is the physical channel of the counter |
string | photon_source: if defined, this is the physical channel where the photons are to count from |
string | clock_channel: if defined, this specifies the clock for the counter |
string | odmr_trigger_channel: if defined, this specifies the trigger output for the microwave |
def national_instruments_x_series.NationalInstrumentsXSeries.set_up_odmr_clock | ( | self, | |
clock_frequency = None , |
|||
clock_channel = None |
|||
) |
Configures the hardware clock of the NiDAQ card to give the timing.
float | clock_frequency: if defined, this sets the frequency of the clock |
string | clock_channel: if defined, this is the physical channel of the clock |
def national_instruments_x_series.NationalInstrumentsXSeries.set_up_scanner | ( | self, | |
counter_channels = None , |
|||
sources = None , |
|||
clock_channel = None , |
|||
scanner_ao_channels = None |
|||
) |
Configures the actual scanner with a given clock.
The scanner works pretty much like the counter. Here you connect a created clock with a counting task. That can be seen as a gated counting, where the counts where sampled by the underlying clock.
list(str) | counter_channels: this is the physical channel of the counter |
list(str) | sources: this is the physical channel where the photons are to count from |
string | clock_channel: optional, if defined, this specifies the clock for the counter |
list(str) | scanner_ao_channels: optional, if defined, this specifies the analog output channels |
def national_instruments_x_series.NationalInstrumentsXSeries.set_up_scanner_clock | ( | self, | |
clock_frequency = None , |
|||
clock_channel = None |
|||
) |
Configures the hardware clock of the NiDAQ card to give the timing.
float | clock_frequency: if defined, this sets the frequency of the clock |
string | clock_channel: if defined, this is the physical channel of the clock |
def national_instruments_x_series.NationalInstrumentsXSeries.set_voltage_range | ( | self, | |
myrange = None |
|||
) |
Sets the voltage range of the NI Card.
float | [n][2] myrange: array containing lower and upper limit |
def national_instruments_x_series.NationalInstrumentsXSeries.start_gated_counter | ( | self | ) |
Actually start the preconfigured counter task.
def national_instruments_x_series.NationalInstrumentsXSeries.stop_gated_counter | ( | self | ) |
Actually start the preconfigured counter task.