davisoa / nmodbus

Automatically exported from code.google.com/p/nmodbus
0 stars 1 forks source link

If slave is not responding ReadInputRegister goes in to infinite loop #56

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If slave is not responding during ReadInputRegister program goes in to infinite 
loop 

Original issue reported on code.google.com by maheshma...@gmail.com on 7 Jan 2011 at 4:56

GoogleCodeExporter commented 9 years ago
I did some experiments with code and found that below function never return 
back if there is no data from serial port

public int Read(byte[] buffer, int offset, int count)
{
    return _serialPort.Read(buffer, offset, count);
}

Original comment by maheshma...@gmail.com on 7 Jan 2011 at 6:21

GoogleCodeExporter commented 9 years ago
Hi,
please have a look at the:
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.readtimeout.a
spx

Alberto

Original comment by alberto.spelta on 29 Jan 2011 at 11:40

GoogleCodeExporter commented 9 years ago
But it should generate event after the time out and return with error code

Original comment by maheshma...@gmail.com on 22 Nov 2011 at 3:06