User manual

Appendix D Register-Level Programming
PC-DIO-96/PnP User Manual D-20
©
National Instruments Corporation
/* EXAMPLE 1–port A output */
outp(cnfg,0xA0); /* Port A is an output in mode 1.*/
while (!(inp(portc) & 0x80)); /* Wait until OBFA* is set,
indicating that the data last
written to port A has been
read.*/
outp(porta,0x12); /* Write data to port A. */
/* EXAMPLE 2–port B output */
outp(cnfg,0x84); /* Port B is an output in mode 1.*/
while (!(inp(portc) & 0x02)); /* Wait until OBFB* is set,
indicating that the data last
written to port B has been
read.*/
outp(portb,0x34); /* Write the data to port B. */
}