Commit 7f777d98 authored by hmarius's avatar hmarius Committed by GitHub

Update ModbusServer.cs

parent ec3b3699
......@@ -829,7 +829,7 @@ namespace AMWD.Modbus.Tcp.Server
for (int i = 0; i < request.Count; i++)
{
var addr = (ushort)(request.Address + i);
var val = request.Data.GetUInt16(i * 2);
var val = request.Data.GetUInt16(i * 2 + 1);
var register = new Register { Address = addr, Value = val };
SetHoldingRegister(request.DeviceId, register);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment