Programmer's Guide

RaDeKL Radar API Programmer’s Guide 16
© Multispectral Solutions, Inc. 2006
Part IV: Radar Parameter Functions
RaDeKL_SetThresholds
Set the DAC Threshold values in the radar device.
NOTE: There are currently 32 DAC Threshold registers with permissible values in the range from
20 to 227, but the actual number of registers and permissible values should be obtained by calling
RaDeKL_GetDeviceInfo and using thresholds, threshold_min and threshold_max, as these might
change with future versions of the radar unit.
The default values for the 32 DAC Threshold registers start at 20 (DAC 1) and are evenly spread up to 227
(DAC 32).
Format:
ULONG RaDeKL_SetThresholds (RaDeKL_HANDLE handle, BYTE *thresholds);
Parameters:
handle RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
thresholds A BYTE array of sufficient size to hold all DAC Threshold register values (currently
32).
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Add 10 to all DAC Threshold values (assuring that the max is not exceeded).
ULONG status;
RaDeKL_HANDLE handle;
RaDeKL_DEVICEINFO info;
BYTE thresholds[256]; // Declare a reasonably large number
// Assume we have an open radar with a valid handle
status = RaDeKL_GetDeviceInfo (handle, &info);
// Check status . . .
// Get the current DAC Threshold values
status = RaDeKL_GetThresholds (handle, thresholds);
// Check status . . .
// Add 10 to ALL registers (limited by threshold_max) and print the values
for (i = 0; i < info.thresholds; i++)
{
thresholds[i] = min (thresholds[i]+10, info.threshold_max);
printf (“DAC Threshold register %2d changed to %d\n”, i, thresholds[i]);
}
// Set the modified DAC Threshold values
status = RaDeKL_SetThresholds (handle, thresholds);
// Check status . . .