/* this file should be used with BORLANDC under MSDOS */ /* The project should be compiled with memory option huge*/ #include #include #include "licel_tr.h" #include "licel_ut.h" /* You will need a valid NIDAQ installation for compilation*/ /* These statements assume that the board has been setup with ICU.exe or another pnp configuration utility. */ extern unsigned Board_Base_Address = 0x110; extern unsigned Read_Port_Address = 0x203; short PC_raw[8190]; /* static to avoid stack overflow */ long PC_long[8190]; /* static to aviod stack overflow */ int main (int argc, char *argv[]) { short int TR=0; int i; double duration; #ifdef __BORLANDC__ struct timeb t1,t2; #else /* microsoft*/ struct _timeb t1,t2; #endif printf("Status %d",Initialize_Board(1)); /*Initialize the NI Card*/ HS_Licel_Set_Range(TR,MILLIVOLT500); /*Set the input Range to 500mV*/ HS_Licel_Set_Threshold_Mode(TR,THRESHOLD_LOW); /*Set the threshold mode to low thresholds*/ HS_Licel_Set_Discriminator_Level(TR,8); /*Set the disriminator level*/ HS_Licel_Clear_Memory(TR); /* Clear the transient recorders memory*/ HS_Licel_Start_Acquisition(TR); mDelay(1); HS_Licel_Stop_Acquisition(TR); HS_Licel_Wait_For_Ready(TR,1000); /* Wait for the completion of the single shot*/ ftime(&t1); for(i=0;i<40;i++) { HS_Licel_Read_16bit_wide(TR, LSW,8190,0,PC_raw);/*Read the analog data*/ } ftime(&t2); duration=(1000.0*(t2.time-t1.time)+t2.millitm-t1.millitm)/40; printf("time for data transfer 8190 bins %f ms\r\n time per bin %f ns",duration,1.0e6*duration/8190); return 0; }