unsigned long GetDevices(void)
Returns a 32-bit bit-mask. Each bit set to "1" indicates an ACCES USB device was detected at the device index corresponding to the set bit number. For example, if the return is 0x00000104 then the USB DeviceIndex #2 and #8 are ACCES built USB devices that use this driver.
Returns 0 if no devices found or if the driver is not installed properly.
Note, this does not return one DeviceIndex... it returns a pattern of bits indicating all valid device indices. Also note, a limitation in the current .SYS file prevents detection of more than 8 ACCES USB Digital I/O Devices connected to one computer simultaneously.

unsigned long QueryDeviceInfo(
unsigned long DeviceIndex - number from 0-31 of the device from which you want to query info.
unsigned long *pPID - DWORD gets set to the ProductID of the device at DeviceIndex. USB-IIRO-16 = 8010 Hexadecimal.
unsigned long *pNameSize - DWORD specifies size of the pName buffer. It gets set to how many bytes are needed. If your buffer is too small, the data will be truncated.
char *pName - pointer to char[] buffer. This is an array of char, not a null-terminated string. Length of string is passed back in pNameSize.
unsigned long *pDIOBytes - DWORD gets set to how many bytes of DIO the board supports. The USB-IIRO-16 will report "4".
unsigned long *pCounters - DWORD gets set to how many 8254-compatible counters are available. The USB-IIRO-16 will report "0".
)

(Note: DIO_Configure is not used, since the USB-IIRO-16's configuration is fixed.)

unsigned long DIO_Write1(
unsigned long DeviceIndex - number from 0-31 of the device to which you want to write an output bit.
unsigned long BitIndex - Number of the bit you wish to change. Writes to input bits are ignored, so valid values for the USB-IIRO-16 are 0 to 15.
unsigned char bData - boolean. TRUE will set the bit to "1", FALSE will clear the bit to "0".
)

unsigned long DIO_Write8(
unsigned long DeviceIndex - number from 0-31 of the device to which you want to write an output byte.
unsigned long ByteIndex - Number of the byte you wish to change. Writes to input bytes are ignored, so valid values for the USB-IIRO-16 are 0 and 1.
unsigned char Data - one byte. The byte will be copied to the port outputs. Each set bit will cause the same port bit to be set to "1".
)

unsigned long DIO_WriteAll(
unsigned long DeviceIndex - number from 0-31 of the device to which you wish to write all output bits.
void *pData - pointer to the first element of an array of bytes. Each byte is copied to the corresponding output byte. Bytes written to input ports are ignored, but must still be provided.
)

unsigned long DIO_Read8(
unsigned long DeviceIndex - number from 0-31 of the device from which you wish to read a byte.
unsigned long ByteIndex - Number of the byte you wish to read. The inputs are bytes 2 and 3; you can also read back the outputs at bytes 0 and 1.
unsigned char *pBuffer - pointer to a byte in which the input byte will be stored. Data read from output ports results in a "read-back" of the output.
)

unsigned long DIO_ReadAll(
unsigned long DeviceIndex - number from 0-31 of the device from which you wish to read all digital bits.
void *Buffer - pointer to the first element of an array of bytes. Each port will be read, and the reading stored in the corresponding byte in the array. On the USB-IIRO-16, the array must be at least 4 bytes long; the first two bytes will read back the outputs.
)

unsigned long CustomEEPROMWrite( - This function writes to the custom EEPROM area, so you can store data there for your own use.
unsigned long DeviceIndex - number from 0-31 of the device to which you wish to write custom EEPROM data.
unsigned long StartAddress - number from 0x000 to 0x1FF of the first custom EEPROM byte you wish to write to.
unsigned long DataSize - number of custom EEPROM bytes to write. The last custom EEPROM byte is 0x1FF, so StartAddress plus DataSize can't be greater than 0x200.
void *Data - pointer to the start of a block of bytes to write to the custom EEPROM area.
)

unsigned long CustomEEPROMRead( - This function reads data written by CustomEEPROMWrite.
unsigned long DeviceIndex - number from 0-31 of the device from which you wish to read custom EEPROM data.
unsigned long StartAddress - number from 0x000 to 0x1FF of the first custom EEPROM byte you wish to read from.
unsigned long *DataSize - pointer to a variable holding the number of custom EEPROM bytes to read. The last custom EEPROM byte is 0x1FF, so StartAddress plus *DataSize can't be greater than 0x200.
void *Data - pointer to the start of a block of bytes to fill with data read from the custom EEPROM area.
)

All DWORD return values other than GetDevices() are Windows Error Codes and return "ERROR_SUCCESS" (equal to 0) if no error occurred. If the USB device has been removed during use, the error returned is "ERROR_DEVICE_REMOVED" (equal to 1617 decimal) and will persist until a call to "GetDevices" or "QueryDeviceInfo" has been made for that device. If this state is cleared and the board was not reconnected, the error returned is "ERROR_FILE_NOT_FOUND" (equal to 2). Versions of AIOUSB.dll prior to 2.1 return "ERROR_DEV_NOT_EXIST" (equal to 55 decimal) under both conditions.

The constants diFirst (equal to FFFFFFFE hex) and diOnly (equal to FFFFFFFD hex) can be passed for DeviceIndex in place of an actual device index. diFirst causes the function to operate on the first device, whatever its device index. diOnly causes the function to operate on the only device if there is only one, or to return "ERROR_DUP_NAME" (equal to 52 decimal) if there's more than one device.