From 5d9fc60626c004fdd67ed4a5798fb877e984e8d0 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 30 Jun 2020 15:38:21 +0200 Subject: [PATCH] fiox write CFI ((val + 1) % 8) --- CMS_CORE_Library/S7Net/Nc_S7Net.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMS_CORE_Library/S7Net/Nc_S7Net.cs b/CMS_CORE_Library/S7Net/Nc_S7Net.cs index c65eb04..365a31c 100644 --- a/CMS_CORE_Library/S7Net/Nc_S7Net.cs +++ b/CMS_CORE_Library/S7Net/Nc_S7Net.cs @@ -3029,7 +3029,8 @@ namespace CMS_CORE_Library.S7Net // update only given data... foreach (var item in newData) { - newMem[item.Key - 1] = (byte)item.Value; + // algoritmo: valore = (val + 1) % 8, ovvero riflettore 0, 8, 16 --> 1, riflettore 1, 9, 17 --> 2 + newMem[item.Key - 1] = (byte)((item.Value + 1) % 8); } // return as list... currMem = newMem.ToList();