Hello people,
I'm currently coding a C++ program running on a stripped down Linux. I'm using Buildroot to compile the libraries.
I am using Libmodbus version 3.1.2. To get that version working, I had to modify Buildroot's Libmodbus package with "LIBMODBUS_VERSION = 3.1.2", "LIBMODBUS_LIBTOOL_PATCH= NO" and remake.
I can Read/Write in TCP/UDP, everything works fine, except when I try to do a "modbus_set_response_timeout".
When I call it, I get a segmentation fault. I have no idea what can cause this. Even the "modbus_get_response_timeout" works. I just tried modbus_set_byte_timeout and it cause a seg fault too...
Sorry I don't have much more information, but it's pretty straightforward.
Anyone have any idea? Maybe I should just go back to 3.0.6.
Thanks a lot, Antoine
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "libmodbus".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.
mModbusContext = modbus_new_tcp_pi(mIPAddr.c_str(), mIPPort.c_str());
if (mModbusContext == nullptr){ mError = errno; return false;
}else{
modbus_set_response_timeout(mModbusContext, 0, 200000);
}
if (modbus_connect(mModbusContext) == -1){ mError = errno; modbus_free(mModbusContext); mModbusContext = nullptr; return false;}
return true;
--