diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index 258e18f7e..ccdfaae73 100755 Binary files a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer and b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer differ diff --git a/slsDetectorServers/eigerDetectorServer/FebControl.c b/slsDetectorServers/eigerDetectorServer/FebControl.c index 7ddd6823e..e75a1a2fc 100644 --- a/slsDetectorServers/eigerDetectorServer/FebControl.c +++ b/slsDetectorServers/eigerDetectorServer/FebControl.c @@ -1106,7 +1106,7 @@ int Feb_Control_SendSoftwareTrigger() { LOG(logERROR, ("Could not give software trigger\n")); return 0; } - LOG(logINFO, ("Software Internal Trigger Sent!\n")); + LOG(logDEBUG1, ("Software Internal Trigger Sent!\n")); return 1; } @@ -1129,7 +1129,7 @@ int Feb_Control_SoftwareTrigger(int block) { // wait for next trigger ready if (block) { - LOG(logINFO, ("Blocking Software Trigger\n")); + LOG(logDEBUG1, ("Blocking Software Trigger\n")); int readyForTrigger = 0; if (!Feb_Control_IsReadyForTrigger(&readyForTrigger)) { LOG(logERROR, ("Could not read FEB_REG_STATUS reg after giving " @@ -1138,6 +1138,15 @@ int Feb_Control_SoftwareTrigger(int block) { } while (!readyForTrigger) { + // end of acquisition (cannot monitor readyForTrigger) + int status = Feb_Control_AcquisitionInProgress(); + if (status == STATUS_ERROR) { + LOG(logERROR, ("Status: ERROR reading DAQ status register\n")); + return 0; + } else if (status == STATUS_IDLE) { + break; + } + usleep(5000); if (!Feb_Control_IsReadyForTrigger(&readyForTrigger)) { LOG(logERROR, ("Could not read FEB_REG_STATUS reg after " @@ -1145,8 +1154,10 @@ int Feb_Control_SoftwareTrigger(int block) { return 0; } } - LOG(logINFO, ("Done waiting (wait for trigger)!\n")); + LOG(logDEBUG2, ("Done waiting (wait for trigger)!\n")); } + LOG(logINFO, ("%s Software Trigger %s\n", (block ? "Blocking" : "Non blocking"), (block ? "Acquired" : "Sent"))); + fflush(stdout); } return 1; diff --git a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer index fde66559a..3006b0969 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 73b337ada..3b395f52e 100644 --- a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c @@ -434,8 +434,9 @@ int readConfigFile() { master = -1; top = -1; - char fname[128]; - if (getAbsPath(fname, 128, CONFIG_FILE) == FAIL) { + const int fileNameSize = 128; + char fname[fileNameSize]; + if (getAbsPath(fname, fileNameSize, CONFIG_FILE) == FAIL) { return FAIL; } diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index 2b6632367..dabd39758 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 c7a9814fe..3dbb46900 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -530,8 +530,9 @@ int readConfigFile() { usleep(INITIAL_STARTUP_WAIT); - char fname[128]; - if (getAbsPath(fname, 128, CONFIG_FILE) == FAIL) { + const int fileNameSize = 128; + char fname[fileNameSize]; + if (getAbsPath(fname, fileNameSize, CONFIG_FILE) == FAIL) { return FAIL; } @@ -1833,15 +1834,23 @@ int checkDetectorType() { int type = atoi(buffer); if (type > TYPE_NO_MODULE_STARTING_VAL) { LOG(logERROR, - ("No Module attached! Expected %d for Gotthard2, got %d\n", - TYPE_GOTTHARD2_MODULE_VAL, type)); + ("No Module attached! Expected %d, %d or %d for Gotthard2, got %d\n", + TYPE_GOTTHARD2_MODULE_VAL, + TYPE_GOTTHARD2_25UM_MASTER_MODULE_VAL, + TYPE_GOTTHARD2_25UM_SLAVE_MODULE_VAL, + type)); return -2; } - if (abs(type - TYPE_GOTTHARD2_MODULE_VAL) > TYPE_TOLERANCE) { + if ((abs(type - TYPE_GOTTHARD2_MODULE_VAL) > TYPE_TOLERANCE) && + (abs(type - TYPE_GOTTHARD2_25UM_MASTER_MODULE_VAL) > TYPE_TOLERANCE) && + (abs(type - TYPE_GOTTHARD2_25UM_SLAVE_MODULE_VAL) > TYPE_TOLERANCE)) { LOG(logERROR, - ("Wrong Module attached! Expected %d for Gotthard2, got %d\n", - TYPE_GOTTHARD2_MODULE_VAL, type)); + ("Wrong Module attached! Expected %d, %d or %d for Gotthard2, got %d\n", + TYPE_GOTTHARD2_MODULE_VAL, + TYPE_GOTTHARD2_25UM_MASTER_MODULE_VAL, + TYPE_GOTTHARD2_25UM_SLAVE_MODULE_VAL, + type)); return FAIL; } return OK; diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h index 46db18153..91293d7e3 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h @@ -26,7 +26,10 @@ #define ADU_MAX_BITS (12) #define MAX_FRAMES_IN_BURST_MODE (2720) #define TYPE_GOTTHARD2_MODULE_VAL (536) -#define TYPE_TOLERANCE (10) +#define TYPE_GOTTHARD2_25UM_MASTER_MODULE_VAL (683) +#define TYPE_GOTTHARD2_25UM_SLAVE_MODULE_VAL (704) +#define TYPE_GOTTHARD2_MODULE_VAL (536) +#define TYPE_TOLERANCE (5) #define TYPE_NO_MODULE_STARTING_VAL (800) #define INITIAL_STARTUP_WAIT (1 * 1000 * 1000) diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer index 689a040a4..90989277d 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 db55c29e1..eae7a7722 100644 --- a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c @@ -588,8 +588,9 @@ void setGbitReadout() { } int readConfigFile() { - char fname[128]; - if (getAbsPath(fname, 128, CONFIG_FILE) == FAIL) { + const int fileNameSize = 128; + char fname[fileNameSize]; + if (getAbsPath(fname, fileNameSize, CONFIG_FILE) == FAIL) { return FAIL; } diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index 7fd991678..d22594fa8 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 7d7116d41..d074101e8 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -286,6 +286,9 @@ u_int16_t getHardwareSerialNumber() { // is board 1.0?, with value 2 (resistor network) int isHardwareVersion2() { +#ifdef VIRTUAL + return 0; +#endif return (((bus_r(MOD_SERIAL_NUM_REG) & HARDWARE_VERSION_NUM_MSK) == HARDWARE_VERSION_2_VAL) ? 1 @@ -484,8 +487,9 @@ int readConfigFile() { return initError; } - char fname[128]; - if (getAbsPath(fname, 128, CONFIG_FILE) == FAIL) { + const int fileNameSize = 128; + char fname[fileNameSize]; + if (getAbsPath(fname, fileNameSize, CONFIG_FILE) == FAIL) { return FAIL; } @@ -576,6 +580,13 @@ int readConfigFile() { // validations chipVersion = version; LOG(logINFOBLUE, ("Chip Version: v%.01f\n", chipVersion / 10.0)); + + // version 1.1 and HW 1.0 (version reg value = 2) is incompatible + if (chipVersion == 11 && isHardwareVersion2()) { + strcpy(initErrorMessage, + "Chip version 1.1 (from on-board config file) is incompatible with old board (v1.0). Please update board or correct on-board config file.\n"); + break; + } } memset(line, 0, LZ); diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer index 65acee737..215b4752f 100755 Binary files a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer and b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer differ diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer index c6a8752f1..fd9b15709 100755 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer differ diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h index ef4354f82..35f53caef 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h @@ -21,7 +21,7 @@ #define TYPE_FILE_NAME ("/etc/devlinks/type") #define DAC_MAX_MV (2048) #define TYPE_MYTHEN3_MODULE_VAL (93) -#define TYPE_TOLERANCE (10) +#define TYPE_TOLERANCE (5) #define TYPE_NO_MODULE_STARTING_VAL (800) #define MAX_EXT_SIGNALS (8) diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 063f33cb1..00187dfe0 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -3,10 +3,10 @@ #define APILIB 0x210225 #define APIRECEIVER 0x210225 #define APIGUI 0x210225 -#define APICTB 0x210722 -#define APIGOTTHARD 0x210722 -#define APIGOTTHARD2 0x210722 -#define APIMYTHEN3 0x210722 -#define APIMOENCH 0x210722 -#define APIEIGER 0x210722 -#define APIJUNGFRAU 0x210723 +#define APICTB 0x210727 +#define APIGOTTHARD 0x210727 +#define APIGOTTHARD2 0x210727 +#define APIMYTHEN3 0x210727 +#define APIMOENCH 0x210727 +#define APIEIGER 0x210727 +#define APIJUNGFRAU 0x210727