Skip to content
Snippets Groups Projects
Commit 0779db1d authored by ELATTAOUI's avatar ELATTAOUI
Browse files

xavier :

- bug in Novelec part fixed (END_OF_LINE!)
parent 7bd6c9e2
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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 )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment