diff --git a/src/RetrigAO.cpp b/src/RetrigAO.cpp old mode 100644 new mode 100755 index 3c710dc1bc954c75d2aafc3e22e9ab70b5b8eeba..4561d26dec8236b77cdfde5083869911eb133c8d --- a/src/RetrigAO.cpp +++ b/src/RetrigAO.cpp @@ -200,6 +200,8 @@ void RetrigAO::init_device() ch5 = 0; ch6 = 0; ch7 = 0; + _error_message = ""; + // Initialise variables to default values //-------------------------------------------- get_device_property(); @@ -2018,6 +2020,7 @@ void RetrigAO::init_board(void) //config.set_stop_mode (adl::wait_end_waveform); DEBUG_STREAM<<"RetrigAO::init_device : init acq"<<std::endl; + try{ _ASL_TRY_ACTION ( ao->init(adl::DAQ2502, boardNum), @@ -2028,13 +2031,26 @@ void RetrigAO::init_board(void) this->config = _config; /*DEBUG_STREAM<<"RetrigAO::init_device : config acq"<<std::endl; - _ASL_TRY_ACTION + try + { + _ASL_TRY_ACTION ( ao->configure(_config), "configure", "RetrigAO::init_device", this->set_internal_state() - ); */ + ); + } + catch (...) + { + _error_message = "Error while configurating drivers"; + } + */ + } + catch (...) + { + _error_message = "Error while initializing drivers"; + } } //+------------------------------------------------------------------ /** @@ -2229,8 +2245,11 @@ void RetrigAO::set_internal_state(void) break; case asl::ContinuousAO::FAULT: this->set_state(Tango::FAULT); - this->set_status("An error has occured"); - break; + if (_error_message == "") + this->set_status("An error has occured"); + else + this->set_status(_error_message); + break; case asl::ContinuousAO::UNKNOWN: default: this->set_state(Tango::UNKNOWN); diff --git a/src/RetrigAO.h b/src/RetrigAO.h old mode 100644 new mode 100755 index 53015b07ba86d2a2d25b4afbb68bd16e26a599e2..727cd8b1ff84d4c7846b54d2781f3426a129b9a9 --- a/src/RetrigAO.h +++ b/src/RetrigAO.h @@ -549,6 +549,7 @@ protected : double* ch7; double err_ctr; short use_fifo; + std::string _error_message; //- Store the values into the property //- Properties stuff int FindIndexFromPropertyName(Tango::DbData& dev_prop, string property_name);