use version 3.1.10 on windows, When the client sets the timeout time to 2s and reply time to 3s using modbus slave software, why is ERROR Unknown error: select displayed on the client? When viewing the source code, it is found that select returns -1, but normally 0 should be returned.
the client output:
Waiting for a confirmation...
ERROR Unknown error: select
Error modbus_write_registers: -1
The connection settings are as follows:
ret = modbus_set_response_timeout(ctx, 2, 0);
printf("sec:%d,usec:%d\n", ctx->response_timeout.tv_sec,ctx->response_timeout.tv_usec);
//write registers
int ret = modbus_write_registers(ctx,address,nums,sendBuf);
if (ret != nums) {
printf("Error modbus_write_registers: %d\n", ret);
return -1;
}
free(sendBuf);
modbus_disconnect(ctx);
return 0;
use version 3.1.10 on windows, When the client sets the timeout time to 2s and reply time to 3s using modbus slave software, why is ERROR Unknown error: select displayed on the client? When viewing the source code, it is found that select returns -1, but normally 0 should be returned.
the client output: Waiting for a confirmation... ERROR Unknown error: select Error modbus_write_registers: -1
The connection settings are as follows: ret = modbus_set_response_timeout(ctx, 2, 0); printf("sec:%d,usec:%d\n", ctx->response_timeout.tv_sec,ctx->response_timeout.tv_usec);
//write registers int ret = modbus_write_registers(ctx,address,nums,sendBuf); if (ret != nums) { printf("Error modbus_write_registers: %d\n", ret); return -1; } free(sendBuf); modbus_disconnect(ctx); return 0;
the modbus slave software setting:![image](https://user-images.githubusercontent.com/35766221/223961719-ef7cf14f-52f1-485e-b6b6-015267f8d654.png)