/**********************************************************************/ /* This program is developed by Borland C++ 3.1 */ /* For PCI-180XH */ /***********************************************************************/ /* Demo 30: One P180X Card P180X_AdsPacer 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 "P180X.H" #define DATACOUNT 250 WORD wDaNum=90,wAdClk=24; float fV2[DATACOUNT]; /* AD ch:2 buffer */ float fV3[DATACOUNT]; /* AD ch:3 buffer */ float fV4[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,wConfig; WORD wDIOdata; float fVal; char ch,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 Config:0-B(hex)\n"); printf(" PCI-180XH(High Gain) -> Config:10-1B(hex)\n"); printf("Enter Config(hex):"); scanf("%x",&wConfig); printf("\nPlease Enter the Freq Divisior(8000): "); scanf("%d",&wFreqDiv); /* The P180X_ActiveBoard() function must be used to active a board, */ /* then all operation will take effect to the actived board. */ printf("Now Active First P180X Card...\n"); P180X_ActiveBoard( 0 ); graphic_init(); cleardevice(); sprintf(cShow,"Pacer Trigger Sampling Rate:%.2f KHz", 8000.0/wFreqDiv); setcolor(RED); outtextxy(120,10,cShow); for (i=0; i