From 5972e975302ced80d9cc251d77f706b8734de84a Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 5 Feb 2021 14:30:56 +0100 Subject: [PATCH] fi scrittura IO S7Net --- CMS_CORE_Library/S7Net/Nc_S7Net.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMS_CORE_Library/S7Net/Nc_S7Net.cs b/CMS_CORE_Library/S7Net/Nc_S7Net.cs index 1d52205..94f62e7 100644 --- a/CMS_CORE_Library/S7Net/Nc_S7Net.cs +++ b/CMS_CORE_Library/S7Net/Nc_S7Net.cs @@ -3911,6 +3911,7 @@ namespace CMS_CORE_Library.S7Net { CmsError libraryError = NO_ERROR; List rwValuesDO = new List(); + Dictionary newForced = new Dictionary(); // leggo da PLC valori DO... libraryError = MEM_RWWordList(R, 0, IO_DO_VAL_FOR.MemType, IO_DO_VAL_FOR.Address, IO_DO_VAL_FOR.SubAddress, IO_DO_VAL_FOR.Size, ref rwValuesDO); @@ -3934,6 +3935,7 @@ namespace CMS_CORE_Library.S7Net { rwValuesDO[bank] = (ushort)(((int)rwValuesDO[bank]).SetBitZero(pos)); } + newForced.Add(item.Key, true); } // scrivo! @@ -3941,6 +3943,9 @@ namespace CMS_CORE_Library.S7Net if (libraryError.IsError()) return libraryError; + // scrivo forced + PLC_W_IO_DO_Reset(newForced); + return libraryError; } /// @@ -3974,7 +3979,7 @@ namespace CMS_CORE_Library.S7Net return libraryError; // scrivo forced - PLC_W_IO_DO_Reset(newForced); + PLC_W_IO_AO_Reset(newForced); return libraryError; }