# ACCES I/O Products, Inc.

## A1216E DLL Driver Documentation

## Overview

There are five functions exported by this DLL: A1216E_Setup(), A1216E_Go(), A1216E_Status(), A1216E_Stop(), and A1216E_GetData(). Each function is also exported in underscored form(i.e, _A1216E_Setup()); these are equivalent. Each function is also exported in VB form(i.e, VBA1216E_Setup()); these are intended for use from VisualBASIC.

## A1216E_Setup()

`

function A1216E_Setup(ulBase: LongWord; ubIRQ: Byte; iReservedA: SmallInt; iReservedB: SmallInt; lpChannelTable: Pointer; ulCTSize: LongWord; lpGainTable: Pointer; ulGTSize: LongWord; var lpdfRate: Double; lNumPoints: LongInt): LongInt; cdecl;

long A1216E_Setup(DWORD ulBase, byte ubIRQ, int iReservedA, int iReservedB, void *lpChannelTable, DWORD ulCTSize, void *lpGainTable, DWORD ulGTSize, double *lpdfRate, long lNumPoints)

Function VBA1216E_Setup(ByVal ulBase As Long, ByVal ubIRQ As Byte, ByVal iReservedA as Integer, ByVal iReservedB As Integer, ByRef lpChannelTable As Any, ByVal ulCTSize As Long, ByRef lpGainTable As Any, ByVal ulGTSize As Long, ByRef lpdfRate As Double, ByVal lNumPoints As Long) As Long

`

### Description

A1216E_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.
- lpChannelTable: A pointer to the first byte of the array to take channel indices from. Each channel index is a 16-bit signed integer equal to a value from -1 to 255. Values 0-15 indicate AIM-16 channels 0-15 on A1216E channel 0, values 16-31 indicate AIM-16 channels 0-15 on A1216E channel 1, etc. If no AIM-16 is used on a particular A1216E channel, the AIM-16 channel doesn't matter. The value -1 indicates the end of the table.
- ulCTSize: The length, in bytes, of the channel array.
- lpGainTable: A pointer to the first byte of the array to take gain values from. Each gain value is an 8-bit integer with bits 0 and 1 corresponding to GAIN0 and GAIN1 in the ADC command register(i.e, the gain amplifier is set to 10^(gain table value)). bits 2-8 are reserved; set them to zero. The gain table is indexed by channel, using the values in the channel table.
- ulGTSize: The length, in bytes, of the gain array.
- lpdfRate: A double containing the rate at which to acquire data, in Hz. In C, a pointer to such a double. A1216E_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().

A1216E_Setup() also provides data via the lpdfRate parameter.

## A1216E_Go()

`

function A1216E_Go: LongInt; cdecl;

long A1216E_Go()

Function VBA1216E_Go() As Long

`

### Description

A1216E_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().

## A1216E_Status()

`

function A1216E_Status: LongInt; cdecl;

long A1216E_Status()

Function VBA1216E_Status() As Long

`

### Description

A1216E_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().

## A1216E_Stop()

`

function A1216E_Stop: LongInt; cdecl;

long A1216E_Stop()

Function VBA1216E_Stop() As Long

`

### Description

A1216E_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().

## A1216E_GetData()

`

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

long A1216E_GetData(void *lpBuf, DWORD ulBufSize)

`

### Description

A1216E_GetData() retrieves the point list acquired.

### Parameters

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

### Return Values

If the function succeeds, it returns the number of bytes actually placed in memory.

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