Application Notes
Appendix C
AT-DIO-32F User Manual
C-4
© National Instruments Corporation
if (Read_Stat() & 0x20)
/* get IN2(paper error) bit */
{
printf("\nPrinter out of paper.");
printf("\nStat = %x",Read_Stat());
err = 1;
}
while ((Read_Stat() & 0x0800)); /* wait until IN1(BUSY) is not set */
return(err);
}
/* read the stat register */
Read_Stat()
{
return(inpw(tstat));
}
/* send a character to the printer by writing to porta */
Print_char(ch)
char ch;
{
int i = 0, err;
err = Printer_Rdy(); /* check for paper error or BUSY */
if (err)
{
printf("\nCan't get printer ready.");
exit(1);
}
while(!(Read_Stat() & 0x0100) && i<20000) /* wait for DRDY1 bit set */
i++;
if (i == 20000)
{
printf("\nCan't get DRDY1 set.");
printf("\nStat = %x",Read_Stat());
exit(1);
}
outp(porta, ch);
printf("%c",ch);
/* echo character to screen */
}
AT-DIO-32F to AT-DIO-32F 16-Bit Communications
This program transmits 16-bit words between two AT-DIO-32F boards in separate PC
computers. With the program, the AT-DIO-32F can communicate with National Instruments
MC-DIO-32F or NB-DIO-32F. Ports A and B function as the 16-bit read channel with Group 1
handshaking, and Ports C and D comprise the 16-bit write channel utilizing Group 2
handshaking.
Содержание AT-DIO-32F
Страница 19: ......
Страница 101: ......
Страница 102: ......
Страница 123: ......
Страница 124: ......
Страница 125: ......
Страница 126: ......
Страница 127: ......
Страница 128: ......
Страница 129: ......
Страница 130: ......
Страница 131: ......
Страница 132: ......
Страница 133: ......
Страница 134: ......
Страница 135: ......
Страница 136: ......
Страница 137: ......
Страница 138: ......
Страница 139: ......
Страница 140: ......
Страница 141: ......
Страница 142: ......
Страница 143: ......