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

Page 7: Data acquisition loop

Advertising
background image


Development kit for DATAMAN 770 series

Programmer’s Guide

2. Controlling the device

2.1. Device initialization

First of all, it is necessary to load the driver using the 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.

unsigned char calibok;
InitHardware(&calibok);

2.2. Error handling

In case an 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.

int res
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 acquisition 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)
{
}


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.

TSample data[1024*1024];
int lng;
GetData(&data[0],&lng);

- 7 -

Advertising