From a2c68600ccbe292370900ec97f97aa377ec5c605 Mon Sep 17 00:00:00 2001 From: Mauro Destro Date: Mon, 12 Sep 2016 12:08:50 +0200 Subject: [PATCH] Missing localIndex offset on startIndex Missing localIndex to offset start write position --- S7.Net/PLC.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/S7.Net/PLC.cs b/S7.Net/PLC.cs index d89015e..264a02d 100644 --- a/S7.Net/PLC.cs +++ b/S7.Net/PLC.cs @@ -548,7 +548,7 @@ namespace S7.Net while (count > 0) { var maxToWrite = (int)Math.Min(count, 200); - ErrorCode lastError = WriteBytesWithASingleRequest(dataType, db, index, value.Skip(localIndex).Take(maxToWrite).ToArray()); + ErrorCode lastError = WriteBytesWithASingleRequest(dataType, db, index + localIndex, value.Skip(localIndex).Take(maxToWrite).ToArray()); if (lastError != ErrorCode.NoError) { return lastError;