Commit 495ec6b4 authored by Achim Morschhauser's avatar Achim Morschhauser
Browse files

ADC calibrate #4 checked_send

parent f9e32a76
......@@ -23,7 +23,7 @@ EXCL=driver_serial_emulate.o
.SECONDARY:
all: $(USR_TARGET:%=$(BIN_DIR)%) $(LIB_DIR)libLogger.so
all: $(LIB_DIR)libLogger.so $(USR_TARGET:%=$(BIN_DIR)%)
%: $(BIN_DIR)%
@echo ---- DONE ----
......
......@@ -87,6 +87,8 @@ int data_obs::set_time(data_obs* data) {
this->min = data->min;
this->sec = data->sec;
this->msec = data->msec;
return(0);
}
......
......@@ -1047,7 +1047,8 @@ int driver_obs_obsdaq::init() {
int driver_obs_obsdaq::init_run(double freq){
// The receive buffer
std::string recv;
//std::string recv;
char recv[20]="";
// A command to send
char cmd[20];
// Index of the selected frequency
......@@ -1082,7 +1083,8 @@ int driver_obs_obsdaq::init_run(double freq){
// Set range to +10V and set frequency of digital filter
for (int i=0; i<3; i++){
sprintf(cmd,"$%1dWS020102%s",i,filter_cmds[freq_sel]);
send(cmd); waitanswer(5);
send(cmd);
waitanswer(5);
}
// Print used and requested frequency
......@@ -1101,11 +1103,13 @@ int driver_obs_obsdaq::init_run(double freq){
for (int i=0; i<3; i++){
// Get current 24-bit configuration (Manual 12.4.9)
sprintf(cmd,"$%1dRS",i);
checked_send(cmd,"02",2,1,&recv);
send(cmd);
receive(recv,sizeof(recv),5);
//checked_send(cmd,"02",2,1,&recv,1);
std::cout << "REC CONFIG: " << recv << std::endl;
// Get the last four bytes ("ccdd") and add channel number
config= sn + "/" + recv.substr(2,4) + "/" + std::to_string(i);
config= sn + "/" + recv[2,4] + "/" + std::to_string(i);
fprintf(stderr,"----- CONFIG: %s\n",config.c_str());
// Check if calibration for the given config
......
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