Manual PCI-IDIO-16
13
FET Switch Outputs
At power-up, all FET switches are in the OFF-state. The current state of the FET switches can be
determined at any time by a read operation from Base A0 and +4. The FET switch outputs are
controlled by writing to Base A0 and +4. Data is written to each group of eight switches as a
single byte. Each bit within the byte controls a specific switch. A "1" turns on the corresponding switch
and a "0" turns it off.
Bit Position
D7
D6
D5
D4
D3
D2
D1
D0
FET Contr'd
OP7
OP6
OP5
OP4
OP3
OP2
OP1 OP0
FET Contr’d
OP15 OP14 OP13 OP12 OP11
OP10 OP9 OP8
For example, if bit D5 is turned on by writing hex 20 to the base address the relay that controls OP5 is
energized. All other low-byte FETs would be de-energized.
Programming Examples
No driver software is provided with the card because programming is very simple and can be
accomplished most efficiently using direct I/O instructions. The following examples are in C but are readily
translated into other languages:
Example:
Turn on OP0 and OP7
Base=0xF300;
//Base I/O address
outportb(Base, 0x81);
Example:
Read back the state of the switches
X=inportb(Base);
//switch register data to X
printf("%02x");
//display results
Example:
Read the digital inputs
Y=inportb(Base+1);
//digital input register to Y