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

Page 7: Data acquisition loop

Advertising
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.

Dim CalibOK As Byte
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.

Dim res As Long
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.

res = IsDataReady()
If res = DATA_READY Then
End If

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.

Dim Data(1048576) As TSample
Dim lng As Long
GetData Data(0), lng

- 7 -

Advertising