Qudi
Public Member Functions | Public Attributes | List of all members
fast_counter_fpga_qo.FastCounterFPGAQO Class Reference

unstable Nikolas Tomek This is the hardware class for the Spartan-6 (Opal Kelly XEM6310) FPGA based fast counter. More...

Inheritance diagram for fast_counter_fpga_qo.FastCounterFPGAQO:
Inheritance graph
[legend]
Collaboration diagram for fast_counter_fpga_qo.FastCounterFPGAQO:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, config, kwargs)
 
def on_activate (self)
 Connect and configure the access to the FPGA.
 
def on_deactivate (self)
 Deactivate the FPGA.
 
def get_constraints (self)
 Retrieve the hardware constrains from the Fast counting device. More...
 
def configure (self, bin_width_s, record_length_s, number_of_gates=0)
 Configuration of the fast counter. More...
 
def start_measure (self)
 Start the fast counter. More...
 
def get_data_trace (self)
 Polls the current timetrace data from the fast counter. More...
 
def stop_measure (self)
 Stop the fast counter. More...
 
def pause_measure (self)
 Pauses the current measurement. More...
 
def continue_measure (self)
 Continues the current measurement. More...
 
def is_gated (self)
 Check the gated counting possibility. More...
 
def get_binwidth (self)
 Returns the width of a single timebin in the timetrace in seconds. More...
 
def get_status (self)
 Receives the current status of the Fast Counter and outputs it as return value. 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
 
 statusvar
 
 count_data
 
 saved_count_data
 
- Public Attributes inherited from core.module.BaseMixin
 module_state
 
 connectors
 

Detailed Description

unstable Nikolas Tomek This is the hardware class for the Spartan-6 (Opal Kelly XEM6310) FPGA based fast counter.

The command reference for the communicating via the OpalKelly Frontend can be looked up here:

https://library.opalkelly.com/library/FrontPanelAPI/index.html

The Frontpanel is basically a C++ interface, where a wrapper was used (SWIG) to access the dll library. Be aware that the wrapper is specified for a specific version of python (here python 3.4), and it is not guaranteed to be working with other versions.

Example config for copy-paste:

fpga_qo: module 'fpga_fastcounter.fast_counter_fpga_qo.FastCounterFPGAQO' fpgacounter_serial '143400058N' fpga_type 'XEM6310_LX150' #threshV_ch1: 0.5 # optional, threshold voltage for detection #threshV_ch2: 0.5 # optional, threshold voltage for detection #threshV_ch3: 0.5 # optional, threshold voltage for detection #threshV_ch4: 0.5 # optional, threshold voltage for detection #threshV_ch5: 0.5 # optional, threshold voltage for detection #threshV_ch6: 0.5 # optional, threshold voltage for detection #threshV_ch7: 0.5 # optional, threshold voltage for detection #threshV_ch8: 0.5 # optional, threshold voltage for detection

Member Function Documentation

◆ configure()

def fast_counter_fpga_qo.FastCounterFPGAQO.configure (   self,
  bin_width_s,
  record_length_s,
  number_of_gates = 0 
)

Configuration of the fast counter.

Parameters
floatbin_width_s: Length of a single time bin in the time trace histogram in seconds.
floatrecord_length_s: Total length of the timetrace/each single gate in seconds.
intnumber_of_gates: optional, number of gates in the pulse sequence. Ignore for not gated counter.
Returns
tuple(binwidth_s, gate_length_s, number_of_gates): binwidth_s float the actual set binwidth in seconds gate_length_s the actual set gate length in seconds number_of_gates the number of gated, which are accepted

◆ continue_measure()

def fast_counter_fpga_qo.FastCounterFPGAQO.continue_measure (   self)

Continues the current measurement.

If fast counter is in pause state, then fast counter will be continued.

◆ get_binwidth()

def fast_counter_fpga_qo.FastCounterFPGAQO.get_binwidth (   self)

Returns the width of a single timebin in the timetrace in seconds.

Returns
float: current length of a single bin in seconds (seconds/bin)

◆ get_constraints()

def fast_counter_fpga_qo.FastCounterFPGAQO.get_constraints (   self)

Retrieve the hardware constrains from the Fast counting device.

Returns
dict: dict with keys being the constraint names as string and items are the definition for the constaints.

The keys of the returned dictionary are the str name for the constraints (which are set in this method).

        NO OTHER KEYS SHOULD BE INVENTED!

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 all files containing this interface.

The items of the keys are again dictionaries which have the generic dictionary form: {'min':

, 'max':

, 'step':

, 'unit': '

'}

Only the key 'hardware_binwidth_list' differs, since they contain the list of possible binwidths.

If the constraints cannot be set in the fast counting hardware then write just zero to each key of the generic dicts. Note that there is a difference between float input (0.0) and integer input (0), because some logic modules might rely on that distinction.

ALL THE PRESENT KEYS OF THE CONSTRAINTS DICT MUST BE ASSIGNED!

◆ get_data_trace()

def fast_counter_fpga_qo.FastCounterFPGAQO.get_data_trace (   self)

Polls the current timetrace data from the fast counter.

Returns
numpy.array: 2 dimensional numpy ndarray. This counter is gated. The return array has the following shape: returnarray[gate_index, timebin_index]

The binning, specified by calling configure() in forehand, must be taken care of in this hardware class. A possible overflow of the histogram bins must be caught here and taken care of.

◆ get_status()

def fast_counter_fpga_qo.FastCounterFPGAQO.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

◆ is_gated()

def fast_counter_fpga_qo.FastCounterFPGAQO.is_gated (   self)

Check the gated counting possibility.

Returns
bool: Boolean value indicates if the fast counter is a gated counter (TRUE) or not (FALSE).

◆ pause_measure()

def fast_counter_fpga_qo.FastCounterFPGAQO.pause_measure (   self)

Pauses the current measurement.

Fast counter must be initially in the run state to make it pause.

◆ start_measure()

def fast_counter_fpga_qo.FastCounterFPGAQO.start_measure (   self)

Start the fast counter.

◆ stop_measure()

def fast_counter_fpga_qo.FastCounterFPGAQO.stop_measure (   self)

Stop the fast counter.


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