beautypg.com

Controlling the device, Device initialization, Error handling – Dataman 570 Series User Manual

Page 7: Data acquisition loop

background image


Development kit for DATAMAN 570 series

Programmer’s Guide

2. Controlling the device

2.1. Device initialization

First of all, it is necessary to load the driver using thr function LoadDriver.

LoadDriver;

After the driver is loaded, it is possible to initialize the device using the function
InitHardware. This function also returns the information for the calibration data.

var CalibOK:byte;
begin
InitHardware(CalibOK);

2.2. Error handling

In case the error occurs, all subsequent calls of functions will fail. Therefore it is
necessary to check if the operations were successful (for example check if the
initialization was successful). Use GetDKError to obtain the error code.

var res:integer;
begin
res:=GetDKError;



In case of an error, it is necessary to reset the error flag (to indicate to the DK, that
the error has been handled). Use ResetDKError function to do so (otherwise no other
function will be successful).

ResetDKError;

2.3. Data acquisition loop

The data acquisition process can be started by calling StartMeasurement function.

StartMeasurement;

After the data acqusition starts, the software must wait until the data is ready in the
device. Use IsDataReady function to check the acquisition status.

if IsDataReady = DATA_READY then begin
end;


When the data is ready for transfer to the computer (return value DATA_READY), it
is possible to transfer them to the computer using GetData function.

var
lng:integer;

- 7 -