diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index a15ff07c0..3e838ccb2 100755 Binary files a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer and b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer differ diff --git a/slsDetectorServers/slsDetectorServer/src/AD7689.c b/slsDetectorServers/slsDetectorServer/src/AD7689.c index a21913fc4..278952ea7 100755 --- a/slsDetectorServers/slsDetectorServer/src/AD7689.c +++ b/slsDetectorServers/slsDetectorServer/src/AD7689.c @@ -68,6 +68,8 @@ #define AD7689_INT_REF_MAX_MV (2500) // chosen using reference buffer selection in config reg #define AD7689_INT_REF_MIN_MV (0) +#define AD7689_INT_REF_MAX_UV (2500 * 1000) +#define AD7689_INT_REF_MIN_UV (0) #define AD7689_INT_MAX_STEPS (0xFFFF + 1) #define AD7689_TMP_C_FOR_1_MV (25.00 / 283.00) @@ -144,14 +146,14 @@ int AD7689_GetTemperature() { } int AD7689_GetChannel(int ichan) { - // filter channels val - if (ichan < 0 || ichan >= AD7689_NUM_CHANNELS) { + // filter channels val + if (ichan < 0 || ichan >= AD7689_NUM_CHANNELS) { FILE_LOG(logERROR, ("Cannot get slow adc channel. " "%d out of bounds (0 to %d)\n", ichan, AD7689_NUM_CHANNELS - 1)); return -1; - } + } - AD7689_Set( + AD7689_Set( // read back AD7689_CFG_RB_MSK | // disable sequencer (different from config) @@ -167,15 +169,17 @@ int AD7689_GetChannel(int ichan) { // overwrite configuration AD7689_CFG_CFG_OVRWRTE_VAL); - int regval = AD7689_Get(); + int regval = AD7689_Get(); - // value in mV - int retval = 0; - ConvertToDifferentRange(0, AD7689_INT_MAX_STEPS, + // value in uV + int retval = ((double)(regval - 0) * (double)(AD7689_INT_REF_MAX_UV - AD7689_INT_REF_MIN_UV)) + / (double)(AD7689_INT_MAX_STEPS - 0) + AD7689_INT_REF_MIN_UV; + + /*ConvertToDifferentRange(0, AD7689_INT_MAX_STEPS, AD7689_INT_REF_MIN_MV, AD7689_INT_REF_MAX_MV, - regval, &retval); - FILE_LOG(logINFO, ("\tvoltage read for chan %d: %d mV\n", ichan, retval)); + regval, &retval);*/ + FILE_LOG(logINFO, ("\tvoltage read for chan %d: %d uV (regVal: %d)\n", ichan, retval, regval)); return retval; } diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 982a06f00..e32635523 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -1036,7 +1036,7 @@ class Detector { Result getMeasuredCurrent(defs::dacIndex index, Positions pos = {}) const; - /** [CTB] Options: SLOW_ADC0 - SLOW_ADC7 in mV */ + /** [CTB] Options: SLOW_ADC0 - SLOW_ADC7 in uV */ Result getSlowADC(defs::dacIndex index, Positions pos = {}) const; /** [CTB]*/ diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index ec9c222a0..0d72860f4 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -1416,7 +1416,11 @@ std::string CmdProxy::SlowAdc(int action) { } else { auto t = det->getSlowADC( static_cast(nchan + defs::SLOW_ADC0), {det_id}); - os << OutString(t) << " mV\n"; + Result result(t.size()); + for (unsigned int i = 0; i < t.size(); ++i) { + result[i] = t[i] / 1000.00; + } + os << OutString(result) << " mV\n"; } } else if (action == defs::PUT_ACTION) { throw sls::RuntimeError("cannot put"); diff --git a/slsSupportLib/include/versionAPI.h b/slsSupportLib/include/versionAPI.h index 8756d6ee0..8a6c5cb72 100644 --- a/slsSupportLib/include/versionAPI.h +++ b/slsSupportLib/include/versionAPI.h @@ -6,7 +6,7 @@ #define APIJUNGFRAU 0x200226 #define APIEIGER 0x200226 #define APIGOTTHARD 0x200226 -#define APICTB 0x200227 #define APILIB 0x200227 #define APIRECEIVER 0x200227 #define APIGUI 0x200227 +#define APICTB 0x200227