diff --git a/slsDetectorSoftware/eigerDetectorServer/FebControl.cxx b/slsDetectorSoftware/eigerDetectorServer/FebControl.cxx index 92e72e81d..3819fcad1 100644 --- a/slsDetectorSoftware/eigerDetectorServer/FebControl.cxx +++ b/slsDetectorSoftware/eigerDetectorServer/FebControl.cxx @@ -810,19 +810,22 @@ bool FebControl::WaitForFinishedFlag(int sleep_time_us){ } bool FebControl::AcquisitionInProgress(){ + unsigned int status_reg_r=0; - for(unsigned int i=1;iGetTopLeftAddress(),status_reg_r)&&GetDAQStatusRegister(modules[i]->GetTopRightAddress(),status_reg_l))){*/ - if(!(GetDAQStatusRegister(modules[i]->GetTopLeftAddress(),status_reg_r)||GetDAQStatusRegister(modules[i]->GetTopRightAddress(),status_reg_l))){ + if(!(GetDAQStatusRegister(modules[1]->GetTopRightAddress(),status_reg_r))) + return 0; + if(status_reg_r&DAQ_STATUS_DAQ_RUNNING) return 1; + + /* + if(!(GetDAQStatusRegister(modules[i]->GetTopLeftAddress(),status_reg_r)&&GetDAQStatusRegister(modules[i]->GetTopRightAddress(),status_reg_l))){ for(int i=0;i<2;i++) cout<<"Waring trouble reading status register. Returning zero to avoid inifite loops, this could cause trouble!"<0xfff) return 0; + send_data_raw[0] = 0x8fff0000; + if(ll->Write(4,send_data_raw)!=4) return 0; + send_data_raw[0] = 0x90000000 | (ch<<16); if(ll->Write(4,send_data_raw)!=4) return 0; diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer index e93176022..fd725f4a3 100755 Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer and b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer differ diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/feb_debug b/slsDetectorSoftware/eigerDetectorServer/bin/feb_debug index d7ea855d0..2eee059e4 100755 Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/feb_debug and b/slsDetectorSoftware/eigerDetectorServer/bin/feb_debug differ diff --git a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c index 225890c98..7b5d6ba7f 100644 --- a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c @@ -11,9 +11,6 @@ #include "EigerHighLevelFunctions.c" #include "EigerBackEndFunctions.c" -int tempframes; -int64_t timewait1; -int64_t timewait2; enum detectorSettings thisSettings = STANDARD; //static const string dacNames[16] = {"Svp","Svn","Vtr","Vrf","Vrs","Vtgstv","Vcmp_ll","Vcmp_lr","Cal","Vcmp_rl","Vcmp_rr","Rxb_rb","Rxb_lb","Vcp","Vcn","Vis"}; @@ -258,16 +255,13 @@ enum runStatus getRunStatus(){ char *readFrame(int *ret, char *mess){ - int i; - int64_t t; - t=timewait1>timewait2?timewait1:timewait2; - /*RequestImages();done inside startacqusition *//** polling should be done in server */ - printf("status:%d\n",EigerRunStatus()); - /*while(EigerRunStatus())*/ - printf("going to randomly wait for %f us\n",tempframes*(t/1000)); - for(i=0;i= 0){ printf(" Setting exp time: %fs\n",val/(1E9)); EigerSetExposureTime(val/(1E9)); - timewait1 = val; }return (EigerGetExposureTime()*(1E9)); case FRAME_PERIOD: if(val >= 0){ printf(" Setting acq period: %fs\n",val/(1E9)); EigerSetExposurePeriod(val/(1E9)); - timewait2 = val; }return (EigerGetExposurePeriod()*(1E9)); /* case DELAY_AFTER_TRIGGER: if(val >= 0) @@ -472,118 +463,11 @@ enum externalSignalFlag setExtSignal(int signalindex, enum externalSignalFlag f enum externalCommunicationMode setTiming( enum externalCommunicationMode arg){ - //template setTiming from firmware_funcs.c - //template getFPGASignal from firmware_funcs.c - - - //getFPGASignal(signalindex) used later on in this fucntion - //gets flag from fpga reg, checks if flag within limits, - //if( flag=SIGNAL_OFF and signals[signalindex]==MASTER_SLAVE_SYNCHRONIZATION), return -1, (ensures masterslaveflag !=off now) - //else return flag enum externalCommunicationMode ret=GET_EXTERNAL_COMMUNICATION_MODE; - //sets timingmode variable - //ensures that the signals are in acceptance with timing mode and according sets the timing mode - /* - int g=-1, t=-1, rot=-1; - int i; + ret = AUTO_TIMING; - switch (ti) { - case AUTO_TIMING: - timingMode=ti; - // disable all gates/triggers in except if used for master/slave synchronization - for (i=0; i<4; i++) { - if (getFPGASignal(i)>0 && getFPGASignal(i)=0 && t>=0 && rot<0) { - ret=GATE_WITH_START_TRIGGER; - } else if (g<0 && t>=0 && rot<0) { - ret=TRIGGER_EXPOSURE; - } else if (g>=0 && t<0 && rot<0) { - ret=GATE_FIX_NUMBER; - } else if (g<0 && t<0 && rot>0) { - ret=TRIGGER_READOUT; - } else if (g<0 && t<0 && rot<0) { - ret=AUTO_TIMING; - } - - */ return ret; }