rogerwfrech / nmodbus

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

FtdAdapter read and write timeouts are cast to byte #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There is a problem with the FtdAdapter in NModbus 1.8.0 on Windows XP SP2
(.Net framework 3.5). The connection would fail if large blocks of data
were being transferred even though we had set the timeout to a large value.

We have traced this to ReadTimeout and WriteTimeout properties in
FtdUsbPort.cs.

The timeouts (_readTimeout and _writeTimeout) are defined as UINT, however
when setting the timeout via the above properties, the timeouts are cast to
(byte) so the maximum timeout was 256 milliseconds. The Get is fine.

Original issue reported on code.google.com by n.cu...@kelman.co.uk on 7 Oct 2008 at 1:23

GoogleCodeExporter commented 9 years ago

Original comment by sja...@gmail.com on 24 Nov 2008 at 6:32

GoogleCodeExporter commented 9 years ago
In latest version 1.10 there is still a problem with ReadTimeout property.
ReadTimeout and WriteTimeout are still cast to byte. Line 142 or there abouts

InvokeFtdMethod(() => FT_SetTimeouts(DeviceHandle, (byte) ReadTimeout, (byte)
WriteTimeout)); 

Original comment by n.cu...@kelman.co.uk on 25 Mar 2009 at 7:13

GoogleCodeExporter commented 9 years ago
Fix is in trunk.

Thanks
Scott

Original comment by sja...@gmail.com on 25 Mar 2009 at 3:44

GoogleCodeExporter commented 9 years ago
I have a big problem when I run WriteMultipleRegisters function in MODBUS. It 
send 
data continuous 4 times. I don't know what happen? Can help me?

Original comment by XuanHuyp...@gmail.com on 14 Nov 2009 at 5:28