Hi Jasem,
There are two things that need to be changed for sesto senso2 to work. First, the method to select one of the motor presets should be:

bool SestoSenso2::applyMotorPreset(const std::string &name)
{
return m_Communication->command(MOT_NONE, {{"RUNPRESET", name}});
}

And the method getting the motor settings works when it reads as follows:

bool SestoSenso2::getMotorSettings(MotorRates &rates, MotorCurrents ¤ts, bool &motorHoldActive)
{
//json jsonRequest = {{"req", {{"get", {{"MOT1", ""}}}}}};
json jsonRequest = {{"req", {{"get", {{"MOT1", { {"FnRUN_ACC",""}, {"FnRUN_DEC",""}, {"FnRUN_SPD",""}, {"FnRUN_CURR_ACC",""}, {"FnRUN_CURR_DEC",""}, {"FnRUN_CURR_SPD",""}, {"FnRUN_CURR_HOLD",""}, {"HOLDCURR_STATUS",""} } }}}}}};
json jsonResponse;

if (m_Communication->sendRequest(jsonRequest, &jsonResponse))
{
jsonResponse["get"]["MOT1"]["FnRUN_ACC"].get_to(rates.accRate);
jsonResponse["get"]["MOT1"]["FnRUN_DEC"].get_to(rates.decRate);
jsonResponse["get"]["MOT1"]["FnRUN_SPD"].get_to(rates.runSpeed);

jsonResponse["get"]["MOT1"]["FnRUN_CURR_ACC"].get_to(currents.accCurrent);
jsonResponse["get"]["MOT1"]["FnRUN_CURR_DEC"].get_to(currents.decCurrent);
jsonResponse["get"]["MOT1"]["FnRUN_CURR_SPD"].get_to(currents.runCurrent);
jsonResponse["get"]["MOT1"]["FnRUN_CURR_HOLD"].get_to(currents.holdCurrent);
int tmp;
jsonResponse["get"]["MOT1"]["HOLDCURR_STATUS"].get_to(tmp);
motorHoldActive = ( tmp == 1 );
return true;
}
return false;
}

Read More...