/* READ SRS dCnt= 3337 nframes= 13 READ SRS dCnt= 3337 nframes= 13 READ SRS dCnt= 3337 nframes= 13 READ SRS dCnt= 3337 nframes= 13 READ SRS dCnt= 3337 nframes= 13 READ SRS dCnt= 3337 nframes= 13 READ SRS dCnt= 3337 nframes= 13 READ SRS dCnt= 3337 nframes= 13 READ SRS dCnt= 3337 nframes= 13 READ SRS dCnt= 3337 nframes= 13 READ FADC125 689 Ev=290000 READ SRS dCnt= 3337 nframes= 13 READ SRS dCnt= 3337 nframes= 13 READ SRS dCnt= 3337 nframes= 13 READ SRS dCnt= 3337 nframes= 13 srsReadBlock(0): timeout ************************************************** No SRS data or error. ifec=0 dCnt = 0 ************************************************** srsReceiveData: ERROR: Timeout (-1) srsSlowControl(10.0.3.2:6007): Failed to receive data srsStatus: ERROR reading SYS port srsReadBlock(0): timeout ************************************************** No SRS data or error. ifec=0 dCnt = 0 ************************************************** srsReceiveData: ERROR: Timeout (-1) srsSlowControl(10.0.3.2:6007): Failed to receive data srsStatus: ERROR reading SYS port srsReadBlock(0): timeout ************************************************* ping 10.0.3.2 PING 10.0.3.2 (10.0.3.2) 56(84) bytes of data. From 10.0.3.1 icmp_seq=2 Destination Host Unreachable From 10.0.3.1 icmp_seq=3 Destination Host Unreachable From 10.0.3.1 icmp_seq=4 Destination Host Unreachable ------------------------------------------------------------------------------- System Summary Firmware Version 0xa078 FEC IP 10.0.3.2 DAQ IP:PORT 10.0.3.1:7000 Clock Selection 0x00 Status 0x00000011 Main Clock Source DTC Hardware FW Version 0x0000 DTC Config Data over ETH Enabled Flow Control Enabled Padding Type 2 Data Channel TrgID Disabled Data Frame TrgID Disabled Trailer word count 4 Padding Byte 0xaa Trailer Byte 0xdd -------------------------------------------------------------------------------- APV Application Summary APV Trigger Control Mode 4 TrgBurst 6 Trigger Seq Period 4 Trigger Delay 2 Test Pulse Delay 127 RO Sync 112 Status 0x03fffe Event Build Ch Enable Mask 0x0fff Capture Window 3500 Mode 2 Data Format 0 Event Info Data 0xaa000bb8 Readout is Disabled (0x0) -------------------------------------------------------------------------------- */ #define USE_SRS #define DO_SRS_READOUT 1 #ifdef USE_SRS #include "../include/srsLib.h" //#include //#include //#include //#include int srsFD[MAX_FEC]; char FEC[MAX_FEC][100]; int nfec=1; int roc_id=76; static unsigned int tdcbuf[65536]; #endif int gem_download() { #ifdef USE_SRS if(strncmp(roc_name, "roctrd1", 7) || use_gem==0 ) return 0; printf("gem_download(): Executed\n"); /************************************************************* * Setup SRS */ nfec=0; /* testing before run strncpy(FEC[nfec++], "10.0.0.2",100); strncpy(FEC[nfec++], "10.0.3.2",100); strncpy(FEC[nfec++], "10.0.8.2",100); */ /* from Bryan on May 13, 2016 */ if (roc_id == ROCID) /* roctrd1 */ { strncpy(FEC[nfec++], "10.0.3.2",100); } else { printf("ERROR1: SRS HAS WRONG PID=%d\n",roc_id); exit(0); } char hosts[MAX_FEC][100]; int ifec=0; int starting_port = 7000; memset(&srsFD, 0, sizeof(srsFD)); /* Associate FECs with Specific Host IPs and ports */ if (roc_id == ROCID) /* roctrd1 */ { for(ifec=0; ifec width = 60ns; 26=110ns*/ tiSetPromptTriggerWidth(26); int ifec=0, nframes=0, dCnt=0; for(ifec=0; ifec0) { printf("SYNC ERROR: SRS had extra data at SyncEvent.\n"); } #endif /* USE_SRS */ } //--- prestart --- int gem_end() { int ifec=0; #ifdef USE_SRS if(strncmp(roc_name, "roctrd1", 7) || use_gem==0 ) return 0; printf("gem_end(): Executed\n"); for(ifec=0; ifec0) { usleep(1000000); printf("CALIBRATION_FLAG=%d\n",CALIBRATION_FLAG); } //printf("enter SRS readout trigger"); dCnt=0; /************************************************************ * GEM / SRS READOUT */ int ifec=0; int nframes=0; nfec=1; for(ifec=0; ifec0) { usleep(1000000); printf("CALIBRATION_FLAG=%d dCnt= %d nframes= %d \n",CALIBRATION_FLAG,dCnt,nframes); } //#define CHECKFRAMES #ifdef CHECKFRAMES if(nframes!=10) { int idata=0, len = dCnt; unsigned int *SRSdata = dma_dabufp; // rol->dabufp; int icounter=0; int samples=0; unsigned int tmpData=0; for(idata=0;idata<(len);idata++) { if ((SRSdata[idata]&0xffffff)==0x434441) icounter=0; if((icounter%8)==0) printf("\n%4d\t",icounter); if(icounter==1) samples = (LSWAP(SRSdata[idata])) & 0xffff; if (((icounter-2)*2)==samples) { icounter=0; printf("\n"); } if(icounter<2) printf(" 0x%08x ",(unsigned int)LSWAP(SRSdata[idata])); else { tmpData = (unsigned int)LSWAP(SRSdata[idata]); printf(" %04x %04x ", (tmpData&0xFF000000)>>24 | (tmpData&0x00FF0000)>>8, (tmpData&0x0000FF00)>>8 | (tmpData&0x000000FF)<<8 ); } icounter++; } // printf("paused\n"); getchar(); } #endif } BANKCLOSE; } // - ifec loop } //-- if use_gem #endif //---- end GEM/SRS readout }