|
CAEN FERS Library v1.3.0
SDK for FERS systems
|
In order to use the library, just include the FERSlib.h header in your project:
The Visual Studio FERSlib project is already compiled for x86_64 architecture. The FERSlib.lib is available at .\ferslib\lib, and must be added in your Visual Studio project settings. The corresponding shared library ferslib.dll is found in the path .\FERSlib\bin\x64\Release.
By default libcaenferslib.so is installed in the system library directory: add the patht to the LD_LIBRARY_PATH and pass -lcaenferslib to the linker to use it.
To connect to a device, just call the FERS_OpenDevice() that provides the handle to the FERS module:
The Data readout buffers for each connectd board must be initialized manually by calling FERS_InitReadout():
which provides the total allocated memory for the buffers.
Eventually, FERS_CloseReadout() releases all data readout buffers and FERS_CloseDevice() close the connection:
The BoardPath in FERS_OpenDevice must be formed as: [ConnType]:[Address]. E.g.: in ethernet connection you can pass the IPv4 address
in usb you can use both board PID (i.e. 23475) or progressive enumeration:
in TDlink you pass the DT5215 eth IP, the chain and the node the board is connected, as eth:[DT5215_IP]:tdl:[CHAIN][NODE]:
The FERSlibLog file is enabled by default and saved in the folder where the .exe is running. User may enable other debug logging by setting the parameter DebugLogMask to <0xVALUE>, where <0xVALUE> can be an OR of the values in DebugLOG.
The user can configure the FERS module setting the prameters available in CfgParam both individually by using FERS_SetParam()
or by reading a configuration file with FERS_LoadConfigFile()
The parameters value is saved statically inside the library and can be retrieved with FERS_GetParam()
The board will be configured only after calling FERS_configure()
For debug, both the local parameters value and the board register value can be dump on a file by setting the DebugLogMask to the correct Mask in DebugLOG.
A run starts after the FERS_StartAcquisition() is called.
The data taken are decoded inside the library and available to the user by FERS_GetEvent()
The event data qualifier dtq must be the same set in the AcquisitionMode parameter.
The user can cast the read event to the corresponding data type described in DataStructures So the Event pointer is converted in a readable format.
In case of error, API functions return a negative value described in FERSLIB_ErrorCodes. Extended information about the last error occurred can be retrieved using FERS_GetLastError():
For example, it can be used to get a detailed message of a failed call to FERS_OpenDevice():