mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 14:38:14 +02:00
added adc_write to simply write to registers and read back, instead of making more functions
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@104 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
429bedecca
commit
89c00ffda3
@ -262,8 +262,7 @@ enum dacIndex {
|
|||||||
G_VCASC_OUT, /**< gotthard */
|
G_VCASC_OUT, /**< gotthard */
|
||||||
G_VIN_CM, /**< gotthard */
|
G_VIN_CM, /**< gotthard */
|
||||||
G_VREF_COMP, /**< gotthard */
|
G_VREF_COMP, /**< gotthard */
|
||||||
G_IB_TESTC, /**< gotthard */
|
G_IB_TESTC /**< gotthard */
|
||||||
G_ADC_WRITE /**< gotthard: ADC WRITE REG*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -503,5 +502,8 @@ typedef struct {
|
|||||||
} angleConversionConstant;
|
} angleConversionConstant;
|
||||||
|
|
||||||
|
|
||||||
|
enum reg{
|
||||||
|
ADC_WRITE
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -2011,7 +2011,7 @@ float slsDetector::setDAC(float val, dacIndex index, int imod){
|
|||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< std::endl;
|
std::cout<< std::endl;
|
||||||
std::cout<< "Setting DAC/POT/TEMP/HV/ADC_WRITE "<< index << "of module " << imod << " to " << val << std::endl;
|
std::cout<< "Setting DAC/POT/TEMP/HV "<< index << "of module " << imod << " to " << val << std::endl;
|
||||||
#endif
|
#endif
|
||||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
if (controlSocket) {
|
if (controlSocket) {
|
||||||
@ -2046,10 +2046,10 @@ float slsDetector::setDAC(float val, dacIndex index, int imod){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "Dac/Pot/Temp/HV/ADC_write set to "<< retval << std::endl;
|
std::cout<< "Dac/Pot/Temp/HV set to "<< retval << std::endl;
|
||||||
#endif
|
#endif
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
std::cout<< "Set dac/pot/temp/HV/ADC_write failed " << std::endl;
|
std::cout<< "Set dac/pot/temp/HV failed " << std::endl;
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
};
|
};
|
||||||
@ -6192,10 +6192,11 @@ string slsDetector::executeLine(int narg, char *args[], int action) {
|
|||||||
/* GOTTHARD ADC_WRITE_REG */
|
/* GOTTHARD ADC_WRITE_REG */
|
||||||
else if (var=="adc_write") {
|
else if (var=="adc_write") {
|
||||||
if (action==PUT_ACTION) {
|
if (action==PUT_ACTION) {
|
||||||
sscanf(args[1],"%f",&fval);
|
sscanf(args[1],"%x",&ival);
|
||||||
setDAC(fval,G_ADC_WRITE);
|
writeRegister(ADC_WRITE,ival);
|
||||||
|
// setDAC(fval,G_ADC_WRITE);
|
||||||
}
|
}
|
||||||
sprintf(answer,"%f",setDAC(-1,G_ADC_WRITE));
|
sprintf(answer,"%x",readRegister(ADC_WRITE));
|
||||||
return string(answer);
|
return string(answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user