# ACCES I/O Products, Inc.

## AD12/16 DLL Driver Documentation

## Overview

There are five functions exported by this DLL: AD1216_Setup(), AD1216_Go(), AD1216_Status(), AD1216_Stop(), and AD1216_GetData(). Each function is also exported in underscored form(i.e, _AD1216_Setup()); these are equivalent.

## AD1216_Setup()

`

function AD1216_Setup(ulBase: LongWord; ubIRQ: Byte; iReservedA: SmallInt; iReservedB: SmallInt; ubStartStop: Byte; loBipolar: WordBool; dfGain: Double; var lpdfRate: Double; lNumPoints: LongInt): LongInt; cdecl;

long AD1216_Setup(DWORD ulBase, byte ubIRQ, int iReservedA, int iReservedB, byte ubStartStop, WORD loBipolar, double dfGain, double *lpdfRate, long lNumPoints)

`

### Comments

AD1216_Setup() should be called first for each point set to acquire.

### Parameters

- ulBase: The card's base address.
- ubIRQ: The card's IRQ.
- iReservedA: Reserved. Set this parameter to zero.
- iReservedB: Reserved. Set this parameter to zero.
- ubStartStop: The start/stop channel range, as described in the manual.
- loBipolar: The card will convert from a unipolar range if false(zero), or a bipolar range if true(otherwise).
- dfGain: The gain needed to translate the range into a 0-10V or ±5V signal. For instance, in ±2.5V mode, dfGain should be 2.0.
- lpdfRate: A double containing the rate at which to acquire data, in Hz. In C, a pointer to it must be explicitly passed. AD1216_Setup() will change this double to be the actual rate data will be acquired at(which will be as close to the value passed to it as possible).
- lNumPoints: the number of points in the point set.

### Return Values

If the function succeeds, it returns zero.

If it fails, it returns nonzero. To get extended error information, call GetLastError().

AD1216_Setup() also provides data via the lpdfRate parameter.

## AD1216_Go()

`

function AD1216_Go: LongInt; cdecl;

long AD1216_Go()

`

### Comments

AD1216_Go() initiates the acquisition of a point set.

### Parameters

This function receives no parameters.

### Return Values

If the function succeeds, it returns zero.

If it fails, it returns nonzero. To get extended error information, call GetLastError().

## AD1216_Status()

`

function AD1216_Status: LongInt; cdecl;

long AD1216_Status()

`

### Comments

AD1216_Status() can be called to get the number of points yet to be acquired in the point set.

### Parameters

This function receives no parameters.

### Return Values

If the function succeeds, it returns the number of points remaining. This value will be zero or greater.

If it fails, it returns a negative value. To get extended error information, call GetLastError().

## AD1216_Stop()

`

function AD1216_Stop: LongInt; cdecl;

long AD1216_Stop()

`

### Comments

AD1216_Stop() ceases point list acquisition.

### Parameters

This function receives no parameters.

### Return Values

If the function succeeds, it returns zero.

If it fails, it returns nonzero. To get extended error information, call GetLastError().

## AD1216_GetData()

`

function AD1216_GetData(lpBuf: Pointer; ulBufSize: DWORD): LongInt; cdecl;

long AD1216_GetData(void *lpBuf, DWORD ulBufSize)

`

### Comments

AD1216_GetData() retrieves the point list acquired as an array of single values.

### Parameters

- lpBuf: A pointer to the first byte of the array to place the data into.
- ulBufSize: The length, in bytes, of the array.

### Return Values

If the function succeeds, it returns the number of bytes actually placed in memory. This value will be zero or greater.

If it fails, it returns a negative value. To get extended error information, call GetLastError().