SciSDK Library
SDK for SciCompiler projects
|
Caen board uses a custom endpoint to readout data with the host using accelerated DMA transfers and DDR4 memory. This driver is compatible with the following boards:
The SciCompiler project must be created as DPP project. Scope firmware uses the OpenScope driver.
Refere to the Board endpoint driver documentation to understand how to configure and read board specific parameters.
Each board has a specific API set to configure framework paramenters that are outside the scope of SciCompiler project. This board parameters are accessible through the following path:
board0:/boardapi/
This path is a virtual path that is mapped to the board specific framework control endpoint. All read/write operations are performed directly to the board SDK and it is managed by the SDK.
For FELib compatible board (CAEN X274X) the board specific API is accessible through the following path:
board0:/boardapi/felib/
any path after the last /
is mapped to the board specific SDK. For example:
board0:/boardapi/felib/ch/0/par/ChEnable
ask to the FELib SDK to set/read the ChEnable
parameter of the channel 0.
The documentation of the board specific API is available in the board SDK documentation
Data type in SetParameter must be STRING, indeed just the SCISDK_SetParameterString function is supported because the felib requires all parameters to be a string.
The OpenDPP driver uses a custom data structure to store the data readout from the board. Aldo the documentation of felib explain that the user may customize which field are stored in the data structure, the OpenDPP driver uses the following fixed structure:
channel
: Channel (7 bits)
timestamp
: Timestamp (48 bits)
timestamp_ns
: Timestamp in nanoseconds (51 bits)
fine_timestamp
: Fine timestamp (10 bits)
energy
: Energy (16 bits)
flags_b
: Event low priority flags (12 bits). See Low Priority.
flags_a
: Event high priority flags (8 bits). See High Priority.
psd
: Pulse Shape Discrimination (16 bits)
user_info
: User Info word
user_info_size
: Number of User Info word
truncated
: Set if the event is truncated
waveform
: Waveform samples
waveform_size
: Number of waveform samples.
board_fail
: Set if the logical AND between of the ErrorFlag and ErrorFlagDataMask is not 0. Present in all the events
special_event
: Set if Special event
event_size
: Total event raw size, useful for statistics and to discriminate between compressed events (if == 8, see EnDataReduction) and standard events (if > 8).
flush bool
: Flush of the aggregate word. Shared by all the events in the aggregate. Useful for debug purposes.
aggregate_counter
: Aggregate counter section in the Event Aggregate structure. Shared by all the events
Refer to the FELib documentation for more information.
The digitizers must be armed before can start any acquisition:
In case of start source is set to software start, this will start an acquisition run:
Similarly, to send a software stop and disarm the acquisition:
To read data from the digitizer as soon as it becomes available, the easier approach is to implement a loop around the SCISDK_ReadData()
function, as demonstrated in the provided demo.
If an event is already available in the endpoint, the function returns immediately with NI_OK
. The main difference compared to the OpenScope framework is that, in this case, the event consists of information from only a single channel. If no events are available within 10 seconds, it returns NI_TIMEOUT
. Once acquisition has stopped, any remaining data stored in the digitizer can still be read until the function returns NI_LAST
, indicating that no more data is available from that acquisition session.
These return values can be used to build an efficient acquisition loop. The following code snippet illustrates this logic:
In case of success the function will return one event at the time.
Configure the board to readout channel 0,1,2 and store the data in a csv file, trigger comes from SciCompiler trigger to each channel FIFO.