fixed bug in temp front fpga

This commit is contained in:
Dhanya Maliakal 2016-10-07 15:54:46 +02:00
commit 03cdda99ae
9 changed files with 61 additions and 4 deletions

View File

@ -362,6 +362,8 @@ enum dacIndex {
TEMPERATURE_DCDC, /**< temperature sensor (close to DCDC) */ TEMPERATURE_DCDC, /**< temperature sensor (close to DCDC) */
TEMPERATURE_SODL, /**< temperature sensor (close to SODL) */ TEMPERATURE_SODL, /**< temperature sensor (close to SODL) */
TEMPERATURE_SODR, /**< temperature sensor (close to SODR) */ TEMPERATURE_SODR, /**< temperature sensor (close to SODR) */
TEMPERATURE_FPGA2, /**< temperature sensor (fpga2 (eiger:febl) */
TEMPERATURE_FPGA3, /**< temperature sensor (fpga3 (eiger:febr) */
V_POWER_A = 100, /**new chiptest board */ V_POWER_A = 100, /**new chiptest board */
V_POWER_B = 101, /**new chiptest board */ V_POWER_B = 101, /**new chiptest board */
V_POWER_C = 102, /**new chiptest board */ V_POWER_C = 102, /**new chiptest board */

View File

@ -1654,3 +1654,22 @@ int Feb_Control_PrintCorrectedValues(){
return 1; return 1;
} }
int Feb_Control_GetLeftFPGATemp(){
unsigned int temperature=0;
Feb_Interface_ReadRegister(Module_GetTopLeftAddress (&modules[1]),FEB_REG_STATUS, &temperature);
temperature = temperature >> 16;
//division done in client to send int over network
return (int)temperature;
}
int Feb_Control_GetRightFPGATemp(){
unsigned int temperature=0;
Feb_Interface_ReadRegister(Module_GetTopRightAddress (&modules[1]),FEB_REG_STATUS, &temperature);
temperature = temperature >> 16;
//division done in client to send int over network
return (int)temperature;
}

View File

@ -191,4 +191,7 @@ int Feb_Control_GetModuleNumber();
void Feb_Control_SetRateCorrectionVariable(int activate_rate_correction); void Feb_Control_SetRateCorrectionVariable(int activate_rate_correction);
int Feb_Control_PrintCorrectedValues(); int Feb_Control_PrintCorrectedValues();
int Feb_Control_GetLeftFPGATemp();
int Feb_Control_GetRightFPGATemp();
#endif #endif

View File

@ -95,6 +95,7 @@
#define DAQ_STATUS_DAQ_RUNNING 0x01 #define DAQ_STATUS_DAQ_RUNNING 0x01
#define DAQ_DATA_COLLISION_ERROR 0x02 #define DAQ_DATA_COLLISION_ERROR 0x02
#define DAQ_STATUS_CURRENT_M4 0x04 #define DAQ_STATUS_CURRENT_M4 0x04
#define DAQ_STATUS_CURRENT_M8 0x08 #define DAQ_STATUS_CURRENT_M8 0x08
#define DAQ_STATUS_CURRENT_M12 0x00 //in 12 bit mode both are cleared #define DAQ_STATUS_CURRENT_M12 0x00 //in 12 bit mode both are cleared
@ -149,3 +150,6 @@
#define FRAME_NUM_RESET_OFFSET 0xA0 #define FRAME_NUM_RESET_OFFSET 0xA0
//temp so far
#define FEB_REG_STATUS 0xa

View File

@ -449,6 +449,12 @@ int getADC(enum detAdcIndex ind, int imod){
case TEMP_FPGA: case TEMP_FPGA:
retval=getBebFPGATemp()*1000; retval=getBebFPGATemp()*1000;
break; break;
case TEMP_FPGAFEBL:
retval=Feb_Control_GetLeftFPGATemp();
break;
case TEMP_FPGAFEBR:
retval=Feb_Control_GetRightFPGATemp();
break;
case TEMP_FPGAEXT: case TEMP_FPGAEXT:
case TEMP_10GE: case TEMP_10GE:
case TEMP_DCDC: case TEMP_DCDC:

View File

@ -40,7 +40,7 @@
enum detDacIndex{SVP,VTR,VRF,VRS,SVN,VTGSTV,VCMP_LL,VCMP_LR,CAL,VCMP_RL,RXB_RB,RXB_LB,VCMP_RR,VCP,VCN,VIS,VTHRESHOLD}; enum detDacIndex{SVP,VTR,VRF,VRS,SVN,VTGSTV,VCMP_LL,VCMP_LR,CAL,VCMP_RL,RXB_RB,RXB_LB,VCMP_RR,VCP,VCN,VIS,VTHRESHOLD};
enum detAdcIndex{TEMP_FPGAEXT, TEMP_10GE, TEMP_DCDC, TEMP_SODL, TEMP_SODR, TEMP_FPGA}; enum detAdcIndex{TEMP_FPGAEXT, TEMP_10GE, TEMP_DCDC, TEMP_SODL, TEMP_SODR, TEMP_FPGA, TEMP_FPGAFEBL, TEMP_FPGAFEBR};
enum detNetworkParameter{TXN_LEFT, TXN_RIGHT, TXN_FRAME,FLOWCTRL_10G}; enum detNetworkParameter{TXN_LEFT, TXN_RIGHT, TXN_FRAME,FLOWCTRL_10G};

View File

@ -791,6 +791,15 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC; descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC;
i++; i++;
descrToFuncMap[i].m_pFuncName="temp_fpgafl"; //
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC;
i++;
descrToFuncMap[i].m_pFuncName="temp_fpgafr"; //
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdADC;
i++;
/* r/w timers */ /* r/w timers */
descrToFuncMap[i].m_pFuncName="timing"; // descrToFuncMap[i].m_pFuncName="timing"; //
@ -3881,6 +3890,10 @@ string slsDetectorCommand::cmdADC(int narg, char *args[], int action) {
adc=TEMPERATURE_SODL; adc=TEMPERATURE_SODL;
else if (cmd=="temp_sodr") else if (cmd=="temp_sodr")
adc=TEMPERATURE_SODR; adc=TEMPERATURE_SODR;
else if (cmd=="temp_fpgafl")
adc=TEMPERATURE_FPGA2;
else if (cmd=="temp_fpgafr")
adc=TEMPERATURE_FPGA3;
else else
return string("cannot decode adc ")+cmd; return string("cannot decode adc ")+cmd;
@ -3909,6 +3922,8 @@ string slsDetectorCommand::helpADC(int narg, char *args[], int action) {
os << "temp_dcdc " << "Cannot be set" << std::endl; os << "temp_dcdc " << "Cannot be set" << std::endl;
os << "temp_sodl " << "Cannot be set" << std::endl; os << "temp_sodl " << "Cannot be set" << std::endl;
os << "temp_sodr " << "Cannot be set" << std::endl; os << "temp_sodr " << "Cannot be set" << std::endl;
os << "temp_fpgafl " << "Cannot be set" << std::endl;
os << "temp_fpgafr " << "Cannot be set" << std::endl;
} }
if (action==GET_ACTION || action==HELP_ACTION) { if (action==GET_ACTION || action==HELP_ACTION) {
os << "temp_adc " << "\t gets the temperature of the adc" << std::endl; os << "temp_adc " << "\t gets the temperature of the adc" << std::endl;
@ -3918,6 +3933,8 @@ string slsDetectorCommand::helpADC(int narg, char *args[], int action) {
os << "temp_dcdc " << "\t gets the temperature close to the dc dc converter" << std::endl; os << "temp_dcdc " << "\t gets the temperature close to the dc dc converter" << std::endl;
os << "temp_sodl " << "\t gets the temperature close to the left so-dimm memory" << std::endl; os << "temp_sodl " << "\t gets the temperature close to the left so-dimm memory" << std::endl;
os << "temp_sodr " << "\t gets the temperature close to the right so-dimm memory" << std::endl; os << "temp_sodr " << "\t gets the temperature close to the right so-dimm memory" << std::endl;
os << "temp_fpgafl " << "\t gets the temperature of the left front end board fpga" << std::endl;
os << "temp_fpgafr " << "\t gets the temperature of the left front end board fpga" << std::endl;
} }
return os.str(); return os.str();
} }

View File

@ -1325,9 +1325,6 @@ int get_adc(int file_des) {
#endif #endif
switch (ind) { switch (ind) {
#ifdef EIGERD #ifdef EIGERD
case TEMPERATURE_FPGA:
iadc = TEMP_FPGA;
break;
case TEMPERATURE_FPGAEXT: case TEMPERATURE_FPGAEXT:
iadc = TEMP_FPGAEXT; iadc = TEMP_FPGAEXT;
break; break;
@ -1343,6 +1340,15 @@ int get_adc(int file_des) {
case TEMPERATURE_SODR: case TEMPERATURE_SODR:
iadc = TEMP_SODR; iadc = TEMP_SODR;
break; break;
case TEMPERATURE_FPGA:
iadc = TEMP_FPGA;
break;
case TEMPERATURE_FPGA2:
iadc = TEMP_FPGAFEBL;
break;
case TEMPERATURE_FPGA3:
iadc = TEMP_FPGAFEBR;
break;
#endif #endif
#ifdef GOTTHARDD #ifdef GOTTHARDD
case TEMPERATURE_FPGA: case TEMPERATURE_FPGA: