Our driver supports two broad classes of Digital I/O: “Fast” or “Buffered” DIO, and “Slow” or “Normal” DIO.
“Normal” DIO on the USB bus means not-more-than 4000 transactions per second. Buffered DIO is described in the “Buffered DIO” section, and refers to digital bits capable of 8 to 40 MHZ — or even faster — operations. Buffered DIO boards have both kinds of DIO on them, so you will need to refer to both sections, and the DIO_Configure… family of functions is used with both kinds of boards.
I/O Groups
Digital I/O (DIO) generally consists of several groups of 8 TTL/CMOS digital pins capable of being configured as either input or output, but only as a group.
Many devices act very similar to the venerable 8255 device, wherein the unit provides a 50-pin IDC header with 24 digital I/O lines often called Port A, Port B, and Port C, compatible with OPTO-22 module racks. Other devices may only provide two 8-bit ports, called Port 0 and Port 1, or, each bit may be selectable on a bit-by-bit basis as either input or output.
Each collection of pins able to be configured for input or output, but only together, is referred to as an “I/O Group”.
Most devices of this type provide TTL/CMOS compatible pins. Other devices may provide three-volt signals, called 3.0VDC, 3.3VDC, or LVTTL, via either jumper selection, software selection, or factory option.
Regardless of the number of I/O Groups or TTL / CMOS / LVTTL voltages of the pins, these types of digital bits are referred to as “TTL DIO”, “standard DIO”, or simply “DIO”.
Relays as DIO
Alternately, Digital Outputs may refer to solid-state relay or electro-mechanical relay outputs, while Digital Inputs may refer to optically- or electrically- isolated digital input bits. In both cases the voltage and current ranges far exceed the standard TTL/CMOS / LVTTL capability of “standard DIO”, and may be referred to collectively as “isolated digital bits”, “Isolated DIO”, “IDIO”, or “IIRO”. Further, inputs of these types may be called “IDI”, “II”, or “Isolated Inputs”, while outputs may be referred to as “IDO”, “RO”, or “Isolated DO”.
The API (Application Programming Interface) provided by AIOUSB.dll is a single, unified collection of functions to talk to all of these flavors of digital inputs and outputs, denoted by functions beginning with “DIO_”.
One stark difference between DIO and IDIO is the contrast in “I/O Groups”. IDIO pins do not belong to any I/O Groups. Each isolated digital bit, be it input or output, is fixed to that state, and cannot be changed from one to the other.
Another difference is the useful speed of the bits. DIO bits can be read or driven as fast as the USB bus allows; generally one transaction (input or output) every 250µsec under optimum conditions. IDO and RO bits could be driven at the same speeds, but because of the high-current drive, high-voltage capability, and / or electro-mechanical nature of the outputs, the fastest an output can usefully be driven is limited to once every 5 milliseconds or so. Similarly, isolated inputs, because of the isolation and (optional) filtering, rarely respond to input changes lasting less than ten milliseconds.
This distinction becomes an important factor when using functions such as DIO_WriteAll(). On a typical DIO board you very clearly have n I/O Groups, each of which has a byte, which you pass to DIO_WriteAll in an array, with each byte being the next group's data.
On IDIO / IIRO boards you still have the array of bytes, but do not know which bytes are the inputs or outputs.
In all cases outputs come first in the array for IDIO / IIRO devices. Conceptually this is because outputs usefully have two functions: output and read back, while inputs only usefully read. In addition, the The USB-IIRO-xx and USB-IDIO-xx families have two bytes for outputs and two bytes for inputs, even for 8-bit and input-only models.
Regardless of DIO vs IDIO, the outputs are always safe to read from and will return the latest data written; the inputs are safe to write to, and will simply ignore any data written.