modbus-dart
modbus-dart copied to clipboard
How to set Response timeout?
I want to set a timeout if modbus slave not response in a given time(like 2000ms), how can I do it ?
With a simple solution you could do this
var coils = await _client.readCoils(1,1).timeout(Duration(miliseconds: 2000), onTimeout: () {
//Do something
});