Commit 71d78094 authored by Achim Morschhauser's avatar Achim Morschhauser
Browse files

Init run adapted

parent 4263d70d
......@@ -1004,14 +1004,15 @@ int driver_obs_obsdaq::init_run(double freq){
/////////////////////////////////////////////////////////////////////
// Set triggering off
//TODO Check if necessary here
send("#PP00000000");
usleep(1e6);
// Find the closest possible valid frequency lower or equal to the one
// requested.
// Find the closest possible valid frequency larger or equal to
// the one requested.
for (int i=0; i<valid_filter_rates_num; i++){
if (valid_filter_rates[i]>freq){
freq_sel=i;
if (valid_filter_rates[i]>=freq){
freq_sel = i;
break;
}
}
......@@ -1039,6 +1040,8 @@ int driver_obs_obsdaq::init_run(double freq){
int config=0;
// Get current 24-bit configuration (Manual 12.4.9)
usleep(0.5*1e6);
flush();
sprintf(cmd,"$%1dRS",i);
send(cmd);
receive(buf,sizeof(buf),1);
......@@ -1053,7 +1056,7 @@ int driver_obs_obsdaq::init_run(double freq){
(&adc_offset, &adc_scale, config)<0){
// Automatic Calibration
//auto_calibrate(i,1);
// auto_calibrate(i,1);
} else {
......@@ -1084,8 +1087,11 @@ int driver_obs_obsdaq::init_run(double freq){
//GAIN=4.0; // +/- 10V range
//GAIN=8.0; // +/- 5V range
M = 40.0 / 4.0 / (double) 0x800000;
//printf("M: %f\n",M);
return(0);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment