You may also be interested in
Linear encoder, Monochrome camera, Laser sensor, CMOS camera, Scanner
Text version of the page
Triangulation Laser Sensors, RF603 Series
EXAMPLE 2 (how to get a stream of result)
HANDLE
INVALID_HANDLE_VALUE;
USHORT
RF60xHELLOANSWER
hRF60x
=
usMeasured;
hlans;
memset(&hlans, 0x00, sizeof(RF60xHELLOANSWER));
RF60x_OpenPort("COM2:", CBR_9600, &hRF60x);
if (RF60x_HelloCmd( hRF60x, 1, &hlans ))
{
printf("Dev modify\t: %d\r\nDev type\t: %d\r\nDev max dist\t:
%d\r\nDev range\t: %d\r\nDev serial\t: %d\r\n",
hlans.bDeviceModificaton,
hlans.bDeviceType,
hlans.wDeviceMaxDistance,
hlans.wDeviceRange,
hlans.wDeviceSerial
);
39
if (!RF60x_WriteParameter( hRF60x, 1,
RF60x_PARAMETER_SAMPLING_PERIOD, 500 ))
return (-1);
if (!RF60x_StartStream(hRF60x, 1))
return (-1);
RF60x_GetStreamMeasure(hRF60x, &usMeasured);
printf("Measure \t: %d\r\n", usMeasured);
RF60x_GetStreamMeasure(hRF60x, &usMeasured);
printf("Measure \t: %d\r\n", usMeasured);
RF60x_StopStream(hRF60x, 1);
} else printf("rs232 error!\r\n");
RF60x_ClosePort( hRF60x );
EXAMPLE 3 (how to get a result with latching)
for (int i=0;i<100;i++)
{
// Result latching
RF60x_LockResult(hRF60x, 1);
// Result receiving
RF60x_Measure( hRF60x, 1, &usMeasured);
printf("Measure-l
\t: %d\r\n", usMeasured);
}
You can find examples of programs for LabView here:
www.riftek.com/resource/files/rf60x_labview_example.zip
You can find examples of programs for Visal Basic 6 here
www.riftek.com/resource/files/rf60x-vb.zip
RF603 [Revision 2.0] 10th January 2011
valid for sensors with serial numbers 11000 and higher
|
|