Programmer's Guide

RaDeKL Radar API Programmer’s Guide 32
© Multispectral Solutions, Inc. 2006
Part VI: Radar Register Functions
RaDeKL_WriteCheckRegister
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. The data is then read back and compared to
ensure that it was, in fact, written correctly.
Note: This function reads the register back to ensure that it was written correctly. Do not use this
function on command registers that have write-only bits (such as REGISTER_DETECT). Use
RaDeKL_WriteRegister instead.
Format:
ULONG RaDeKL_WriteCheckRegister (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 a value of 50 into register at address 8 (REGISTER_DAC1).
ULONG status;
RaDeKL_HANDLE handle;
// Assume we have an open radar with a valid handle
status = RaDeKL_WriteCheckRegister (handle, REGISTER_DAC1, 50);
// Check status . . .