Programmer's Guide

RaDeKL Radar API Programmer’s Guide 33
© Multispectral Solutions, Inc. 2006
RaDeKL_WriteRegister
Note: This is a low-level function and should only be used if you are familiar with the RaDeKL
Radar registers and their layouts. Normal operation of the RaDeKL Radar should require only the
use of the high-level functions described above.
Write a data BYTE into one of RaDeKL Radar’s registers. No checking is performed to see if the data was
written correctly, making this function suitable for write-only registers. If verification is required, use
RaDeKL_WriteCheckRegister instead.
Format:
ULONG RaDeKL_WriteRegister (RaDeKL_HANDLE handle, WORD addr, BYTE value);
Parameters:
handle RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
addr 16-bit address of the register to modify. See the appendix for register definitions.
value 8-bit value to put into the requested register.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Write DETECT_SINGLE (1) into REGISTER_DETECT at address 1. This triggers a single detection and the
transmission of the range bin data.
ULONG status;
RaDeKL_HANDLE handle;
BYTE data[2048]; // Make this sufficiently large
// Assume we have an open radar with a valid handle
status = RaDeKL_WriteRegister (handle, REGISTER_DETECT, DETECT_SINGLE);
// Check status . . .
// Read the range bin data
status = RaDeKL_ReadDetectionData (handle, data);
// Check status . . .