class spirack.D5a_module(spi_rack, module, reset_voltages=True, num_dacs=16)
D5a module interface class. This class does the low level interfacing with the D5a module. When creating an instance it requires a SPI_rack class passed as a parameter. The analog span of the DAC module can be set via software for each of the 16 DACs individually.
Setting the voltage can happen via the set_voltage function. Other ways are the change_value_update function, which immediately updates the output of the DAC, or via the change_value function. This function writes the new value to the DAC but does not update the output until the update function is ran.
range_4V_bi. If a voltage jump would occur, then ramp to zero in steps of 10 mV. Defaults to True.
Sets the DAC output voltage and updates the DAC output. The function calculates the DAC value for the given voltage at the currently set DAC span. It will set to max/min when the input voltage exceeds the span and prints out a warning to the user. There will always be a difference between the wanted voltage and the output voltage as long as it is not a multiple of the step size. The calculated value is floored, not rounded.
Returns the smallest voltage step for a given DAC. The function calculates and returns the smallest voltage step of the DAC for the set span. Voltage steps smaller than this will not change the DAC value. It is recommended to only step the DAC in multiples of this value, as otherwise steps might not behave as expected.
Returns - smallest voltage step possible with the DAC in its current setting (float)
Reads current DAC settings. This function reads back the DAC registers of the given DAC for both the code and the span. It calculates the voltage set with the read out span.
Returns - list with voltage (float) and span (int):
Changes the span of the DAC and immediately updates the output of the DAC. Use the constants listed below as argument for the span.
Changes the span of the DAC without updating the output of the DAC. Only updates when
update(DAC) is called. Use the constants listed below as argument for the span.
Changes the DAC value, where
value is an 18-bit integer. Calling this function changes the value of the DAC and immediately updates the output.
Changes the DAC value, where
value is an 18-bit integer. Calling this function changes the value of the DAC, but does not update the output until the
update(DAC) function is called.
Updates the output of the DAC to the set range or output value. This is necessary after using
change_span. These functions write into a double buffer inside the chip, when this function is called it will be put into the output buffer.
|the module number set by the user (must coincide with hardware)
|a list of values of the span for each DAC in the module
|a list of DAC voltage settings last written to the DACs