From 1ae0f377cf720d832c4c61b87cf95ab357f9027a Mon Sep 17 00:00:00 2001 From: Patrik Hagemann Date: Tue, 24 Oct 2023 09:09:23 +0200 Subject: [PATCH 1/2] Add Bit-Query support in AGMultiRead --- multi.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/multi.go b/multi.go index c936154..2726907 100644 --- a/multi.go +++ b/multi.go @@ -162,8 +162,11 @@ func (mb *client) AGReadMulti(dataItems []S7DataItem, itemsCount int) (err error // Adjusts the offset var addr int - if dataItems[i].WordLen == s7wlbit || dataItems[i].WordLen == s7wlcounter || dataItems[i].WordLen == s7wltimer { + if dataItems[i].WordLen == s7wlcounter || dataItems[i].WordLen == s7wltimer { addr = dataItems[i].Start + } else if dataItems[i].WordLen == s7wlbit { + addr = dataItems[i].Start << 3 + addr += dataItems[i].Bit // Add Bit addr } else { addr = dataItems[i].Start * 8 } From f1da4eae1acddd1cf62d840cae43f911a75c6170 Mon Sep 17 00:00:00 2001 From: Patrik Hagemann Date: Mon, 30 Oct 2023 08:21:44 +0100 Subject: [PATCH 2/2] Add Bit-Query support in AGMultiRead --- multi.go | 1 + 1 file changed, 1 insertion(+) diff --git a/multi.go b/multi.go index 2726907..41563ff 100644 --- a/multi.go +++ b/multi.go @@ -14,6 +14,7 @@ type S7DataItem struct { WordLen int DBNumber int Start int + Bit int Amount int Data []byte Error string