diff --git a/slsDetectorSoftware/eigerDetectorServer/Beb.c b/slsDetectorSoftware/eigerDetectorServer/Beb.c index a3025fea9..5299f1d37 100644 --- a/slsDetectorSoftware/eigerDetectorServer/Beb.c +++ b/slsDetectorSoftware/eigerDetectorServer/Beb.c @@ -149,7 +149,7 @@ void Beb_Beb(){ -void Beb_GetModuleCopnfiguration(int* master, int* top){ +void Beb_GetModuleConfiguration(int* master, int* top, int* normal){ *top = 0; *master = 0; //mapping new memory to read master top module configuration @@ -168,6 +168,8 @@ void Beb_GetModuleCopnfiguration(int* master, int* top){ *top = 1; if(ret&MASTER_BIT_MASK) *master = 1; + if(ret&NORMAL_MODULE_BIT_MASK) + *normal = 1; //close file pointer Beb_close(fd,csp0base); } diff --git a/slsDetectorSoftware/eigerDetectorServer/Beb.h b/slsDetectorSoftware/eigerDetectorServer/Beb.h index 9431701ea..8aeaac0a8 100644 --- a/slsDetectorSoftware/eigerDetectorServer/Beb.h +++ b/slsDetectorSoftware/eigerDetectorServer/Beb.h @@ -45,7 +45,7 @@ struct BebInfo{ unsigned int Beb_GetBebInfoIndex(unsigned int beb_numb); - void Beb_GetModuleCopnfiguration(int* master, int* top); + void Beb_GetModuleConfiguration(int* master, int* top, int* normal); void Beb_EndofDataSend(int tengiga); int Beb_SetMasterViaSoftware(); diff --git a/slsDetectorSoftware/eigerDetectorServer/FebControl.c b/slsDetectorSoftware/eigerDetectorServer/FebControl.c index a5dd9ae83..1786f16a3 100644 --- a/slsDetectorSoftware/eigerDetectorServer/FebControl.c +++ b/slsDetectorSoftware/eigerDetectorServer/FebControl.c @@ -61,6 +61,7 @@ int Feb_Control_current_index; int Feb_Control_counter_bit = 1; int Feb_control_master = 0; +int Feb_control_normal = 0; unsigned int Feb_Control_rate_correction_table[1024]; double Feb_Control_rate_meas[16384]; @@ -181,11 +182,12 @@ void Feb_Control_FebControl(){ -int Feb_Control_Init(int master, int top, int module_num){ +int Feb_Control_Init(int master, int top, int normal, int module_num){ unsigned int i; Feb_Control_module_number = 0; Feb_Control_current_index = 0; Feb_control_master = master; + Feb_control_normal = normal; //global send Feb_Control_AddModule1(0,1,0xff,0,1); @@ -492,59 +494,94 @@ float Feb_Control_DACToVoltage(unsigned int digital,unsigned int nsteps,float vm } -int Feb_Control_SetHighVoltage(float value){ - return Feb_Control_SetHighVoltage1(Feb_Control_module_number,value); -} +//only master gets to call this function +int Feb_Control_SetHighVoltage(int value){ -int Feb_Control_SetHighVoltage1(unsigned int module_num,float value){ - unsigned int module_index=0; - unsigned int i; - - if(Feb_control_master){//if(Module_TopAddressIsValid(&modules[module_index])){ - if(!Feb_Control_GetModuleIndex(module_num,&module_index)){/*||!Module_TopAddressIsValid(&modules[module_index])){*/ - cprintf(RED,"Error could not set high voltage module number %d invalid.\n",module_num); - return 0; - } - }else + if(!Feb_control_normal){ + cprintf(RED,"\nError: Setting High Voltage not implemented for special modules\n"); return 0; + } - if(!Feb_Control_SendHighVoltage(Module_GetTopRightAddress(&modules[module_index]),&value)) return 0; - - if(module_index!=0) Module_SetHighVoltage(&modules[module_index],value); - else for(i=0;i