class spirack.B2b_module(spi_rack, module, calibrate=False)
SPI Rack interface code for the B2b ADC module: a 2 channel 24-bit ADC module with integrated ARM Cortex M4 microcontroller. It is used to connect to two neighbouring IVVI rack measurement modules. In hardware it is identical to the D4b module, the only difference being the absence of connectors on the front of the module. In contrast to the D4a module, a microcontroller in the module handles all the communication with the ADCs. This allows for exactly timed ADC updates: based on triggers, timers etc.
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)
This will run a gain and offset calibration routine on the B2b module. The function will stall until the routine is finished, which takes about 2 seconds.
This function return true if the module is running a measurement, should be used to check if data can be read.
Returns - True if the module is running a measurement
Sets the amount of triggers expected.
Gets the amount of triggers expected.
Returns - amount of triggers (int)
Sets the amount of samples that the ADC channel takes per trigger.
Gets the amount of samples that the ADC channel takes per trigger.
Returns - amount of samples per trigger for the given ADC (int)
Gets the firmware version of the module
Returns - firmware version of the module (int)
Enables given ADC channel
Gets the status of the ADC channel: if it is enabled or not.
Returns - the enabled status of the given ADC channel
Sends a software trigger to the ADC module to take the amount of samples specified by
set_sample_amount. This can be used for example to take standalone measurements or to take an FFT measurement.
Reads back all the data from the module.
Returns - ADC0, ADC1: numpy arrays of float. None if ADC is not enabled.
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 and long. If the run gets cancelled, the status gets updated to reflect this.
Resets the module to the IDLE state. This should be called after all the data has been read.
Sets the time the system waits after the trigger with a resolution of 100ns.
See ‘set_trigger_holdoff_time’ for details.
Returns - The set holdoff_time in seconds.
The filter rate (together with the filter type) determines the cutoff frequency, sample rate, the resolution and the 50 Hz rejection. See the filter table to determine which setting to use.
Returns the ADC filter setting of the given ADC. See the filter table to interpret the result.
Returns - the current filter setting (int)
The ADC filter can be set to two different types: ‘sinc3’ or ‘sinc5’. The filter type determines (with the filter rate) the cutoff frequency, sample rate, the resolution and the 50 Hz rejection. See the filter table to determine which setting is correct for your application.
Returns the filter type of the given ADC.
Returns - the current filter type (string)
Sets the trigger input location for the ADC module. If it is set to ‘None’, no external triggers will start the module: it will only start via the
software_trigger function. Otherwise it will trigger on rising edges from either the controller module or the D5b.
Gets the trigger input location
Returns - the currently set trigger input location (string)
Gives the sample rate in seconds of the ADC. This corresponds to the values in the filter table. These values can be used for plotting or a FFT calculation.
Returns - the sample rate in seconds (float)