/***********************************************************************/ /* This program is developed by Borland C++ 3.1 */ /***********************************************************************/ /* Demo 17: One P1602 Card MagicScan Function demo. */ /* To acquire A/D CH:4, CH:3 and CH:5, then display the */ /* values for those three channels. */ /***********************************************************************/ #define MYLIB #include "P1602.H" #define DATACOUNT 250 WORD wDaNum=90,wAdClk=80; WORD wV0[DATACOUNT]; /* AD ch:4 buffer */ WORD wV1[DATACOUNT]; /* AD ch:3 buffer */ WORD wV2[DATACOUNT]; /* AD ch:5 buffer */ WORD wPlot0[500]; /* transformed into wave form */ int main() { WORD i,j; WORD wBoards,wRetVal; WORD wDIOdata; float fVal; char cShow[80]; WORD wAddrTimer,wAddrCtrl,wAddrDio,wAddrAdda; clrscr(); /* initiaing P1602 card and detect how many P1602 card in PC */ wRetVal=P1602_DriverInit(&wBoards); printf("Threr are %d P1602 Cards in this PC\n",wBoards); if( wBoards==0 ) { putch(0x07); putch(0x07); putch(0x07); printf("There are no P1602 card in this PC !!!\n"); exit(0); } /* dump every P1602 card's configuration address space */ printf("The Configuration Space -> Timer Control DIO AD/DA\n"); for(i=0; i 1234H | Digital Input -> %04xH\n",wDIOdata); printf("\nHit any key to show wave form.\n"); getch(); for (i=0; i