| CAEN FERS Library v1.1.4 SDK for FERS systems

Functions
Calibration
API » A5256 adapter
Collaboration diagram for Calibration:

## Functions
int | FERS_FindMemThrDest (int handle)
| Find the source where calibration is stored (if present EEPROM is default) More...
int | FERS_ReadThrCalib (int handle, int npts, int MemThrDest, char *date, float *ThrOffset)
| Read threshold calibration offsets from flash memory. More...
int | FERS_Set_DiscrThreshold (int handle, int Adapter_ch, float thr_mv, int brd)
| Set the discriminator threshold. More...
int | FERS_CalibThresholdOffset (int handle, float min_thr, float max_thr, int *done, float *ThrOffset, float *RMSnoise, void(*ptr)(char *msg, int progress))
| Calibate the threshold offset of A5256 adapter. More...
int | FERS_WriteThrCalib (int handle, int npts, int MemThrDest, float *ThrOffset)
| Write Threshold offset calibration of A5256 adapter to flash. More...

## Detailed Description

## Function Documentation

## ◆ FERS_FindMemThrDest()

int FERS_FindMemThrDest | ( | int | handle | ) |

Find the source where calibration is stored (if present EEPROM is default)

Parameters

  [in] | Board | handle

Returns
  Source code (0 = flash, 1 = EEPROM)

## ◆ FERS_ReadThrCalib()

int FERS_ReadThrCalib | ( | int | handle,
|  | int | npts,
|  | int | MemThrDest,
|  | char * | date,
|  | float * | ThrOffset
| ) |  |

Read threshold calibration offsets from flash memory.

Parameters

  [out] | date | Pointer to the calibration date (DD/MM/YYYY)
  [out] | ThrOffset | Pointer to the threshold offsets values
  [in] | MemThrDest | Flag indicating the source (0 = flash, 1 = EEPROM) (see FERS_FindMemThrDest function)
  [in] | handle | Board handle
  [in] | npts | Number of points to read

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_Set_DiscrThreshold()

int FERS_Set_DiscrThreshold | ( | int | handle,
|  | int | Adapter_ch,
|  | float | thr_mv,
|  | int | brd
| ) |  |

Set the discriminator threshold.

Parameters

  [in] | handle | Board handle
  [in] | Adapter_ch | Adapter channel identifier
  [in] | thr_mv | Threshold in millivolts
  [in] | brd | Board identifier

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_CalibThresholdOffset()

int FERS_CalibThresholdOffset | ( | int | handle,
|  | float | min_thr,
|  | float | max_thr,
|  | int * | done,
|  | float * | ThrOffset,
|  | float * | RMSnoise,
|  | void(*)(char *msg, int progress) | ptr
| ) |  |

Calibate the threshold offset of A5256 adapter.

Parameters

  [out] | ThrOffset | Threshold offsets
  [out] | done | Calibration completed, per channel
  [out] | RMSnoise | Standard deviation of threshold offset
  [out] | ptr | Callback function to report progress
  [in] | handle | handle of the board to calibrate
  [in] | min_thr | minimum threshold fo the scan
  [in] | max_thr | maximum threshold for the scan (not true)

Returns
  0 in case of success, or a negative error code specified in FERSLIB_ErrorCodes

## ◆ FERS_WriteThrCalib()

int FERS_WriteThrCalib | ( | int | handle,
|  | int | npts,
|  | int | MemThrDest,
|  | float * | ThrOffset
| ) |  |

Write Threshold offset calibration of A5256 adapter to flash.

Warning
  The flash memory contains vital parameters for the board. Overwriting certain pages can damage the hardware!!! Do not use this function without contacting CAEN first

Parameters

  [in] | handle | handle of the board to calibrate
  [in] | npts | number of values to write
  [in] | MemThrCalib | Flag indicating the source (0 = flash, 1 = EEPROM) (see FERS_FindMemThrDest function)
  [in] | ThrOffset | Threshold offsets (use NULL pointer to keep old values)

Returns
  0 in case of success, or a negative error code specified in FERSLIB_ErrorCodes