tuyendothanh / nmodbus

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

WriteMultipleRegisters throws exception #68

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
The Error occurs randomly. It works for weeks and months properly and then 
throws the following excption only while writing to registers.
-----------exception----------------
System.ArgumentOutOfRangeException.Maximum amount of data 127 registers.

11/18/2013 10:40:48 AM: System.ArgumentOutOfRangeException: Maximum amount of 
data 127 registers.
Parameter name: NumberOfPoints
   at Modbus.Message.WriteMultipleRegistersResponse.set_NumberOfPoints(UInt16 value)
   at Modbus.Message.WriteMultipleRegistersResponse.InitializeUnique(Byte[] frame)
   at Modbus.Message.ModbusMessage.Initialize(Byte[] frame)
   at Modbus.Message.ModbusMessageFactory.CreateModbusMessage[T](Byte[] frame)
   at Modbus.IO.ModbusTransport.CreateResponse[T](Byte[] frame)
   at Modbus.IO.ModbusSerialTransport.CreateResponse[T](Byte[] frame)
   at Modbus.IO.ModbusRtuTransport.ReadResponse[T]()
   at Modbus.IO.ModbusTransport.UnicastMessage[T](IModbusMessage message)
   at Modbus.Device.ModbusMaster.WriteMultipleRegisters(Byte slaveAddress, UInt16 startAddress, UInt16[] data)
-------------------------------end of exception----------------------

What is the expected output? What do you see instead?
The register should be written properly. But after this error the function 
never writes into the register. At any time I am reading or writing only a 
maximum or 2 registers.

What version of the product are you using? On what operating system?
version - nmodbus 1.11
OS - Windows XP

Please provide any additional information below.

Original issue reported on code.google.com by subbu....@gmail.com on 18 Nov 2013 at 6:41