diff --git a/src/NovelecProtocol.cpp b/src/NovelecProtocol.cpp index 2bb8de6e75489c1249d96657dae4bb45455e6a3e..9d29ac3b2112f5d4bdf85d5152072501bfa5a246 100644 --- a/src/NovelecProtocol.cpp +++ b/src/NovelecProtocol.cpp @@ -33,7 +33,7 @@ static const short RANGE_CMD_NUM = 8; static const short RESPONSE_LGTH_CMD_NUM = 17; static const short CLEAR_ERRORS_CMD_NUM = 18; //- the specific new line character -static const char END_OF_LINE[] = {'\r','\n'}; +static const char END_OF_LINE[] = {13, 10, 0}; //- modes allowed static const std::string mode_str[] = {"ERR : UNKNOWN MODE","ZERO V/F","OFFSET","LEAKAGE","TEST","MEASURE"}; static const std::string range_str[5][8]= { {"1e-11AcC","3e-11AcC","1e-10AcC","3e-10AcC", "OUT OF RANGE","OUT OF RANGE","OUT OF RANGE","OUT OF RANGE"}, @@ -69,11 +69,14 @@ void NovelecProtocol::init_MCCE2_for_communication(void) std::stringstream explicite_resp; std::string tmp("no data"); + std::cout << "NovelecProtocol::init_MCCE2_for_communication(void) -> ENTERING ... ADDRESS = " << this->_devAdd << std::endl; //- CMD to enable PROG cmds this->switch_MCCE2_OFF(); //- this command is now called in the MCCE2 device ! + std::cout << "NovelecProtocol::switch_MCCE2_OFF() -> DONE !!!" << std::endl; //- Clear error registers this->clear_registers(); + std::cout << "NovelecProtocol::clear_registers() -> DONE !!!" << std::endl; //- send cmd to have an explicite response : explicite_resp << _devAdd << " PROG " << RESPONSE_LGTH_CMD_NUM << " 1" << END_OF_LINE << std::endl; @@ -82,6 +85,7 @@ std::string tmp("no data"); check_command(tmp); //- if no error _is_explicite_resp_enabled = true; + std::cout << "NovelecProtocol::init_MCCE2_for_communication(void) -> DONE !!!" << std::endl; } @@ -104,7 +108,7 @@ std::stringstream cmd_to_send; std::string tmp("no data"); //- send cmd to have a explicite response : - cmd_to_send << _devAdd << " MEASURE 1" << END_OF_LINE << std::endl; + cmd_to_send << _devAdd << " MEASURE 1 " << END_OF_LINE << std::endl; tmp = _communication_link->write_read(cmd_to_send.str()); //- check only the command response check_command(tmp); @@ -117,12 +121,14 @@ std::string tmp("no data"); // ============================================================================ void NovelecProtocol::switch_MCCE2_OFF (void) { -std::stringstream cmd_to_send; +std::stringstream toto; std::string tmp("no data"); +std::cout << "NovelecProtocol::switch_MCCE2_OFF : _devAdd" << _devAdd << endl; //- send cmd to have a explicite response : - cmd_to_send << _devAdd << " MEASURE 0" << END_OF_LINE << std::endl; - tmp = _communication_link->write_read(cmd_to_send.str()); + toto << _devAdd << " MEASURE 0 " << END_OF_LINE << std::ends; +std::cout << "\n\n NovelecProtocol::switch_MCCE2_OFF -> CMD = [" << toto.str() << "]" << std::endl; + tmp = _communication_link->write_read(toto.str()); //- check only the command response check_command(tmp); diff --git a/src/TangoSerialLink.cpp b/src/TangoSerialLink.cpp index 7844882bf75fe4e80b07bc6fb39dabce6ebf5b57..472505bc3cabc1a2d0887e549eb0ebfd5e9a143c 100644 --- a/src/TangoSerialLink.cpp +++ b/src/TangoSerialLink.cpp @@ -121,7 +121,8 @@ std::string TangoSerialLink::read (void) throw (Tango::DevFailed) try { //- try in mode LINE - this->_serial_proxy->command_inout("DevSerReadString", MODE_LINE ,this->response); + //this->_serial_proxy->command_inout("DevSerReadString", MODE_LINE ,this->response); + this->_serial_proxy->command_out("DevSerReadLine", this->response); } catch(Tango::DevFailed& df ) {