class spirack.D5b_module(spi_rack, module, reset_voltages=True)
SPI Rack interface code for the D5b module. An 8 channel 18-bit DAC module with integrated ARM Cortex M4 microcontroller. The DACs used in this module are identical to the D5a module, with the addition of a microcontroller. This microcontroller handles all the communication with the DACs. This allows for exactly timed DAC updates: based on triggers, timers etc.
This class does the low level interfacing with the D5b module. When creating an instance it requires a SPI_rack class passed as a parameter.
range_4V_bi. If a voltage jump would occur, then ramp to zero in steps of 10 mV. Defaults to True.
Set the microcontroller clock source to either a local (inside the module) clock or a clock from the backplane. This allows for multiple modules to run of the same clock. The module expects a 10 MHz clock, either sine wave or square.
Gets the set clock source from the microcontroller.
Returns - the set clock source: ‘internal’ or ‘external’ (string)
set_DAC_span(DAC, span, update=True)
Changes the span of the selected DAC. If update is True the span gets updated immediately. If False, it will update with the next span or value setting.
Gets the software span of the selected DAC.
Returns - Set span of the DAC (string)
Sets the mode of the selected DAC. The DACs can be set to two modes: ‘DC’ or ‘toggle’. In DC mode the output of the DAC gets set statically and remains that way until the next update. In toggle mode the DAC gets toggled between two values. Multiple DACs can be set to toggle. Each DAC can have its own toggle values, but they always share the same toggle amount and toggle time.
Gets the mode of the selected DAC.
Returns - Set mode of the DAC (string)
set_DAC_voltage(self, DAC, voltage, update=True):
Calculates and sets the DAC bit value using the set span and updates the DAC. The DAC value is the value which is output at all times, both in ‘DC’ and in ‘toggle’ mode. It will set the voltage to the max/min of the current span, if the input voltage exceeds these limits. Unless the user takes care of using a voltage which is an integere multiple of the DAC step size, the actual voltage will differ slightly from the requested one. For exact values, use the get_stepsize() function and use only integer multiples.
Calculates and sets the DAC bit value for the positive toggle voltage. All the DACs which are set to ‘toggle’ mode will toggle between positive and negative toggle voltages. The DACs can have individually set positive, negative and normal voltages.
Calculates and sets the DAC bit value for the negative toggle voltage. All the DACs which are set to ‘toggle’ mode will toggle between positive and negative toggle voltages. The DACs can have individually set positive, negative and normal voltages.
Returns the currently set voltage, negative toggle voltage and positive toggle voltage of the given DAC.
Returns - List with voltages: [voltage, negative_toggle_voltage, positive_toggle_voltage]
Sets the time the system waits after the trigger for outputting the toggling DACs. The mimimum time is 30 us, and the resolution is 100ns.
Gets the set trigger holdoff time. See
set_trigger_holdoff_time for details.
Returns - the set holdoff_time in seconds.
Sets the toggle time for all the DACs set to ‘toggle’ mode. The value set is the time how long the DAC stays high or low. It is a multiple of of the 100 ns clock used for the timing, this means sub 100 ns resolution is not possible.
Gets the toggle time for all the DACs set to ‘toggle’ mode. See
set_toggle_time for more details.
Returns - toggle time in seconds (float)
Sets the amount of times the DACs (set to ‘toggle mode’) have to toggle. Generates a trigger on the backplane everytime the toggle happens. It has to be an even number of toggles.
Gets the toggle amount.
Returns - the set toggle amount (int)
When this function is called, it cancels the current run of the module. This can be useful if the toggle amount and/or the toggle time are set wrong or too long.
Returns the smallest voltage step for a given span
Returns - Smallest voltage step possible with span (float)
Gets the firmware version of the D5b module.
Returns - firmware version of the S5b module (int)
This function return true if the module is running a measurement, should be used to check if the module is finished.
Returns - True if the module is running a measurement (bool)
This allows the user to trigger the S5b via software, not using the trigger lines on the backplane of the SPI rack.