diff --git a/IOB-WIN-NEXT/IobOpcUa.cs b/IOB-WIN-NEXT/IobOpcUa.cs index ba93bea6..4181c7b3 100644 --- a/IOB-WIN-NEXT/IobOpcUa.cs +++ b/IOB-WIN-NEXT/IobOpcUa.cs @@ -133,7 +133,7 @@ namespace IOB_WIN_NEXT /// /// Indica se abbia stato POWER ON (multicondizione) /// - protected bool hasPowerOn + protected virtual bool hasPowerOn { get { @@ -144,7 +144,7 @@ namespace IOB_WIN_NEXT /// /// Indica se abbia stato MANUAL (condizioni varie, es stopped) /// - protected bool isManual + protected virtual bool isManual { get { @@ -155,7 +155,7 @@ namespace IOB_WIN_NEXT /// /// Indica se abbia stato READY (condizioni varie, es ausiliari OK) /// - protected bool isReady + protected virtual bool isReady { get { @@ -453,16 +453,20 @@ namespace IOB_WIN_NEXT byte[] rawByte = new byte[115]; try { + var test = ((DataValue)rawVal).WrappedValue; //rawByte = ObjectToByteArray(rawVal); - rawByte = (byte[]) rawVal; + var test02= ((Opc.Ua.ExtensionObject) test.Value).Body; + rawByte = (byte[])test02; + StringBuilder sb = new StringBuilder(); + foreach (var bVal in rawByte) + { + sb.Append($"{bVal},"); + } + currVal = sb.ToString(); } catch { } - // altro test di conversione - - currVal = bSerString("OPC", rawByte); - var testData = bSerObj("OPC", rawByte); } else { diff --git a/IOB-WIN-NEXT/IobOpcUaOmron.cs b/IOB-WIN-NEXT/IobOpcUaOmron.cs index 02f39db9..e3a109d5 100644 --- a/IOB-WIN-NEXT/IobOpcUaOmron.cs +++ b/IOB-WIN-NEXT/IobOpcUaOmron.cs @@ -365,5 +365,6 @@ namespace IOB_WIN_NEXT } #endregion Public Methods + } } \ No newline at end of file diff --git a/IOB-WIN-NEXT/IobOpcUaOmronIcoel.cs b/IOB-WIN-NEXT/IobOpcUaOmronIcoel.cs index 59f0f0f0..cdffcab1 100644 --- a/IOB-WIN-NEXT/IobOpcUaOmronIcoel.cs +++ b/IOB-WIN-NEXT/IobOpcUaOmronIcoel.cs @@ -230,6 +230,7 @@ namespace IOB_WIN_NEXT B_input = powerOnOk ? 1 : 0; // decodifico da currData +#if false @@ -266,11 +267,13 @@ namespace IOB_WIN_NEXT { // se NON ready --> manual B_input += (1 << 4); - } + } +#endif } // se abilitato watchdog... if (opcUaParams.WatchDog.IsEnabled) { +#if false if (adesso.Subtract(lastWatchDogPLC).TotalSeconds > 2) { lastWatchDogPLC = adesso; @@ -295,7 +298,8 @@ namespace IOB_WIN_NEXT { lgError($"Eccezione in gestione WatchDog, valore attuale {WatchDog}{Environment.NewLine}{exc}"); } - } + } +#endif } else { @@ -324,6 +328,45 @@ namespace IOB_WIN_NEXT } } + + + /// + /// Indica se abbia stato POWER ON (multicondizione) + /// + protected override bool hasPowerOn + { + get + { + // da rivedere + return true; + //return checkMultiCondition(opcUaParams.condPowerOn); + } + } + + /// + /// Indica se abbia stato MANUAL (condizioni varie, es stopped) + /// + protected override bool isManual + { + get + { + return false; + //return checkMultiCondition(opcUaParams.condManual); + } + } + + /// + /// Indica se abbia stato READY (condizioni varie, es ausiliari OK) + /// + protected override bool isReady + { + get + { + return false; + //return checkMultiCondition(opcUaParams.condReady); + } + } + /// /// Effettua vera scrittura parametri ///