diff --git a/RELEASE.txt b/RELEASE.txt index f65e9b01a..defa68ec3 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -99,6 +99,7 @@ This document describes the differences between v7.0.0 and v6.x.x - setting rx_hostname (or udp_dstip with rx_hostname not none) will always set udp_dstmac. solves problem of chaing udp_dstip and udp_dstmac stays the same - jungfrau reset core and usleep removed (fix for 6.1.1 is now fixed in firmware) - g2 change clkdivs 2 3 4 to defaults for burst and cw mode. +- ctb and moench: allowing 1g non blocking acquire to send data 2. Resolved Issues ================== diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index 2b8445360..a46441486 100755 Binary files a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer and b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer differ diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c index fa74df294..db095b1db 100644 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c @@ -2083,7 +2083,7 @@ void *start_timer(void *arg) { closeUDPSocket(0); sharedMemory_setStatus(IDLE); - LOG(logINFOBLUE, ("Finished Acquiring\n")); + LOG(logINFOBLUE, ("Transmitting frames done\n")); return NULL; } #endif @@ -2203,40 +2203,31 @@ void readandSendUDPFrames(int *ret, char *mess) { closeUDPSocket(0); } -void readFrame(int *ret, char *mess) { -#ifdef VIRTUAL - // wait for acquisition to be done +void waitForAcquisitionEnd() { while (runBusy()) { - usleep(500); // random + usleep(500); + } +#ifndef VIRTUAL + int64_t retval = getNumFramesLeft() + 1; + if (retval > 0) { + LOG(logINFORED, ("%lld frames left\n", (long long int)retval)); } - LOG(logINFOGREEN, ("acquisition successfully finished\n")); - return; #endif - // 1G + LOG(logINFOGREEN, ("Blocking Acquisition done\n")); +} + +void readFrames(int *ret, char *mess) { +#ifdef VIRTUAL + while (runBusy()) { + usleep(500); + } +#else + // 1G force reading of frames if (!enableTenGigabitEthernet(-1)) { readandSendUDPFrames(ret, mess); + LOG(logINFOBLUE, ("Transmitting frames done\n")); } - // 10G - else { - // wait for acquisition to be done - while (runBusy()) { - usleep(500); // random - } - } - - // ret could be fail in 1gudp for not creating udp sockets - if (*ret != FAIL) { - // frames left to give status - int64_t retval = getNumFramesLeft() + 2; - if (retval > 1) { - sprintf(mess, "No data and run stopped: %lld frames left\n", - (long long int)retval); - LOG(logERROR, (mess)); - } else { - LOG(logINFOGREEN, ("Acquisition successfully finished\n")); - } - } - *ret = (int)OK; +#endif } void unsetFifoReadStrobes() { diff --git a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer index a0fda2018..355fba9b5 100755 Binary files a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer and b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer differ diff --git a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c index a674babec..4b52c6064 100644 --- a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c @@ -2765,7 +2765,7 @@ void *start_timer(void *arg) { closeUDPSocket(1); sharedMemory_setStatus(IDLE); - LOG(logINFOBLUE, ("Finished Acquiring\n")); + LOG(logINFOBLUE, ("Transmitting frames done\n")); return NULL; } #endif @@ -2893,16 +2893,13 @@ enum runStatus getRunStatus() { #endif } -void readFrame(int *ret, char *mess) { +void waitForAcquisitionEnd(int *ret, char *mess) { #ifdef VIRTUAL // wait for status to be done while (sharedMemory_getStatus() == RUNNING) { usleep(500); } - LOG(logINFOGREEN, ("acquisition successfully finished\n")); - return; #else - sharedMemory_lockLocalLink(); if (Feb_Control_WaitForFinishedFlag(5000, 1) == STATUS_ERROR) { sharedMemory_unlockLocalLink(); @@ -2911,7 +2908,7 @@ void readFrame(int *ret, char *mess) { return; } sharedMemory_unlockLocalLink(); - LOG(logINFOGREEN, ("Acquisition finished\n")); + LOG(logINFO, ("Acquisition done\n")); // wait for detector to send int isTransmitting = 1; @@ -2940,9 +2937,9 @@ void readFrame(int *ret, char *mess) { printf("Transmitting...\n"); } } - LOG(logINFO, ("Beb: Detector has sent all data (acquire)\n")); - LOG(logINFOGREEN, ("Acquisition successfully finished\n")); + LOG(logINFOBLUE, ("Transmitting frames done\n")); #endif + LOG(logINFOGREEN, ("Blocking Acquisition done\n")); } /* common */ diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index 099e992c7..ce2832d91 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index c517d5a51..99057a834 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -3310,7 +3310,7 @@ void *start_timer(void *arg) { } sharedMemory_setStatus(IDLE); - LOG(logINFOBLUE, ("Finished Acquiring\n")); + LOG(logINFOBLUE, ("Transmitting frames done\n")); return NULL; } #endif @@ -3396,18 +3396,11 @@ enum runStatus getRunStatus() { return s; } -void readFrame(int *ret, char *mess) { - // wait for status to be done +void waitForAcquisitionEnd() { while (runBusy()) { usleep(500); } -#ifdef VIRTUAL - LOG(logINFOGREEN, ("acquisition successfully finished\n")); - return; -#endif - - *ret = (int)OK; - LOG(logINFOGREEN, ("Acquisition successfully finished\n")); + LOG(logINFOGREEN, ("Blocking Acquisition done\n")); } u_int32_t runBusy() { diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer index ddb293d03..d3f5995a6 100755 Binary files a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer and b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer differ diff --git a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c index cef343ba6..23b2315d2 100644 --- a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c @@ -1729,7 +1729,7 @@ void *start_timer(void *arg) { closeUDPSocket(0); sharedMemory_setStatus(IDLE); - LOG(logINFOBLUE, ("Finished Acquiring\n")); + LOG(logINFOBLUE, ("Transmitting frames done\n")); return NULL; } #endif @@ -1854,28 +1854,17 @@ enum runStatus getRunStatus() { return s; } -void readFrame(int *ret, char *mess) { -#ifdef VIRTUAL - while (sharedMemory_getStatus() == RUNNING) { - // LOG(logERROR, ("Waiting for finished flag\n"); - usleep(5000); - } - return; -#endif - // wait for status to be done +void waitForAcquisitionEnd() { while (runBusy()) { usleep(500); } - - // frames left to give status - *ret = (int)OK; +#ifndef VIRTUAL int64_t retval = getNumFramesLeft() + 1; if (retval > -1) { - LOG(logERROR, ("No data and run stopped: %lld frames left\n", - (long long int)retval)); - } else { - LOG(logINFOGREEN, ("Acquisition successfully finished\n")); + LOG(logINFORED, ("%lld frames left\n", (long long int)retval)); } +#endif + LOG(logINFOGREEN, ("Blocking Acquisition done\n")); } u_int32_t runBusy() { diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index a4f219f40..c32481ef7 100755 Binary files a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer and b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer differ diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index e237716f8..584892776 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -2712,7 +2712,7 @@ void *start_timer(void *arg) { } sharedMemory_setStatus(IDLE); - LOG(logINFOBLUE, ("Finished Acquiring\n")); + LOG(logINFOBLUE, ("Transmitting frames done\n")); return NULL; } #endif @@ -2824,26 +2824,17 @@ enum runStatus getRunStatus() { return s; } -void readFrame(int *ret, char *mess) { - // wait for status to be done +void waitForAcquisitionEnd() { while (runBusy()) { usleep(500); } -#ifdef VIRTUAL - LOG(logINFOGREEN, ("acquisition successfully finished\n")); - return; -#endif - - *ret = (int)OK; - // frames left to give status +#ifndef VIRTUAL int64_t retval = getNumFramesLeft() + 1; - if (retval > 0) { - LOG(logERROR, ("No data and run stopped: %lld frames left\n", - (long long int)retval)); - } else { - LOG(logINFOGREEN, ("Acquisition successfully finished\n")); + LOG(logINFORED, ("%lld frames left\n", (long long int)retval)); } +#endif + LOG(logINFOGREEN, ("Blocking Acquisition done\n")); } u_int32_t runBusy() { diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer index 9c73ad7a5..443fc129e 100755 Binary files a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer and b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer differ diff --git a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c index b10ebb354..7ed5d919e 100644 --- a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c @@ -1755,7 +1755,7 @@ void *start_timer(void *arg) { closeUDPSocket(0); sharedMemory_setStatus(IDLE); - LOG(logINFOBLUE, ("Finished Acquiring\n")); + LOG(logINFOBLUE, ("Transmitting frames done\n")); return NULL; } #endif @@ -1877,40 +1877,31 @@ void readandSendUDPFrames(int *ret, char *mess) { closeUDPSocket(0); } -void readFrame(int *ret, char *mess) { -#ifdef VIRTUAL - // wait for acquisition to be done +void waitForAcquisitionEnd() { while (runBusy()) { - usleep(500); // random + usleep(500); + } +#ifndef VIRTUAL + int64_t retval = getNumFramesLeft() + 1; + if (retval > 0) { + LOG(logINFORED, ("%lld frames left\n", (long long int)retval)); } - LOG(logINFOGREEN, ("acquisition successfully finished\n")); - return; #endif - // 1G + LOG(logINFOGREEN, ("Blocking Acquisition done\n")); +} + +void readFrames(int *ret, char *mess) { +#ifdef VIRTUAL + while (runBusy()) { + usleep(500); + } +#else + // 1G force reading of frames if (!enableTenGigabitEthernet(-1)) { readandSendUDPFrames(ret, mess); + LOG(logINFOBLUE, ("Transmitting frames done\n")); } - // 10G - else { - // wait for acquisition to be done - while (runBusy()) { - usleep(500); // random - } - } - - // ret could be fail in 1gudp for not creating udp sockets - if (*ret != FAIL) { - // frames left to give status - int64_t retval = getNumFramesLeft() + 2; - if (retval > 1) { - sprintf(mess, "No data and run stopped: %lld frames left\n", - (long long int)retval); - LOG(logERROR, (mess)); - } else { - LOG(logINFOGREEN, ("Acquisition successfully finished\n")); - } - } - *ret = (int)OK; +#endif } void unsetFifoReadStrobes() { diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer index 9aa594040..93465c0c9 100755 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer differ diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c index 2d06ec113..a2363c9a2 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c @@ -2564,7 +2564,7 @@ void *start_timer(void *arg) { closeUDPSocket(0); sharedMemory_setStatus(IDLE); - LOG(logINFOBLUE, ("Finished Acquiring\n")); + LOG(logINFOBLUE, ("Transmitting frames done\n")); return NULL; } #endif @@ -2689,27 +2689,18 @@ enum runStatus getRunStatus() { return s; } -void readFrame(int *ret, char *mess) { - // wait for status to be done +void waitForAcquisitionEnd() { while (runBusy()) { usleep(500); } -#ifdef VIRTUAL - LOG(logINFOGREEN, ("acquisition successfully finished\n")); - return; -#endif - - *ret = (int)OK; - // frames left to give status +#ifndef VIRTUAL int64_t retval = getNumFramesLeft() + 1; - if (retval > 0) { - LOG(logERROR, ("No data and run stopped: %lld frames left\n", - (long long int)retval)); - } else { - LOG(logINFOGREEN, ("Acquisition successfully finished\n")); + LOG(logINFORED, ("%lld frames left\n", (long long int)retval)); } +#endif + LOG(logINFOGREEN, ("Blocking Acquisition done\n")); } u_int32_t runBusy() { diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 727d06a7d..26277dcd2 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -666,7 +666,14 @@ int softwareTrigger(int block); int startReadOut(); #endif enum runStatus getRunStatus(); -void readFrame(int *ret, char *mess); +#if defined(CHIPTESTBOARDD) || defined(MOENCHD) +void readFrames(int *ret, char *mess); +#endif +#ifdef EIGERD +void waitForAcquisitionEnd(int *ret, char *mess); +#else +void waitForAcquisitionEnd(); +#endif #if defined(CHIPTESTBOARDD) || defined(MOENCHD) void readandSendUDPFrames(int *ret, char *mess); void unsetFifoReadStrobes(); diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h index 716ca53bf..4c2c50b6c 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h @@ -52,7 +52,6 @@ int start_acquisition(int); int stop_acquisition(int); int get_run_status(int); int start_and_read_all(int); -int read_all(int); int get_num_frames(int); int set_num_frames(int); int get_num_triggers(int); @@ -305,4 +304,4 @@ int get_digital_pulsing(int); int set_digital_pulsing(int); int get_module(int); int get_synchronization(int); -int set_synchronization(int); \ No newline at end of file +int set_synchronization(int); diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 1e9432a99..e2191cc0c 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -2010,15 +2010,30 @@ void *start_state_machine(void *arg) { } break; } + + +#if defined(CHIPTESTBOARDD) || defined(MOENCHD) + readFrames(&ret, mess); + if (ret == FAIL && scan) { + sprintf(scanErrMessage, "Cannot scan at %d. ", scanSteps[i]); + strcat(scanErrMessage, mess); + sharedMemory_setScanStatus(ERROR); + break; + } +#endif // blocking or scan if (*blocking || times > 1) { - readFrame(&ret, mess); +#ifdef EIGERD + waitForAcquisitionEnd(&ret, mess); if (ret == FAIL && scan) { sprintf(scanErrMessage, "Cannot scan at %d. ", scanSteps[i]); strcat(scanErrMessage, mess); sharedMemory_setScanStatus(ERROR); break; } +#else + waitForAcquisitionEnd(); +#endif } } // end of scan @@ -2061,18 +2076,6 @@ int get_run_status(int file_des) { int start_and_read_all(int file_des) { return acquire(1, file_des); } -int read_all(int file_des) { - ret = OK; - memset(mess, 0, sizeof(mess)); - - LOG(logDEBUG1, ("Reading all frames\n")); - // only set - if (Server_VerifyLock() == OK) { - readFrame(&ret, mess); - } - return Server_SendResult(file_des, INT32, NULL, 0); -} - int get_num_frames(int file_des) { ret = OK; memset(mess, 0, sizeof(mess)); diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 616a7d819..cd8b6714f 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -5,10 +5,10 @@ #define APILIB 0x220609 #define APIRECEIVER 0x220609 #define APIGUI 0x220609 -#define APIEIGER 0x220816 -#define APICTB 0x220831 -#define APIGOTTHARD 0x220831 -#define APIJUNGFRAU 0x220831 -#define APIMOENCH 0x220831 -#define APIMYTHEN3 0x220901 -#define APIGOTTHARD2 0x220912 +#define APICTB 0x220916 +#define APIGOTTHARD 0x220916 +#define APIGOTTHARD2 0x220916 +#define APIJUNGFRAU 0x220916 +#define APIMYTHEN3 0x220916 +#define APIMOENCH 0x220916 +#define APIEIGER 0x220916