/**********************************************************************/ /* This program is developed by Borland C++ 3.1 */ /***********************************************************************/ /* Demo 18: One P180X Card MagicScan Function demo. */ /* To acquire all A/D channels, then display the CH:0, CH:1, CH:15, */ /* CH:16 and CH:17's data for those channels. */ /***********************************************************************/ #define MYLIB #include #include "P180X.H" #define DATACOUNT 100 /* how many data is scan for a A/D channel */ WORD wDaNum=90,wAdClk=24; WORD wV[32][DATACOUNT]; /* AD CH:0-31 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 P180X card and detect how many P180X card in PC */ wRetVal=P180X_DriverInit(&wBoards); printf("Threr are %d P180X Cards in this PC\n",wBoards); if( wBoards==0 ) { putch(0x07); putch(0x07); putch(0x07); printf("There are no P180X card in this PC !!!\n"); exit(0); } /* dump every P180X 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(); graphic_init(); cleardevice(); setcolor(RED); for (i=0; i