stefanodimattia / nmodbus

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

Exception after n ReadInputs #25

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. call every 100ms master.ReadInputs(1, 99, 16);
2.
3.

What is the expected output? What do you see instead?
I expect this loop to last forever, instead after around 2000 polls I got
an exception

What version of the product are you using? On what operating system?
VC# in VS2005

Please provide any additional information below.
I see many "Thread exited" messages in console window...?
This is my output:

The thread 0xa64 has exited with code 0 (0x0).
The thread 0x16f8 has exited with code 0 (0x0).
The thread 0x7c4 has exited with code 0 (0x0).
The thread 0x1690 has exited with code 0 (0x0).
The thread 0x13d0 has exited with code 0 (0x0).
The thread 0x10d8 has exited with code 0 (0x0).
The thread 0x14e0 has exited with code 0 (0x0).
The thread 0x14dc has exited with code 0 (0x0).
The thread 0x9f0 has exited with code 0 (0x0).
The thread 0xbf8 has exited with code 0 (0x0).
The thread 0x4ac has exited with code 0 (0x0).
The thread 0xa64 has exited with code 0 (0x0).
The thread 0x1784 has exited with code 0 (0x0).
The thread 0x1618 has exited with code 0 (0x0).
The thread 0x4e0 has exited with code 0 (0x0).
The thread 0x11ec has exited with code 0 (0x0).
The thread 0x86c has exited with code 0 (0x0).
The thread 0x12e0 has exited with code 0 (0x0).
A first chance exception of type 'System.IO.IOException' occurred in Modbus.dll
   at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
   at System.IO.Ports.SerialStream.DiscardInBuffer()
   at System.IO.Ports.SerialPort.DiscardInBuffer()
   at Modbus.IO.CommPortAdapter.DiscardInBuffer()
   at Modbus.IO.ModbusSerialTransport.DiscardInBuffer()
   at Modbus.IO.ModbusSerialTransport.Write(IModbusMessage message)
   at Modbus.IO.ModbusTransport.UnicastMessage[T](IModbusMessage message)
   at Modbus.Device.ModbusMaster.ReadDiscretes(Byte functionCode, Byte
slaveAddress, UInt16 startAddress, UInt16 numberOfPoints)
   at Modbus.Device.ModbusMaster.ReadInputs(Byte slaveAddress, UInt16
startAddress, UInt16 numberOfPoints)
   at NModbusTest.Form1.timer1_Tick(Object sender, EventArgs e) in
D:\Documenti\Visual Studio
2005\Projects\NModbusTest\NModbusTest\Form1.cs:line 64
The thread 0x340 has exited with code 0 (0x0).
The thread 0x15b4 has exited with code 0 (0x0).
The thread 0xe00 has exited with code 0 (0x0).

Original issue reported on code.google.com by pbis...@inwind.it on 6 Mar 2008 at 1:45

GoogleCodeExporter commented 8 years ago
I have the same problem in my application, the correction of this problem is 
very
important to me too. After few minutes in a loop with 150 milliseconds loop the
StackOverflowException occurs in mscorlib.dll (3.5 x64 framework)

Original comment by marcelo....@gmail.com on 29 Aug 2008 at 7:11

GoogleCodeExporter commented 8 years ago

Original comment by sja...@gmail.com on 24 Nov 2008 at 2:47