![Acuity AccuRange AR500 User Manual Download Page 35](http://html1.mh-extra.com/html/acuity/accurange-ar500/accurange-ar500_user-manual_2844429035.webp)
AR500 User’s Manual
LLL00xxxx – Rev 1.0
28
10.
Software Development Kit (SDK) Descriptions
The AR500 Laser sensor is supplied together with an SDK consisting of:
dynamic library RF60x.dll
file for static linking of DLL to project RF60x.lib,
Definition file RF60x.h.
The SDK allows user to develop his / her own software applications without going
into details of the sensor communications protocol.
10.1
Connection to COM-port (RF60x_OpenPort)
The function RF60x_OpenPort opens COM-port with specified symbolic name,
fills in the pointer to the device descriptor and returns the operation result.
Parameters:
lpPort_Name
–
name of COM-port (e.g., “COM1:”), full syntax for COM-
port name specification see in MSDN, function CreateFile;
dwSpeed
-
operation speed through COM-port. The
parameter is identical to field BaudRate in DCB structure described in MSDN;
lpHandle
-
pointer to the device descriptor;
Returned value:
If COM-port fails to be opened and adjusted, the function will return FALSE,
otherwise if COM-port was opened and adjusted successfully the function will
return TRUE. More detailed information about returned errors can be obtained
using API function GetLastError described in MSDN.
10.2
Disconnect from COM-port (RF60x_ClosePort)
The function RF60x_ClosePort closes COM-port and returns the operation
result:
Parameters:
hHandle
–
descriptor of the device obtained from function
RF60x_OpenPort or CreateFile;
Returned value:
If COM-port fails to be closed, the function will return FALSE, otherwise if
COM-port was closed successfully, the function will return TRUE.
BOOL RF60x_OpenPort(
LPCSTR
lpPort_Name,
DWORD
dwSpeed,
HANDLE *
lpHandle
);
BOOL RF60x_ClosePort(
HANDLE
hHandle
);