PCI-AI12-16 DLL Driver Documentation
Overview
There are five functions exported by this DLL: AI1216_Setup(), AI1216_Go(), AI1216_Status(), AI1216_Stop(), and AI1216_GetData(). Each function is also exported in underscored form(i.e, _AI1216_Setup()); these are equivalent. Each function is also exported in VB form(i.e, VBAI1216_Setup()); these are intended for use from VisualBASIC.
AI1216_Setup()
function AI1216_Setup(ulBase: LongWord; ubIRQ: Byte; iReserved: SmallInt; iBusNum: SmallInt; lpChannelTable: Pointer; ulCTSize: LongWord; lpGainTable: Pointer; ulGTSize: LongWord; var lpdfRate: Double; lNumPoints: LongInt; ubFlags: Byte): LongInt; cdecl;
long AI1216_Setup(DWORD ulBase, byte ubIRQ, int iReservedA, int iReservedB, void *lpChannelTable, DWORD ulCTSize, void *lpGainTable, DWORD ulGTSize, double *lpdfRate, long lNumPoints, byte ubFlags)
Comments
AI1216_Setup() should be called first for each point set to acquire.
Parameters
- ulBase: The card's base address.
- ubIRQ: The card's IRQ.
- iReserved: Reserved. Set this parameter to zero.
- iBusNum: The number of the bus the PCI-AI12-16 is on. Most computers have all slots on bus 0; in computers with many PCI slots, the slots furthest from the CPU are usually on bus 2. (Bus 1 is usually an AGP slot.)
- 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 PCI-AI12-16 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 unsigned integer with bits 0-2 being the gain used on the PCI-AI12-16 and bits 4-6 being the gain used on the AIM-16(if present). The gain table is indexed by channel, using the values in the channel table; i.e. if the channel table contains [ 0, 16, 17, 16, 17, -1 ], entry 0 of the gain table should be set to the gain for the first read(card channel 0, AIM-16 channel 0), entry 16 should be set for the second and fourth reads(card channel 1, AIM-16 channel 0), and entry 17 should be set for the third and fifth reads(card channel 1, AIM-16 channel 1). The other entries(1-15 and 18+) will be ignored.
- 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.
- ubFlags: A bitmask of flags. Bit 0 indicates the PCI-AI12-16 has a FIFO data buffer(model PCI-AI12-16A). The other bits are reserved; set them to zero.
Return Values
If the function succeeds, it returns zero.
If it fails, it returns nonzero. To get extended error information, call GetLastError().
AI1216_Setup() also provides data via the lpdfRate parameter.
AI1216_Go()
function AI1216_Go: LongInt; cdecl;
long AI1216_Go()
Comments
AI1216_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().
AI1216_Status()
function AI1216_Status: LongInt; cdecl;
long AI1216_Status()
Comments
AI1216_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().
AI1216_Stop()
function AI1216_Stop: LongInt; cdecl;
long AI1216_Stop()
Comments
AI1216_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().
AI1216_GetData()
function AI1216_GetData(lpBuf: Pointer; ulBufSize: LongWord): LongInt; cdecl;
long AI1216_GetData(void *lpBuf, DWORD ulBufSize)
Comments
AI1216_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().