Triangulation Laser Sensors, RF605 Series
RF605 [Revision 2.0] 10th January 2011 valid for sensors with serial numbers 11000 and higher
29
16. Examples
EXAMPLE 1
HANDLE
hRF60x
= INVALID_HANDLE_VALUE;
DWORD
dwValue;
USHORT
usMeasured;
RF60XHELLOANSWER hlans;
// Clear structure RF60xHELLOANSWER
memset(&hlans, 0x00, sizeof(RF60xHELLOANSWER));
// Open COM-port
if (!RF60X_OpenPort("COM2:", CBR_9600, &hRF60X)
return (FALSE);
// Interrogate device
if (RF60X_HelloCmd( hRF60x, 1, &hlans ))
{
/////////////////////////////////////////////////
//
//
// After successful execution of RF60x_HelloCmd//
// the structure hlans contains information //
// about RF605 sensor that responded to request//
//
//
/////////////////////////////////////////////////
//Read parameter: Laser brightness
RF60x_ReadParameter(
hRF60x,
1,
RF60x_PARAMETER_LASER_BRIGHT,
&dwValue
);
/* dwValue contains laser brightness values */
//Obtain distance values from RF605 sensor
RF60x_Measure( hRF60x, 1, &usMeasured );
/* usMeasured contains measurement result */
}
RF60x_ClosePort( hRF60x );
Содержание RF603 Series
Страница 1: ......