/**********************************************************************/ /* This program is developed by Borland C++ 3.1 */ /* For PCI-180XH */ /***********************************************************************/ /* Demo 29: One P1602 Card MagicScan Function demo. */ /* First Card: To acquire A/D CH:2, CH:3, CH:4 250 times. */ /* The sampling rate is 8M/wFreqDiv */ /***********************************************************************/ #define MYLIB #include "P1602.H" #define DATACOUNT 250 WORD wDaNum=90,wAdClk=80; WORD wV2[DATACOUNT]; /* AD ch:2 buffer */ WORD wV3[DATACOUNT]; /* AD ch:3 buffer */ WORD wV4[DATACOUNT]; /* AD ch:4 buffer */ WORD wPlot2[500]; /* transformed into wave form */ WORD wPlot3[500]; /* transformed into wave form */ WORD wPlot4[500]; /* transformed into wave form */ WORD old_wPlot2[500]; /* transformed into wave form */ WORD old_wPlot3[500]; /* transformed into wave form */ WORD old_wPlot4[500]; /* transformed into wave form */ int main() { WORD i,j; WORD wBoards,wRetVal,wFreqDiv; WORD wDIOdata; float fVal; char ch,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("\nPlease Enter the Freq Divisior(8000): "); scanf("%d",&wFreqDiv); graphic_init(); cleardevice(); sprintf(cShow,"MagicScan() testing Sampling Rate:%.2f KHz", 8000.0/wFreqDiv); setcolor(RED); outtextxy(120,10,cShow); for (i=0; i