Zebra Technologies RADEKL Radar Development Kit User Manual Programmers Guide

Zebra Technologies Corporation Radar Development Kit Programmers Guide

Contents

Programmers Guide

Download: Zebra Technologies RADEKL Radar Development Kit User Manual Programmers Guide
Mirror Download [FCC.gov]Zebra Technologies RADEKL Radar Development Kit User Manual Programmers Guide
Document ID853778
Application IDOwmT8eg50PTXIPhZDy4dcw==
Document DescriptionProgrammers Guide
Short Term ConfidentialNo
Permanent ConfidentialNo
SupercedeNo
Document TypeUser Manual
Display FormatAdobe Acrobat PDF - pdf
Filesize13.09kB (163631 bits)
Date Submitted2007-10-12 00:00:00
Date Available2007-10-12 00:00:00
Creation Date2007-10-12 08:09:54
Producing SoftwareAcrobat Distiller 6.0.1 (Windows)
Document Lastmod2007-10-12 08:09:54
Document TitleMicrosoft Word - RaDeKL API Programmer's Guide rev 2.doc
Document CreatorPScript5.dll Version 5.2.2
Document Author: jwarnell

®
MULTISPECTRAL SOLUTIONS, INC. ®
RaDeKL Radar API for Windows
Radar Developer’s Kit – Lite – Application Programming Interface
Programmer's Guide
Version 2.0
Revised: 05 OCT 07
© 2006 Multispectral Solutions, Inc.
20300 Century Boulevard
Germantown, MD 20874-1132
Phone: (301) 528-1745
Fax: (301) 528-1749
Website: www.multispectral.com
NOTE: The RaDeKL radar unit has been tested to comply with FCC Part 15, Subpart C for WBT devices.
Changes or modifications to the radiating elements of RaDeKL not expressly approved by the party
responsible for compliance could void the user’s authority to operate the equipment.
NOTE: The RaDeKL radar unit has been tested and found to comply with the limits for a Class B digital
device, pursuant to part 15 of the FCC Rules. These limits are designed to provide reasonable protection
against harmful interference in a residential installation. This equipment generates, uses and can radiate
radio frequency energy and, if not installed and used in accordance with the instructions, may cause
harmful interference to radio communications. However, there is no guarantee that interference will not
occur in a particular installation. If this equipment does cause harmful interference to radio or television
reception, which can be determined by turning the equipment off and on, the user is encouraged to try to
correct the interference by one or more of the following measures:
—Reorient or relocate the receiving antenna.
—Increase the separation between the equipment and receiver.
—Connect the equipment into an outlet on a circuit different from that to which the receiver is connected.
—Consult the dealer or an experienced radio/TV technician for help.
RaDeKL Radar API Programmer’s Guide
Table of Contents
Part I: Welcome to the RaDeKL Radar API....................................................................1
Introduction.................................................................................................................................... 1
USB Driver Installation.................................................................................................................. 1
Programming Notes ...................................................................................................................... 3
Usage Warnings............................................................................................................................. 4
Part II: Status Formatting Functions .............................................................................5
RaDeKL_GetStatusText ................................................................................................................ 5
RaDeKL_GetAPIVersion................................................................................................................ 7
Part III: Radar Management Functions ..........................................................................8
RaDeKL_ListRadars ...................................................................................................................... 8
RaDeKL_ListRadarsCleanup...................................................................................................... 10
RaDeKL_OpenRadar ................................................................................................................... 11
RaDeKL_CloseRadar................................................................................................................... 12
RaDeKL_GetDeviceInfo............................................................................................................... 13
RaDeKL_ResetRadar................................................................................................................... 14
RaDeKL_FlushIO ......................................................................................................................... 15
Part IV: Radar Parameter Functions ............................................................................16
RaDeKL_SetThresholds.............................................................................................................. 16
RaDeKL_GetThresholds ............................................................................................................. 17
RaDeKL_SetTransmitAttenuation.............................................................................................. 18
RaDeKL_GetTransmitAttenuation ............................................................................................. 19
RaDeKL_SetReceiveAttenuation ............................................................................................... 20
RaDeKL_GetReceiveAttenuation ............................................................................................... 21
RaDeKL_SetRangeDelay............................................................................................................. 22
RaDeKL_GetRangeDelay ............................................................................................................ 23
RaDeKL_SetInterval .................................................................................................................... 24
RaDeKL_GetInterval .................................................................................................................... 25
RaDeKL_SimulatorMode............................................................................................................. 26
Part V: Radar Detection Functions ..............................................................................27
RaDeKL_DetectSingle ................................................................................................................. 27
RaDeKL_StartContinuousDetection .......................................................................................... 28
RaDeKL_StopContinuousDetection .......................................................................................... 30
RaDeKL_ReadDetectionData...................................................................................................... 31
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
II
Part VI: Radar Register Functions ...............................................................................32
RaDeKL_WriteCheckRegister .................................................................................................... 32
RaDeKL_WriteRegister ............................................................................................................... 33
RaDeKL_ReadRegister................................................................................................................ 34
Part VII: Low-Level Data I/O Functions........................................................................35
RaDeKL_SendCommand ............................................................................................................ 35
RaDeKL_ReceiveResponse........................................................................................................ 36
Part VIII: Appendix ........................................................................................................38
RaDeKL_DEVICEINFO Field Definitions.................................................................................... 38
RaDeKL Radar Register Definitions .......................................................................................... 39
RaDeKLAPI.H Header File Listing.............................................................................................. 41
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
Part I: Welcome to the RaDeKL Radar API
Introduction
The RaDeKL Radar API provides a programming interface to the Multispectral Solution Inc. (MSSI)
RaDeKL Radar device. Using this interface removes the burden of designing code to access the USB
interface and dealing with the specifics of radar commands and operational parameter settings. Instead, this
interface provides a set of RaDeKL Radar specific functions to list available devices, open/close a specific
radar device, set operational parameters and request single and continuous range detection data.
Please refer to the enclosed folder “Code Example” for a complete and functional code example (in C) on
how to list devices, open a device, set operational parameters, read range detection data and close the
device.
USB Driver Installation
The RaDeKL Radar USB port is based on the FTDI FT2232C USB Chip, which requires a driver to operate.
Note: Do not download any updated drivers directly from the FTDI website! The RaDeKL Radar
uses a custom PID (Product ID) in the USB definition and therefore requires a custom driver.
Please use only the driver provided with RaDeKL Radar devices.
Before the RaDeKL Radar device can be used, the USB driver must be installed. This driver can only be
installed if a RaDeKL Radar device is physically plugged into the USB port. Windows then detects the
presence of a new USB device and uses its Plug & Play feature to aid in the installation of the driver.
Please follow these steps:
1. Ensure that you are running Windows 2000, Windows XP (or newer) on the target PC and that the
PC has an available USB 2.0 (not 1.1 or 1.2) port. Have an A-B USB cable ready.
2. Extract the distribution ZIP file, containing the API and driver files. Note the location of the resulting
folder. It should contain a sub-folder named “Driver”.
3. Connect the RaDeKL Radar device to the power supply and insert the power supply into a suitable
electrical AC outlet (120 VAC).
4. Connect the RaDeKL Radar device to a free USB 2.0 port on your PC or laptop.
5. Windows should detect the new USB device and start the Found New Hardware Wizard.
6. Windows XP:
a. Click “No, not at this time” and then “Next”.
b. Click “Install from a list or specific location” and then “Next”.
c.
Click “Search for the best driver in these locations” and “Include this location in the search”.
Click “Browse” and navigate to the folder noted in step 2 and then down to the “Driver”
folder. Click “OK” and then “Next”.
d. Windows XP will find the correct MSSI IUO driver and display a warning about the driver
not having passed Windows Logo testing. Click “Continue Anyway”.
e. Windows will then detect a second USB device. Repeat the above steps for Windows XP to
complete installation.
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
7. Windows 2000:
a. Click “Search for a suitable driver for my device”. Click “Next”.
b. Check the box “Specify a location”. Click “Next”.
c.
Click “Browse” and navigate to the folder noted in step 2 and then down to the “Driver”
folder. Select the file named “FTDIBUS.inf” and click “OK” and then “Next”.
d. The driver will install. Windows will then detect a second USB device and the driver will
install automatically.
8. Note: The additional USB device installed represents an unused internal port on the USB chip. This
port is not used by RaDeKL Radar and can be entirely ignored. However, during driver installation,
Windows will detect this unused port and insist on installing a driver for it.
9. The RaDeKL Radar is now ready for use. The driver needs to be installed only once for each PC. If
it ever needs to be upgraded, use the Windows Device Manager, ensuring that the radar device is
physically plugged in and powered up.
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
Programming Notes
In order to use the RaDeKL Radar API, please follow these steps (illustrated using Visual C++ 6.0):
1. Copy FTD2XX.h, RaDeKLAPI.h and RaDeKLAPI.lib (from subfolder “Library” in the folder noted in
step 2 above, “USB Driver Installation “) into the folder that contains the development environment
of your project. Ensure that the files are copied (not moved) otherwise you won’t find them for the
next project.
2. Include RaDeKLAPI.h in your C program:
#include "RaDeKLAPI.h"
Note: RaDeKLAPI.h implicitly includes FTD2XX.h
3. Include RaDeKLAPI.lib in your project link command:
In Visual C++ (6.0), click Project > Settings. Select “All Configurations” and “Link”. Add
RaDeKLAPI.lib to the “Object/library modules” as follows:
Note: The FTD2XX.lib library is already included in RaDeKLAPI.lib and therefore does not
need to be included in your project link, nor does it need to be present in your development
environment folder. RaDeKLAPI.lib is entirely self-contained.
You can now use the RaDeKL API functions to operate the radar unit. The next section documents the
usage of the various RaDeKL API functions available.
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
Usage Warnings
For proper operation of the RaDeKL radar unit using this API, please consider these warnings:
1. When operating the RaDeKL Radar in continuous detection mode, range data is continuously
streamed from the radar unit to the PC. While in this mode, the only operation, other than reading
this data, should be to stop continuous mode (using RaDeKL_StopContinuousDetection or a lowlevel register write to do the same). Do not issue any other register read and/or write commands
(or high-level functions that read/write registers), as this will interfere with the continuous data
stream presented in continuous detection mode. Note: most functions that update (write) RaDeKL
registers attempt to read the data back to ensure that it was written correctly. Therefore any writeregister function (RaDeKL_SetXxxxx) will result in a read after write, which will interfere with an
ongoing continuous detection, producing unpredictable results (most likely resulting in an
input/output error). If a register must be updated, please first stop continuous detection mode,
change the register value and then restart continuous detection mode.
2. When operating the RaDeKL Radar in continuous detection mode and an error occurs (i.e. the
return value of the function called, if specified, is not equal RaDeKL_OK), it is up to the caller to:
a. Attempt to stop continuous detection mode on the radar unit by issuing a call to
RaDeKL_StopContinuousDetection. Depending on the specific error, it might not be
possible to actually communicate this command to the radar. The return code of this call
should therefore be ignored in this case only.
b. Ensure that the user interface or GUI appropriately shows that the radar is no longer
operating in continuous mode. This may entail updating indicators or graying out buttons.
c.
In many error cases it may be necessary to close (if possible) and re-open the radar device
in order to re-establish communications with the unit (using RaDeKL_CloseRadar and
RaDeKL_OpenRadar, respectively). In some (rare) cases the unit may have to be either
power-cycled or unplugged and re-connected to the USB cable. Contrary to the FTDI USB
Chip documentation, this cannot always be done under program control.
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
Part II: Status Formatting Functions
RaDeKL_GetStatusText
Get the text associated with a status code. Most functions in this API return a numeric status code.
RaDeKL_OK (0) indicates successful completion. Other codes (see below) indicate error conditions.
Format:
char *RaDeKL_GetStatusText (ULONG ftStatus);
Parameters:
ftStatus
Numeric status code as returned by most RaDeKL API functions.
Return Value:
Pointer to a null-terminated character string containing the status description.
Possible Status Codes:
Symbol
FTDI specific status codes
RaDeKL_OK
RaDeKL_INVALID_HANDLE
RaDeKL_DEVICE_NOT_FOUND
RaDeKL_DEVICE_NOT_OPENED
RaDeKL_IO_ERROR
RaDeKL_INSUFFICIENT_RESOURCES
RaDeKL_INVALID_PARAMETER
RaDeKL_INVALID_BAUD_RATE
RaDeKL_DEVICE_NOT_OPENED_FOR_ERASE
RaDeKL_DEVICE_NOT_OPENED_FOR_WRITE
RaDeKL_FAILED_TO_WRITE_DEVICE
RaDeKL_EEPROM_READ_FAILED
RaDeKL_EEPROM_WRITE_FAILED
RaDeKL_EEPROM_ERASE_FAILED
RaDeKL_EEPROM_NOT_PRESENT
RaDeKL_EEPROM_NOT_PROGRAMMED
RaDeKL_INVALID_ARGS
RaDeKL_NOT_SUPPORTED
RaDeKL_OTHER_ERROR
RaDeKL API specific status codes
RaDeKL_READ_TIMEOUT
RaDeKL_WRITE_TIMEOUT
RaDeKL_INCORRECT_SERIAL_NUMBER
RaDeKL_WRITE_REGISTER_FAILED
RaDeKL_READ_REGISTER_FAILED
RaDeKL_READ_DETECTION_FAILED
RaDeKL_BAD_THRESHOLD
RaDeKL_BAD_TX_ATTEN
RaDeKL_BAD_RX_ATTEN
RaDeKL_BAD_RANGE_DELAY
RaDeKL_BAD_INTERVAL
RaDeKL_UNKNOWN_RESOLUTION
Value
Description Text
10
11
12
13
14
15
16
17
18
Operation completed successfully
Invalid handle passed to function
Requested device not found
Specified device not open
Input/output error
Insufficient resources to complete operation
Invalid parameter passed to function
Invalid baud rate specified
Specified device not open for erase
Specified device not open for write
Failed to write to specified device
EEPROM read failed
EEPROM write failed
EEPROM erase failed
EEPROM not present
EEPROM not programmed
Invalid arguments passed to function
Operation not supported
USB unknown error
201
202
203
204
205
206
207
208
209
210
211
212
Read from radar has timed out
Write to radar has timed out
Serial number opened does not match request
Register write failed
Register read failed
Detection data read failed
Invalid threshold(s) specified
Invalid transmit attenuation specified
Invalid receive attenuation specified
Invalid range delay specified
Invalid interval specified
Radar has an unknown resolution
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
Example:
Make a RaDeKL API function call to list available devices and display an error message if the call failed.
ULONG
DWORD
char
status;
numdevs;
**snum = 0, **desc = 0;
status = RaDeKL_ListRadars (&numdevs, &snum, &desc);
if (status != RaDeKL_OK)
printf (“Unable to list devices: %s\n”, RaDeKL_GetStatusText (status));
return status;
// All OK
return RaDeKL_OK;
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
RaDeKL_GetAPIVersion
Retrieve the version number of this API. The major version number is in the high-order word and the minor
version number is in the low-order word. See example for details of usage.
NOTE: The Version information returned by this function is the version of this API, not the version
of any radar unit attached. To obtain radar unit version information, use function
RaDeKL_GetDeviceInfo after the radar has been opened.
Format:
ULONG RaDeKL_GetAPIVersion ();
Parameters:

Return Value:
ULONG (32 bits) with the major version number in the high-order WORD (16 bits) and the minor
version number in the low-order WORD (16 bits).
Example:
Get and display the major and minor version numbers of this API.
ULONG
WORD
WORD
version;
major_version;
minor_version;
version = RaDeKL_GetAPIVersion ();
major_version = (WORD)((version >> 16) & 0xFFFF);
minor_version = (WORD)(version & 0xFFFF);
printf (“This API is version %d.%d\n”, major_version, minor_version);
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
Part III: Radar Management Functions
RaDeKL_ListRadars
Get a list of all RaDeKL Radar devices connected to the system. Note: This function will only retrieve
RaDeKL Radar devices and will ignore other devices that may be based on the same FTDI USB Chip.
Each device has a serial number (up to 15 chars) and a device description (up to 63 chars). The serial
number can then be used in a call to RaDeKL_OpenRadar to open the device. The serial number is unique
to each unit sold, whereas the description string is unique to a particular version (or model) of RaDeKL
Radars and may change with future versions.
Format:
ULONG RaDeKL_ListRadars (DWORD *numdevs, char ***serial_numbers, char ***descriptions);
Parameters:
numdevs
Pointer to a DWORD to receive the device count. This may be NULL, in which
case no device count is returned.
serial_numbers
Pointer to a pointer to a (null-terminated) list of character strings to receive the
serial numbers of the connected devices. (*numdevs) should initially be NULL, as
the function allocates the list and the individual strings. See example for
clarification. If NULL is passed as numdev, no serial numbers are returned.
descriptions
Pointer to a pointer to a (null-terminated) list of character strings to receive the
descriptions of the connected devices. (*descriptions) should initially be NULL, as
the function allocates the list and the individual strings. See example for
clarification. If NULL is passed as descriptions, no descriptions are returned.
Return Value:
RaDeKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Remarks:
This function will automatically allocate the storage required for the serial number and description lists and
the associated character strings. If valid pointers are passed in, the existing storage (as allocated by a
previous call to RaDeKL_ListRadars) will first be de-allocated before the new lists are allocated. This way
the designer does not need to bother maintaining these lists (i.e. simplifying re-scanning of connected radar
units), as long as the pointers are initially set to NULL. See examples below for clarification. Any remaining
lists will be de-allocated when the program terminates. If the design requires an explicit de-allocation of the
lists, use RaDeKL_ListRadarsCleanup described below.
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
Example 1:
List all available radar units and display the information obtained.
ULONG
status, i;
DWORD
numdevs;
static char **snum = NULL, **desc = NULL;
// or make these global
status = RaDeKL_ListRadars (&numdevs, &snum, &desc);
if (status != RaDeKL_OK)
printf (“Unable to list devices: %s\n”, RaDeKL_GetStatusText (status));
return;
printf (“Number of devices detected: %d\n”, numdevs);
for (i = 0; i < numdevs; i++)
printf (“Device %d, Serial: %s, Description: %s\n”, i, snum[i], desc[i]);
Example 2:
Alternately, if we don’t care about the number of devices or their descriptions, the following code segment
will return only the (null-terminated) list of serial numbers:
ULONG
status;
static char **snum = NULL;
char
**s;
// or make this global
status = RaDeKL_ListRadars (NULL, &snum, NULL);
if (status != RaDeKL_OK)
printf (“Unable to list devices: %s\n”, RaDeKL_GetStatusText (status));
return;
for (s = snum; *s; s++)
printf (“Serial Number: %s\n”, *s);
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
10
RaDeKL_ListRadarsCleanup
De-allocates the memory that was allocated in a previous call to RaDeKL_ListRadars. Normally, this is not
required as each successive call to RaDeKL_ListRadars de-allocates these lists and Windows will do the
final de-allocation when the program terminates. However, if the design calls for an explicit de-allocation,
this function can be used.
Format:
void RaDeKL_ListRadarsCleanup (char **list);
Parameters:
list
Pointer to a (null-terminated) list of character strings to de-allocate.
Return Value:
No return value. This function cannot fail.
Example:
List all available radar units and display the information obtained.
ULONG
status, i;
DWORD
numdevs;
static char **snum = NULL, **desc = NULL;
// or make these global
status = RaDeKL_ListRadars (&numdevs, &snum, &desc);
if (status != RaDeKL_OK)
printf (“Unable to list devices: %s\n”, RaDeKL_GetStatusText (status));
return;
printf (“Number of devices detected: %d\n”, numdevs);
for (i = 0; i < numdevs; i++)
printf (“Device %d, Serial: %s, Description: %s\n”, i, snum[i], desc[i]);
// De-allocate the lists
RaDeKL_ListRadarsCleanup (snum); snum = NULL;
RaDeKL_ListRadarsCleanup (desc); snum = NULL;
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
11
RaDeKL_OpenRadar
Open a RaDeKL Radar device as identified by its serial number. Serial numbers are unique for each
specific unit. A list of all available RaDeKL Radar devices and their serial numbers is obtained by calling
RaDeKL_ListRadars.
Format:
ULONG RaDeKL_OpenRadar (RaDeKL_HANDLE *handle_ptr, char *serial_number);
Parameters:
handle_ptr
Pointer to a RaDeKL_HANDLE to receive the handle for the opened device. All
further operations on that device will use this handle.
serial_number Pointer to a (null-terminated) character string containing the serial number of the
device to open. A list of all available RaDeKL Radar devices and their serial
numbers is obtained by calling RaDeKL_ListRadars.
Return Value:
RaDeKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Open (and close) the first radar unit found.
ULONG
DWORD
static char
static RaDeKL_HANDLE
status;
numdevs;
**snum = NULL, **desc = NULL;
handle = NULL;
// or make these global
// or make this global
status = RaDeKL_ListRadars (&numdevs, &snum, &desc);
if (status != RaDeKL_OK)
printf (“Unable to list devices: %s\n”, RaDeKL_GetStatusText (status));
return;
if (numdevs == 0)
printf (“No devices available\n”);
return;
status = RaDeKL_OpenRadar (&handle, snum[0]);
if (status != RADEKL_OK)
printf (“Open failed: %s\n”, RaDeKL_GetStatusText (status));
return;
// Do some work and then close the radar and set the handle to NULL
RaDeKL_CloseRadar (handle);
handle = NULL;
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
12
RaDeKL_CloseRadar
Close a RaDeKL Radar device previously opened by a call to RaDeKL_OpenRadar.
Format:
ULONG RaDeKL_CloseRadar (RaDeKL_HANDLE handle);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Remarks:
It is highly recommended that you set the handle to NULL after calling this function to avoid accidental use
of a closed handle. See the example for RaDeKL_OpenRadar above.
Example:
See the example for RaDeKL_OpenRadar above.
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
13
RaDeKL_GetDeviceInfo
Get the device-specific information of a RaDeKL Radar associated with the handle.
Format:
ULONG RaDeKL_GetDeviceInfo (RaDeKL_HANDLE handle, RaDeKL_DEVICEINFO *info);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
info
Pointer to a RaDeKL_DEVICEINFO structure. See the appendix for field definitions
of this structure.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Remarks:
RaDeKL_GetDeviceInfo should be called after RaDeKL_OpenRadar to obtain device-versionspecific information. The currently available RaDeKL units all have a resolution of 1 foot (= 2), 256
range bins (with a data range of 0 to 32), 32 DAC threshold registers (with a data range of 20 to
227). This may change in future units and the info returned by RaDeKL_GetDeviceInfo should be
used in your application instead of hard-coding these values.
Example:
List device-specific information.
ULONG
RaDeKL_HANDLE
RaDeKL_DEVICEINFO
status;
handle;
info;
// Assume we have an open radar with a valid handle
status = RaDeKL_GetDeviceInfo (handle, &info);
// Check status . . .
// Print information
printf (“Serial number:
printf (“Description:
printf (“Vendor ID:
printf (“Product ID:
printf (“Resolution:
printf (“Range bins:
printf (“Range bin max:
printf (“Thresholds:
printf (“Threshold min:
printf (“Threshold max:
printf (“Version:
%s\n”, info.ft_serial_number);// String
%s\n”, info.ft_description); // String
%4X\n”, info.ft_vendor_id);
// 16-bit hex
%4X\n”, info.ft_product_id);
// 16-but hex
%d\n”, info.resolution);
// 1 = 6-inch, 2 = 1-foot
%d\n”, info.range_bins);
// Currently 256
%d\n”, info.range_bin_max);
// Currently 32
%d\n”, info.thresholds);
// Currently 32
%d\n”, info.threshold_min);
// Currently 20
%d\n”, info.threshold_max);
// Currently 227
v%d.%d\n”, info.version_id_major, info.version_id_minor);
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
14
RaDeKL_ResetRadar
Perform a reset on the radar, resetting the device to factory settings and purging the send and receive
buffers.
NOTE: Resetting the radar causes all radar registers to be reset to factory default values. That
means that the settings for DAC thresholds, TX and RX attenuation, range delay and detection
intervals may no longer be the same as what the application thinks they are. It is strongly
recommended to re-send all pertinent register values to the radar after calling this function to
ensure that the application and the actual radar unit are in sync.
Format:
ULONG RaDeKL_ResetRadar (RaDeKL_HANDLE handle);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Perform a reset on a RaDeKL Radar device.
ULONG
RaDeKL_HANDLE
status;
handle;
// Assume we have an open radar with a valid handle
status = RaDeKL_ResetRadar (handle);
// Check status . . .
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
15
RaDeKL_FlushIO
Flushes (purges) the transmit and receive buffers on the USB port the radar is connected to. Note that this
does not necessarily flush the data on the FPGA radar processor chip ports. This function is intended only
to flush the data waiting on the USB chip ports. To properly reset the RaDeKL radar device, use
RaDeKL_ResetRadar instead.
Format:
ULONG RaDeKL_FlushIO (RaDeKL_HANDLE handle);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Flush the USB transmit and receive ports.
ULONG
RaDeKL_HANDLE
status;
handle;
// Assume we have an open radar with a valid handle
status = RaDeKL_FlushIO (handle);
// Check status . . .
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
16
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
RaDeKL_HANDLE
RaDeKL_DEVICEINFO
BYTE
status;
handle;
info;
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 . . .
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
17
RaDeKL_GetThresholds
Get the DAC Threshold values from 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.
Format:
ULONG RaDeKL_GetThresholds (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:
See the example given for RaDeKL_SetThresholds above.
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
18
RaDeKL_SetTransmitAttenuation
Set the TRANSMIT POWER ATTENUATION register in the radar device.
NOTE: Transmit attenuation settings can currently be in the range from 0 to 63, but the actual
range of permissible settings should be obtained by calling RaDeKL_GetDeviceInfo and using
tx_atten_min and tx_atten_max, as these might change with future versions of the radar unit.
Format:
ULONG RaDeKL_SetTransmitAttenuation (RaDeKL_HANDLE handle, BYTE attenuation);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
attenuation
A BYTE indicating the attenuation to be set. Permissible attenuation values are in
the range from 0 to 63. Reference values are:
Value
Attenuation
63
0 dB (default)
57
-3 dB
51
-6 dB
43
-10 dB
The attenuation (in dB) or the register value are calculated as:
attenuation_dB = (register_value – 63) / 2
and
register_value = (2 * attenuation_dB) + 63
Note: attenuations are usually negative values! Attenuation_dB in the above
calculations must therefore be a negative number.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Set the TRANSMIT ATTENUATION register to a value of 33 (-10 dB).
ULONG
RaDeKL_HANDLE
status;
handle;
// Assume we have an open radar with a valid handle
status = RaDeKL_SetTransmitAttenuation (handle, 33);
// Check status . . .
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
19
RaDeKL_GetTransmitAttenuation
Get the TRANSMIT POWER ATTENUATION register value from the radar device.
NOTE: Transmit attenuation settings can currently be in the range from 0 to 63, but the actual
range of permissible settings should be obtained by calling RaDeKL_GetDeviceInfo and using
tx_atten_min and tx_atten_max, as these might change with future versions of the radar unit.
Format:
ULONG RaDeKL_GetTransmitAttenuation (RaDeKL_HANDLE handle, BYTE *attenuation);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
attenuation
Pointer to a BYTE to receive the attenuation value. Possible attenuation values are
in the range from 0 to 63. Reference values are:
Value
Attenuation
63
0 dB (default)
57
-3 dB
51
-6 dB
43
-10 dB
The attenuation (in dB) or the register value are calculated as:
attenuation_dB = (register_value – 63) / 2
and
register_value = (2 * attenuation_dB) + 63
Note: attenuations are usually negative values! Attenuation_dB in the above
calculations must therefore be a negative number.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Read the TRANSMIT ATTENUATION register and display its value.
ULONG
RaDeKL_HANDLE
BYTE
status;
handle;
attenuation;
// Assume we have an open radar with a valid handle
status = RaDeKL_GetTransmitAttenuation (handle, &attenuation);
// Check status . . .
printf (“The TRANSMIT ATTENUATION is currently set to %d\n”, attenuation);
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
20
RaDeKL_SetReceiveAttenuation
Set the RECEIVE ATTENUATION register in the radar device.
NOTE: Receive attenuation settings can currently be in the range from 0 to 255, but the actual
range of permissible settings should be obtained by calling RaDeKL_GetDeviceInfo and using
rx_atten_min and rx_atten_max, as these might change with future versions of the radar unit.
Format:
ULONG RaDeKL_SetReceiveAttenuation (RaDeKL_HANDLE handle, BYTE attenuation);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
attenuation
A BYTE indicating the attenuation to be set. Permissible attenuation values are in
the range from 0 to 255. Reference values are:
Value
Attenuation
0 dB (default)
31
-5 dB
81
-10 dB
125
-15 dB
155
-20 dB
180
-30 dB
For the receive attenuation there is no function to convert between register value
and attenuation. The above values are derived from experimentation. The user
may use any register value between 0 and 255 and use the above table as a rough
guide for the resulting attenuation.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Set the RECEIVE ATTENUATION register to a value of 91 (-10 dB).
ULONG
RaDeKL_HANDLE
status;
handle;
// Assume we have an open radar with a valid handle
status = RaDeKL_SetReceiveAttenuation (handle, 91);
// Check status . . .
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
21
RaDeKL_GetReceiveAttenuation
Get the RECEIVE ATTENUATION register value from the radar device.
NOTE: Receive attenuation settings can currently be in the range from 0 to 255, but the actual
range of permissible settings should be obtained by calling RaDeKL_GetDeviceInfo and using
rx_atten_min and rx_atten_max, as these might change with future versions of the radar unit.
Format:
ULONG RaDeKL_GetReceiveAttenuation (RaDeKL_HANDLE handle, BYTE *attenuation);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
attenuation
Pointer to a BYTE to receive the attenuation value. Possible attenuation values are
in the range from 0 to 255. Reference values are:
Value
Attenuation
0 dB (default)
31
-5 dB
81
-10 dB
125
-15 dB
155
-20 dB
180
-30 dB
For the receive attenuation there is no function to convert between register value
and attenuation. The above values are derived from experimentation. The user
may use any register value between 0 and 255 and use the above table as a rough
guide for the resulting attenuation.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Read the RECEIVE ATTENUATION register and display its value.
ULONG
RaDeKL_HANDLE
BYTE
status;
handle;
attenuation;
// Assume we have an open radar with a valid handle
status = RaDeKL_GetReceiveAttenuation (handle, &attenuation);
// Check status . . .
printf (“The RECEIVE ATTENUATION is currently set to %d\n”, attenuation);
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
22
RaDeKL_SetRangeDelay
Set the RANGE and DELAY registers in the radar device. These two registers shift the return data by a
certain number of range bins. To simplify implementations, this function accepts a RangeDelay in feet and
converts it to the required register values. The default value is 0 feet.
Format:
ULONG RaDeKL_SetRangeDelay (RaDeKL_HANDLE handle,
DWORD delay_feet, DWORD *actual_delay_feet);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
delay_feet
A DWORD indicating the requested delay value in feet. Do not use a value
larger than the maximum range of the radar device.
actual_delay_feet
Pointer to a DWORD to receive the actual delay set. This may be NULL, in
which case no actual delay is returned. The actual delay may differ from the
requested one, since the hardware allows delays only in certain increments (8
feet in the current model). If necessary, the requested value is rounded down
to the nearest increment.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Set the RangeDelay to 32 feet.
ULONG
RaDeKL_HANDLE
DWORD
status;
handle;
actual;
// Assume we have an open radar with a valid handle
status = RaDeKL_SetRangeDelay (handle, 32, &actual);
// Check status . . .
printf (“Range Delay set to %d feet\n”, actual);
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
23
RaDeKL_GetRangeDelay
Get the RangeDelay from the radar device by reading the RANGE and DELAY registers and converting the
values to feet.
Format:
ULONG RaDeKL_GetRangeDelay (RaDeKL_HANDLE handle, DWORD *delay_feet);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
delay_feet
Pointer to a DWORD to receive the delay value in feet.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Read the RangeDelay and display its value.
ULONG
RaDeKL_HANDLE
DWORD
status;
handle;
delay;
// Assume we have an open radar with a valid handle
status = RaDeKL_GetRangeDelay (handle, &delay);
// Check status . . .
printf (“The DELAY is currently set to %d feet\n”, delay);
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
24
RaDeKL_SetInterval
Set the automatic detection interval for continuous detection mode. When the radar is in continuous mode,
a new detection is performed each time this interval expires. The default setting is INTERVAL_50_MS.
NOTE: There are currently 5 distinct interval settings (see table below), but the actual range of
permissible settings should be obtained by calling RaDeKL_GetDeviceInfo and using interval_min
and interval_max, as these might change with future versions of the radar unit.
Format:
ULONG RaDeKL_SetInterval (RaDeKL_HANDLE handle, BYTE interval);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
interval
A BYTE indicating the requested interval. Permissible interval values are:
Symbolic Constant
Duration
Value
INTERVAL_1_SEC
1 second
INTERVAL_500_MSEC
500 milliseconds
INTERVAL_250_MSEC
250 milliseconds
INTERVAL_100_MSEC
100 milliseconds
INTERVAL_50_MSEC (default)
50 milliseconds
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Set the continuous detection interval to 100 milliseconds.
ULONG
RaDeKL_HANDLE
status;
handle;
// Assume we have an open radar with a valid handle
status = RaDeKL_SetInterval (handle, INTERVAL_100_MS);
// Check status . . .
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
25
RaDeKL_GetInterval
Get the automatic detection interval for continuous detection mode in milliseconds.
NOTE: There are currently 5 distinct interval settings (see table below), but the actual range of
permissible settings should be obtained by calling RaDeKL_GetDeviceInfo and using interval_min
and interval_max, as these might change with future versions of the radar unit.
Format:
ULONG RaDeKL_GetInterval (RaDeKL_HANDLE handle, BYTE *interval);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
interval
Pointer to a BYTE to receive the interval value. Possible interval values are:
Symbolic Constant
Duration
Value
INTERVAL_1_SEC
1 second
INTERVAL_500_MSEC
500 milliseconds
INTERVAL_250_MSEC
250 milliseconds
INTERVAL_100_MSEC
100 milliseconds
INTERVAL_50_MSEC (default)
50 milliseconds
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Read the continuous detection interval and display its value.
ULONG
RaDeKL_HANDLE
BYTE
status;
handle;
interval;
// Assume we have an open radar with a valid handle
status = RaDeKL_GetInterval (handle, &interval);
// Check status . . .
printf (“The interval for
switch (interval)
case INTERVAL_1_SEC:
case INTERVAL_500_MS:
case INTERVAL_250_MS:
case INTERVAL_100_MS:
case INTERVAL_50_MS:
continuous detection is currently set to “);
printf
printf
printf
printf
printf
(“1 second\n”);
(“500 ms\n”);
(“250 ms\n”);
(“100 ms\n”);
(“50 ms\n”);
break;
break;
break;
break;
break;
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
26
RaDeKL_SimulatorMode
The RaDeKL Radar API provides a transparent radar simulation mode. This allows programs using this API
to be tested without the need to have an actual RaDeKL Radar unit present. By default, Simulator Mode is
disabled, causing communications to occur with an actual radar device. In situations where an actual radar
unit is unavailable for testing of the software, simulation mode may be enabled, resulting in the proper and
expected behavior of all API functions with these considerations:
1. RaDeKL_ListRadars will detect four simulated radar units with serial numbers “SIM001”,
“SIM002”, “SIM003” and “SIM004” and a description of “RaDeKL Simulator”.
2. Any RaDeKL API function may be called for these simulated radar units, including detection
functions.
3. Detection will result in range bin data representing a dampened sine wave, rotating over time
(or successive detections) for SIM001 and other diagnostic waveforms for SIM002 - SIM004.
4. Since there is no physical communication to an actual radar unit, some error paths in the
program may not be sufficiently tested using Simulator Mode.
Format:
bool RaDeKL_SimulatorMode (bool enable);
Parameters:
enable
Flag to enable (true) or disable (false) the RaDeKL Simulator Mode.
Return Value:
The previous value of the RaDeKL Simulator Mode.
Remarks:
Normally, this function would be called at the start of your program, before any potential radar units
have been opened. However, if a program switches dynamically between Simulator and actual
radar modes, ensure that any open radar devices (real or simulated) are closed first using
RaDeKL_CloseRadar. Toggling Simulator Mode will cause RaDeKL_ListRadars to return a different
list of available radar devices. Therefore a call to RaDeKL_SimulatorMode should always be
followed by a call to RaDeKL_ListRadars to refresh the list of available devices.
Example:
Enable the RaDeKL Simulator mode.
ULONG
status;
DWORD
numdevs;
static char **snum = NULL, **desc = NULL;
// or make these global
RaDeKL_SimulatorMode (true);
printf (“The RaDeKL Simulation Mode is now enabled\n”);
status = RaDeKL_ListRadars (&numdevs, &snum, &desc);
// Check status . . .
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
27
Part V: Radar Detection Functions
RaDeKL_DetectSingle
Perform a single radar detection and return the range bin data.
NOTE: The number of range bins is currently 256 with possible data values between 0 and 32, but
the actual number of range bins and the range of their possible values should be obtained by
calling RaDeKL_GetDeviceInfo and using range_bins, range_bin_min and range_bin_max, as they
might change with future versions of the radar unit.
Format:
ULONG RaDeKL_DetectSingle (RaDeKL_HANDLE handle, BYTE *data);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
data
Pointer to a BYTE array to receive the radar return data.
Note: This array is not null-terminated, since zeroes may appear in the data.
Note: the size of this array and the maximum value for each range bin are currently
fixed at 256 and 32, respectively, but might change with future versions. See notes
above.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Initiate a single detection and print the range bin data.
ULONG
RaDeKL_HANDLE
RaDeKL_DEVICEINFO
BYTE
status, i;
handle;
info;
data[2048];
// Make this sufficiently large
// Assume we have an open radar with a valid handle
status = RaDeKL_GetDeviceInfo (handle, &info);
// Check status . . .
status = RaDeKL_DetectSingle (handle, data);
// Check status . . .
for (i = 0; i < info.range_bins; i++)
printf (“Range bin [%3d] contains: %d\n”, i, data[i]);
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
28
RaDeKL_StartContinuousDetection
Start continuous detection, with a new detection occurring each interval set with RaDeKL_SetInterval. This
function is intended to be used in conjunction with RaDeKL_ReadDetectionData and
RaDeKL_StopContinuousDetection.
Note: Unless there is an initially known fixed number of detections to be performed, continuous
detection may require a separate thread to execute RaDeKL_ReadDetectionData, or otherwise it
may be impossible to issue RaDeKL_StopContinuousDetection since RaDeKL_ReadDetectionData
will be in a tight loop waiting for the next detection data to arrive. See examples below for
clarification.
Note: While in continuous detection mode, do not issue any other register read/write functions
(except RaDeKL_StopContinuousDetection) as their processing will interfere with the continuous
data stream returned by the RaDeKL Radar device. See Usage Warnings towards the top of this
document for clarification.
Format:
ULONG RaDeKL_StartContinuousDetection (RaDeKL_HANDLE handle);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example 1:
Process 100 continuous radar detections.
ULONG
RaDeKL_HANDLE
BYTE
status, count;
handle;
data[2048]; // Make this sufficiently large
// Assume we have an open radar with a valid handle
status = RaDeKL_StartContinuousDetection (handle);
// Check status . . .
count = 100;
while (count--)
status = RaDeKL_ReadDetectionData (handle, data);
// Check status . . .
// Do something with the data . . .
//
status = RaDeKL_StopContinuousDetection (handle);
// Check status . . .
// Flush the buffers
status = RaDeKL_FlushIO (handle);
// Check status . . .
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
29
Example 2:
Process continuous radar detections until user stops. This requires 2 threads, one to handle the GUI and
the other to read and process the radar range bin data.
// Global data
RaDeKL_HANDLE
HANDLE
BOOL
handle;
g_hthread;
running = false;
>>> Thread 1 (GUI):
// Assume we have an open radar with a valid handle AND a secondary thread
// User signals to START continuous detection
status = RaDeKL_StartContinuousDetection (handle);
// Check status . . .
// Wake up secondary thread
running = true;
ResumeThread (g_hthread);
// Return to the GUI message loop . . .
// User signals to STOP continuous detection
running = false;
status = RaDeKL_StopContinuousDetection (handle);
// Check status . . .
// Flush the buffers
status = RaDeKL_FlushIO (handle);
// Check status . . .
>>> Thread 2 (read and process loop):
ULONG
BYTE
status;
data[2048]; // Make this sufficiently large
// Assume we have an open radar with a valid handle
while (true)
// Loop this thread forever until the program terminates
while (running) // Loop until the GUI sets running to false
status = RaDeKL_ReadDetectionData (handle, data);
// Check status. Ignore a timeout if running is false
if ((status == RADEKL_OK) || ((!running) && (status == RADEKL_READ_TIMEOUT)))
// Do something with the data . . .
else
printf (“Bad read: %s\n”, RaDeKL_GetStatusText (status));
running = false;
break;
// No longer running - go to sleep
SuspendThread (GetCurrentThread ());
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
30
RaDeKL_StopContinuousDetection
Stop continuous detection. This function is intended to be used in conjunction with
RaDeKL_StartContinuousDetection and RaDeKL_ReadDetectionData.
Format:
ULONG RaDeKL_StopContinuousDetection (RaDeKL_HANDLE handle);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
See the examples for RaDeKL_StartContinuousDetection above.
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
31
RaDeKL_ReadDetectionData
Read and return the range bin data of a single detection in continuous mode. This function is intended to be
used in conjunction with RaDeKL_StartContinuousDetection and RaDeKL_StopContinuousDetection.
NOTE: The number of range bins is currently 256 with possible data values between 0 and 32, but
the actual number of range bins and the range of their possible values should be obtained by
calling RaDeKL_GetDeviceInfo and using range_bins, range_bin_min and range_bin_max, as they
might change with future versions of the radar unit.
Format:
ULONG RaDeKL_ReadDetectionData (RaDeKL_HANDLE handle, BYTE *data);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
data
Pointer to a BYTE array to receive the radar return data.
Note: This array is not null-terminated, since zeroes may appear in the data.
Note: the size of this array and the maximum value for each range bin are currently
fixed at 256 and 32, respectively, but might change with future versions. See notes
for RaDeKL_DetectSingle.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
See the examples for RaDeKL_StartContinuousDetection above.
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
32
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
RaDeKL_HANDLE
status;
handle;
// Assume we have an open radar with a valid handle
status = RaDeKL_WriteCheckRegister (handle, REGISTER_DAC1, 50);
// Check status . . .
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
33
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
RaDeKL_HANDLE
BYTE
status;
handle;
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 . . .
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
34
RaDeKL_ReadRegister
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.
Read a sequence of one or more RaDeKL Radar registers.
Format:
ULONG RaDeKL_ReadRegister (RaDeKL_HANDLE handle, WORD addr,
BYTE count, BYTE *values);
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.
count
8-bit count of successive registers to read.
values
Pointer to an BYTE-array to receive the values of the requested register(s).
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Read and print the value stored in register REGISTER_ID_VERS (0)
ULONG
RaDeKL_HANDLE
BYTE
status;
handle;
version;
// Assume we have an open radar with a valid handle
status = RaDeKL_ReadRegister (handle, REGISTER_ID_VERS, 1, &version);
// Check status . . .
printf (“The version register contains %02X (major = %d, minor = %d)\n”,
version, version >> 4, version & 0xF);
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
35
Part VII: Low-Level Data I/O Functions
RaDeKL_SendCommand
Note: This is a low-level function and should only be used if you are familiar with the RaDeKL
Radar I/O features. Normal operation of the RaDeKL Radar should require only the use of the highlevel functions described above.
Send a command to the RaDeKL Radar. The command must be a read register or a write register
command in the following form:
Read Register (always 5 bytes):
<0x72><0xFF>
Write Register (always 5 bytes):
<0x77><0xFF>
Where: 

is the high byte of the 16-bit register address.
is the low byte of the 16-bit register address.
(See the appendix for register definitions)

is an 8-bit count of registers to read (read command only).

is an 8-bit value to write to the register (write command only).
Format:
ULONG RaDeKL_SendCommand (RaDeKL_HANDLE handle, BYTE *cmd,
DWORD bytes_to_send);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
cmd
Pointer to the 5-byte command.
bytes_to_send
Number of bytes to write (should always be 5, unless a future version
extends the I/O interface).
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
RaDeKL_HANDLE
BYTE
status;
handle;
cmd[5] = {CMD_WRITE, 0, REGISTER_DAC1, 50, CMD_TERM};
// Assume we have an open radar with a valid handle
status = RaDeKL_SendCommand (handle, cmd, 5);
// Check status . . .
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
36
RaDeKL_ReceiveResponse
Note: This is a low-level function and should only be used if you are familiar with the RaDeKL
Radar I/O features. Normal operation of the RaDeKL Radar should require only the use of the highlevel functions described above.
Receive a response from the radar by reading a specified number of bytes. There are two types of
responses, returned register values and a set of range bins resulting from a detection request. They are in
the form:
Returned register values ( + 3 bytes):
...<0xFF>
Range bins from detection ( + 4 bytes [currently 260 bytes]):
<0xEA><0xEA><0xEA><0xFF>
Where: 

is the high byte of the 16-bit register address.
is the low byte of the 16-bit register address.
(See the appendix for register definitions)

is a series of 8-bit register values (returned register values only).

is an 8-bit value from the [n]th range bin (detection only).
RaDeKL_ReceiveResponse returns the entire response, including the possible prefix (0xEA) and the
terminator (0xFF).
Format:
ULONG RaDeKL_ReceiveResponse (RaDeKL_HANDLE handle, BYTE *response,
DWORD bytes_requested, DWORD *bytes_received);
Parameters:
handle
RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
response
Pointer to a BYTE array to receive the data returned.
bytes_requested
DWORD containing the number of bytes to read.
bytes_received
Pointer to a DWORD to receive the number of bytes read.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
37
Example 1:
Read the value of the register at address 7 (REGISTER_DAC1).
ULONG
DWORD
RaDeKL_HANDLE
BYTE
BYTE
status;
bytes_received;
handle;
cmd[5] = {CMD_READ, 0, REGISTER_DAC1, 1, CMD_TERM};
response [1024];
// Make this sufficiently large
// Assume we have an open radar with a valid handle
status = RaDeKL_SendCommand (handle, cmd, 5);
// Check status . . .
status = RaDeKL_ReceiveResponse (handle, response, 4, &bytes_received);
// Check status . . . and ensure that bytes_received == 4
printf (“The value at register DAC 1 is %d\n”, response[2]);
Example 2:
Issue a single detection request and read the range bins returned.
ULONG
DWORD
RaDeKL_HANDLE
BYTE
BYTE
status;
bytes_received;
handle;
cmd[5] = {CMD_WRITE, 0, REGISTER_DETECT, DETECT_SINGLE, CMD_TERM};
response [1024];
// Make this sufficiently large
// Assume we have an open radar with a valid handle
status = RaDeKL_SendCommand (handle, cmd, 5);
// Check status . . .
status = RaDeKL_ReceiveResponse (handle, response, 260, &bytes_received);
// Check status . . . and ensure that cnt == 260 (number of range bins + 4)
// The range bin data is now in response[3] thru response [258].
// response [0], [1] and [2] contain 0xEA and response[259] 0xFF (terminator).
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
38
Part VIII: Appendix
RaDeKL_DEVICEINFO Field Definitions
The following list provides a list of the fields available in the RaDeKL_DEVICEINFO structure, obtained by
calling RaDeKL_GetDeviceInfo. For the actual source-code of the structure definition, see the
RaDeKLAPI.H Header File Listing at the end of the Appendix.
Register Name
Type
FTDI USB Chip specific
ft_handle
ft_device_type
ft_serial_number
ft_description
ft_device_id
ft_product_id
ft_vendor_id
void *
ULONG
char[16]
char[64]
DWORD
WORD
WORD
RaDeKL Radar specific
resolution
BYTE
range_bins
range_bin_min
range_bin_max
thresholds
threshold_min
threshold_max
tx_atten_min
WORD
BYTE
BYTE
BYTE
BYTE
BYTE
BYTE
tx_atten_max
BYTE
rx_atten_min
BYTE
rx_atten_max
BYTE
interval_min
interval_max
Interval
BYTE
BYTE
BYTE
version_id
version_id_minor
BYTE
4 bits
version_id_major
4 bits
Description
Please use these (except Serial Number and Device
Description) only if you are familiar with the FTDI USB Chip
interface.
Handle to the underlying USB device (do not use unless you
are familiar with the FTDI USB chip API FTD2XX.h)
USB device type (see FTD2XX.h for details)
Serial number (null-terminated)
Device description (null-terminated)
USB Chip device id (see FTD2XX.h for details)
USB Chip product id (see FTD2XX.h for details)
USB Chip vendor id (see FTD2XX.h for details)
Please use these values in your code instead of hard-coding
them as configurations and ranges in future versions of the
radar may change.
Resolution (currently RESOLUTION_1FOOT = 2)
Use this value to determine the actual distance represented
between successive range bin data samples.
(See RaDeKLAPI.H for details)
The number of range bins available (currently 256)
Minimum value of a range bin (currently 0)
Maximum value of a range bin (currently 32)
The number of Threshold registers (currently 32)
Minimum value of a Threshold register (currently 20)
Maximum value of a Threshold register (currently 227)
Minimum value for the Transmit Attenuation register
(currently 0)
Maximum value for the Transmit Attenuation register
(currently 63)
Minimum value for the Receive Attenuation register
(currently 0)
Maximum value for the Receive Attenuation register
(currently 255)
Minimum value for the Interval register (currently 0)
Maximum value for the Interval register (currently 4)
Current interval setting. Do not use this field! It is used for
internal purposes and cannot be relied upon within the
context of this API.
Full 8-bit version number of the RaDeKL Radar device
4-bit Minor version number of the RaDeKL Radar device.
This field overlays the low-order 4 bits of version_id.
4-bit Major version number of the RaDeKL Radar device.
This field overlays the high-order 4 bits of version_id.
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
39
RaDeKL Radar Register Definitions
The following list provides the current definition of the RaDeKL Radar registers. These definitions may
change with future versions of the radar device.
Register Name
REGISTER_ID_VERS
REGISTER_DETECT
REGISTER_TID_TIME
REGISTER_RF_CONTROL
REGISTER_TX_ATTEN
REGISTER_RX_ATTEN
REGISTER_RANGE
REGISTER_DELAY
REGISTER_DAC1
REGISTER_DAC2
REGISTER_DAC3
REGISTER_DAC4
REGISTER_DAC5
REGISTER_DAC6
REGISTER_DAC7
REGISTER_DAC8
REGISTER_DAC9
REGISTER_DAC10
REGISTER_DAC11
REGISTER_DAC12
REGISTER_DAC13
REGISTER_DAC14
REGISTER_DAC15
REGISTER_DAC16
REGISTER_DAC17
REGISTER_DAC18
REGISTER_DAC19
REGISTER_DAC20
REGISTER_DAC21
REGISTER_DAC22
REGISTER_DAC23
REGISTER_DAC24
REGISTER_DAC25
REGISTER_DAC26
REGISTER_DAC27
REGISTER_DAC28
REGISTER_DAC29
REGISTER_DAC30
REGISTER_DAC31
REGISTER_DAC32
Address
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Description
Version ID register
Detection command register
Interval for continuous detections
RF Control register
Transmitter attenuation register
Receiver attenuation register
RANGE register (shift by 512 range bins)
DELAY register (shift by 8 range bins)
DAC Threshold setting 1
DAC Threshold setting 2
DAC Threshold setting 3
DAC Threshold setting 4
DAC Threshold setting 5
DAC Threshold setting 6
DAC Threshold setting 7
DAC Threshold setting 8
DAC Threshold setting 9
DAC Threshold setting 10
DAC Threshold setting 11
DAC Threshold setting 12
DAC Threshold setting 13
DAC Threshold setting 14
DAC Threshold setting 15
DAC Threshold setting 16
DAC Threshold setting 17
DAC Threshold setting 18
DAC Threshold setting 19
DAC Threshold setting 20
DAC Threshold setting 21
DAC Threshold setting 22
DAC Threshold setting 23
DAC Threshold setting 24
DAC Threshold setting 25
DAC Threshold setting 26
DAC Threshold setting 27
DAC Threshold setting 28
DAC Threshold setting 29
DAC Threshold setting 30
DAC Threshold setting 31
DAC Threshold setting 32
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
40
All Registers contain one 8-bit binary value (1 byte), allowing for a range between 0 and 255 (decimal) or
0x00 and 0xFF (hexadecimal).
Register Data Definitions:
Register Name
Address
Description
REGISTER_ID_VERS
Read-only register. Writing to this register has
no effect. High-order 4-bits contains major
version number and low-order 4-bits the minor
version number. The RaDeKL_DEVICEINFO
structure returned by RaDeKL_GetDeviceInfo
creates an appropriate union (overlay) to extract
the major and minor version numbers.
REGISTER_DETECT
Write-only register. Setting bit 0 (0x01)
initiates single detect, setting bit 2 (0x04)
initiates continuous detect. Clearing all bits
(0x00) stops continuous detection. The other
bits are for MSSI internal use only.
REGISTER_TID_TIME
Interval for continuous detection. Values are 0
(1 second), 1 (500 ms), 2 (250 ms), 3 (100 ms)
and 4 (50 ms).
REGISTER_RF_CONTROL
Write-only register. Setting bit 0 (0x01) causes
the radar device to be reset to factory settings.
The other bits are for MSSI internal use only.
REGISTER_TX_ATTEN
Sets the transmitter attenuation. Valid settings
are in the range from 0 to 63 (decimal). For
reference, a value of 63 causes 0 dB
attenuation, 57 = -3 dB, 51 = -6 dB and 43 = -10
dB. See function definition of
RaDeKL_SetTransmitAttenuation for more
information.
REGISTER_RX_ATTEN
Sets the receiver attenuation. Valid settings are
in the range from 0 to 255 (decimal). For
reference, a value of 0 causes 0 dB attenuation,
91 = -10 dB and 157 = -20 dB. See function
definition of RaDeKL_SetReceiveAttenuation for
more information.
REGISTER_RANGE
Causes detection to be shifted by 512 range bin
increments (256 feet at 0.5 foot resolution).
REGISTER_DELAY
Causes detection to be shifted by 8 range bin
increments (4 feet at 0.5 foot resolution).
REGISTER_DAC1
thru
REGISTER_DAC32
8 - 39
Contain the 32 DAC Threshold values.
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
41
RaDeKLAPI.H Header File Listing
//##############################################################################
//##############################################################################
//
// RaDeKL API.h
//
// (header file)
//
// The RaDeKL API provides access to the functions of the Multispectral
// Solutions, Inc. (MSSI) RaDeKL Radar product. Please refer to the
// "RaDeKL Radar API Programmer's Guide" for details.
//
//##############################################################################
//##############################################################################
// Include only ONCE
#pragma once
// Include Windows stuff
#include 
#include 
#include 
#include 
// Include the FTDI USB Chip API header
#include "FTD2XX.h"
//
//
// Constant declarations
//
//
// Max sizes for device serial number and description strings
#define SIZE_SERIAL_NUMBER
16
#define SIZE_DESCRIPTION
64
// This string must occur somewhere within the device DESCRIPTION string
#define RaDeKL_DESCRIPTION
"RaDeKL WBT Radar B"
// Status message codes (used in conjunction with the codes from FTD2XX.h)
// --- FTDI specicific status codes
#define RaDeKL_OK
FT_OK
#define RaDeKL_INVALID_HANDLE
FT_INVALID_HANDLE
#define RaDeKL_DEVICE_NOT_FOUND
FT_DEVICE_NOT_FOUND
#define RaDeKL_DEVICE_NOT_OPENED
FT_DEVICE_NOT_OPENED
#define RaDeKL_IO_ERROR
FT_IO_ERROR
#define RaDeKL_INSUFFICIENT_RESOURCES
FT_INSUFFICIENT_RESOURCES
#define RaDeKL_INVALID_PARAMETER
FT_INVALID_PARAMETER
#define RaDeKL_INVALID_BAUD_RATE
FT_INVALID_BAUD_RATE
#define RaDeKL_DEVICE_NOT_OPENED_FOR_ERASE FT_DEVICE_NOT_OPENED_FOR_ERASE
#define RaDeKL_DEVICE_NOT_OPENED_FOR_WRITE FT_DEVICE_NOT_OPENED_FOR_WRITE
#define RaDeKL_FAILED_TO_WRITE_DEVICE
FT_FAILED_TO_WRITE_DEVICE
#define RaDeKL_EEPROM_READ_FAILED
FT_EEPROM_READ_FAILED
#define RaDeKL_EEPROM_WRITE_FAILED
FT_EEPROM_WRITE_FAILED
#define RaDeKL_EEPROM_ERASE_FAILED
FT_EEPROM_ERASE_FAILED
#define RaDeKL_EEPROM_NOT_PRESENT
FT_EEPROM_NOT_PRESENT
#define RaDeKL_EEPROM_NOT_PROGRAMMED
FT_EEPROM_NOT_PROGRAMMED
#define RaDeKL_INVALID_ARGS
FT_INVALID_ARGS
#define RaDeKL_NOT_SUPPORTED
FT_NOT_SUPPORTED
#define RaDeKL_OTHER_ERROR
FT_OTHER_ERROR
// --- RaDeKL API specific status codes
#define RaDeKL_READ_TIMEOUT
#define RaDeKL_WRITE_TIMEOUT
#define RaDeKL_INCORRECT_SERIAL_NUMBER
#define RaDeKL_WRITE_REGISTER_FAILED
#define RaDeKL_READ_REGISTER_FAILED
#define RaDeKL_READ_DETECTION_FAILED
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
Currently
Currently
Currently
Currently
Currently
Currently
Currently
Currently
Currently
Currently
Currently
Currently
Currently
Currently
Currently
Currently
Currently
Currently
Currently
10
11
12
13
14
15
16
17
18
201
202
203
204
205
206
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
#define
#define
#define
#define
#define
#define
RaDeKL_BAD_THRESHOLD
RaDeKL_BAD_TX_ATTEN
RaDeKL_BAD_RX_ATTEN
RaDeKL_BAD_RANGE_DELAY
RaDeKL_BAD_INTERVAL
RaDeKL_UNKNOWN_RESOLUTION
42
207
208
209
210
211
212
// Command codes
#define CMD_READ
#define CMD_WRITE
#define CMD_TERM
#define CMD_DATA
114
119
255
234
// Detection register codes
#define DETECT_SINGLE
#define DETECT_START_CONTINUOUS
#define DETECT_STOP_CONTINUOUS
// RF-Control register codes
#define FIRMWARE_RESET
// Resolution setting constants
#define RESOLUTION_UNKNOWN
#define RESOLUTION_6INCHES
#define RESOLUTION_1FOOT
// Continuous Collection Interval setting constants
#define INTERVAL_1_SEC
#define INTERVAL_500_MS
#define INTERVAL_250_MS
#define INTERVAL_100_MS
#define INTERVAL_50_MS
// Version-Specific limits (see struct RaDeKL_DEVICEINFO below)
#define V1_RESOLUTION
RESOLUTION_1FOOT
#define V1_RANGE_BINS
256
#define V1_RANGE_BIN_MIN
#define V1_RANGE_BIN_MAX
32
#define V1_THRESHOLDS
32
#define V1_THRESHOLD_MIN
20
#define V1_THRESHOLD_MAX
227
#define V1_TX_ATTEN_MIN
#define V1_TX_ATTEN_MAX
63
#define V1_RX_ATTEN_MIN
#define V1_RX_ATTEN_MAX
255
#define V1_INTERVAL_MIN
#define V1_INTERVAL_MAX
// RaDeKL Register addresses (16-bit)
#define REGISTER_ID_VERS
#define REGISTER_DETECT
#define REGISTER_TID_TIME
#define REGISTER_RF_CONTROL
#define REGISTER_TX_ATTEN
#define REGISTER_RX_ATTEN
#define REGISTER_RANGE
#define REGISTER_DELAY
#define REGISTER_DAC1
#define REGISTER_DAC2
#define REGISTER_DAC3
#define REGISTER_DAC4
#define REGISTER_DAC5
#define REGISTER_DAC6
#define REGISTER_DAC7
#define REGISTER_DAC8
#define REGISTER_DAC9
#define REGISTER_DAC10
#define REGISTER_DAC11
#define REGISTER_DAC12
#define REGISTER_DAC13
#define REGISTER_DAC14
#define REGISTER_DAC15
// Version ID register
// Detection command register
// Interval for continuous detections (milliseconds)
// RF Control register
// Transmitter attenuation register
// Receiver attenuation register
// RANGE register (shift by 512 range bins)
// DELAY register (shift by 8 range bins)
// Threshold setting 1
// Threshold setting 2
10 // Threshold setting 3
11 // Threshold setting 4
12 // Threshold setting 5
13 // Threshold setting 6
14 // Threshold setting 7
15 // Threshold setting 8
16 // Threshold setting 9
17 // Threshold setting 10
18 // Threshold setting 11
19 // Threshold setting 12
20 // Threshold setting 13
21 // Threshold setting 14
22 // Threshold setting 15
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
REGISTER_DAC16
REGISTER_DAC17
REGISTER_DAC18
REGISTER_DAC19
REGISTER_DAC20
REGISTER_DAC21
REGISTER_DAC22
REGISTER_DAC23
REGISTER_DAC24
REGISTER_DAC25
REGISTER_DAC26
REGISTER_DAC27
REGISTER_DAC28
REGISTER_DAC29
REGISTER_DAC30
REGISTER_DAC31
REGISTER_DAC32
REGISTER_MAX
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
39
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
43
Threshold setting 16
Threshold setting 17
Threshold setting 18
Threshold setting 19
Threshold setting 20
Threshold setting 21
Threshold setting 22
Threshold setting 23
Threshold setting 24
Threshold setting 25
Threshold setting 26
Threshold setting 27
Threshold setting 28
Threshold setting 29
Threshold setting 30
Threshold setting 31
Threshold setting 32
MUST be same as the last valid register
//
//
// Type definitions
//
//
// Handle to RaDeKL Radar device
typedef PVOID
RaDeKL_HANDLE;
// RaDeKL Radar device-specific info
typedef struct RaDeKL_DEVICEINFO
// FTDI USB Chip specific data
FT_HANDLE
ft_handle;
FT_DEVICE
ft_device_type;
char
ft_serial_number[SIZE_SERIAL_NUMBER];
char
ft_description[SIZE_DESCRIPTION];
union
// This union allows us to overlay the 32-bit device_id
// with the 16-bit product_id and vendor_id
DWORD
ft_device_id;
struct
WORD
ft_product_id; // Low word
WORD
ft_vendor_id;
// High word
};
};
// RaDeKL Radar specific data
BYTE
resolution;
// Currently always
WORD
range_bins;
// Currently always
BYTE
range_bin_min; // Currently always
BYTE
range_bin_max; // Currently always
BYTE
thresholds;
// Currently always
BYTE
threshold_min; // Currently always
BYTE
threshold_max; // Currently always
BYTE
tx_atten_min;
// Currently always
BYTE
tx_atten_max;
// Currently always
BYTE
rx_atten_min;
// Currently always
BYTE
rx_atten_max;
// Currently always
BYTE
interval_min;
// Currently always
BYTE
interval_max;
// Currently always
BYTE
interval;
// Current interval
RESOLUTION_1FOOT
256
32
32
20
227
63
255
setting
union
// This union allows us to overlay the 8-bit version_id
// with the 4-bit major and 4-bit minor version_id
BYTE
version_id;
struct
unsigned int
version_id_minor:4; // Low nibble
unsigned int
version_id_major:4; // High nibble
};
};
} RaDeKL_DEVICEINFO;
© Multispectral Solutions, Inc. 2006
RaDeKL Radar API Programmer’s Guide
44
//
//
// Forward declarations
//
//
// Status reporting utilities
char *RaDeKL_GetStatusText (ULONG errcode);
ULONG RaDeKL_GetAPIVersion ();
// RaDeKL Radar management functions
ULONG RaDeKL_ListRadars (DWORD *cnt, char ***serial_numbers, char ***descriptions);
void RaDeKL_ListRadarsCleanup (char **list);
ULONG RaDeKL_OpenRadar (RaDeKL_HANDLE *handle, char *serial_number);
ULONG RaDeKL_CloseRadar (RaDeKL_HANDLE handle);
ULONG RaDeKL_FlushIO (RaDeKL_HANDLE handle);
ULONG RaDeKL_ResetRadar (RaDeKL_HANDLE handle);
ULONG RaDeKL_GetDeviceInfo (RaDeKL_HANDLE handle, RaDeKL_DEVICEINFO *info);
// RaDeKL Radar parameter functions
ULONG RaDeKL_SetThresholds (RaDeKL_HANDLE handle, BYTE *thresholds);
ULONG RaDeKL_GetThresholds (RaDeKL_HANDLE handle, BYTE *thresholds);
ULONG RaDeKL_SetTransmitAttenuation (RaDeKL_HANDLE handle, BYTE attenuation);
ULONG RaDeKL_GetTransmitAttenuation (RaDeKL_HANDLE handle, BYTE *attenuation);
ULONG RaDeKL_SetReceiveAttenuation (RaDeKL_HANDLE handle, BYTE attenuation);
ULONG RaDeKL_GetReceiveAttenuation (RaDeKL_HANDLE handle, BYTE *attenuation);
ULONG RaDeKL_SetRangeDelay (RaDeKL_HANDLE handle, DWORD delay_feet, DWORD *actual_delay_feet);
ULONG RaDeKL_GetRangeDelay (RaDeKL_HANDLE handle, DWORD *delay_feet);
ULONG RaDeKL_SetInterval (RaDeKL_HANDLE handle, BYTE interval);
ULONG RaDeKL_GetInterval (RaDeKL_HANDLE handle, BYTE *interval);
bool
RaDeKL_SimulatorMode (bool enable);
// RaDeKL Radar detection functions
ULONG RaDeKL_DetectSingle (RaDeKL_HANDLE handle, BYTE *data);
ULONG RaDeKL_StartContinuousDetection (RaDeKL_HANDLE handle);
ULONG RaDeKL_StopContinuousDetection (RaDeKL_HANDLE handle);
ULONG RaDeKL_ReadDetectionData (RaDeKL_HANDLE handle, BYTE *data);
// RaDeKL Radar register functions
ULONG RaDeKL_WriteCheckRegister (RaDeKL_HANDLE handle, WORD addr, BYTE value);
ULONG RaDeKL_WriteRegister
(RaDeKL_HANDLE handle, WORD addr, BYTE value);
ULONG RaDeKL_ReadRegister
(RaDeKL_HANDLE handle, WORD addr, BYTE count, BYTE *values);
// RaDeKL Radar low-level data I/O functions
ULONG RaDeKL_SendCommand
(RaDeKL_HANDLE handle, BYTE *cmd,
DWORD bytes_to_send);
ULONG RaDeKL_ReceiveResponse (RaDeKL_HANDLE handle, BYTE *response, DWORD bytes_requested,
DWORD *bytes_received);
© Multispectral Solutions, Inc. 2006

Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.4
Linearized                      : No
Page Count                      : 48
XMP Toolkit                     : XMP toolkit 2.9.1-13, framework 1.6
About                           : uuid:efb318f9-3b9f-4264-a28f-ff8f5e36abf0
Producer                        : Acrobat Distiller 6.0.1 (Windows)
Create Date                     : 2007:10:12 08:09:54-04:00
Creator Tool                    : PScript5.dll Version 5.2.2
Modify Date                     : 2007:10:12 08:09:54-04:00
Document ID                     : uuid:67458910-815d-4496-a422-efe7612a0b56
Format                          : application/pdf
Creator                         : jwarnell
Title                           : Microsoft Word - RaDeKL API Programmer's Guide rev 2.doc
Author                          : jwarnell
EXIF Metadata provided by EXIF.tools
FCC ID Filing: QCJRADEKL

Navigation menu