Bozza modifiche che COMPILANO e permettono run adapter

This commit is contained in:
S.E.Locatelli
2022-05-10 18:40:03 +02:00
parent ec473290e9
commit b4eeab9ec7
3 changed files with 58 additions and 10 deletions
+12 -8
View File
@@ -133,7 +133,7 @@ namespace IOB_WIN_NEXT
/// <summary>
/// Indica se abbia stato POWER ON (multicondizione)
/// </summary>
protected bool hasPowerOn
protected virtual bool hasPowerOn
{
get
{
@@ -144,7 +144,7 @@ namespace IOB_WIN_NEXT
/// <summary>
/// Indica se abbia stato MANUAL (condizioni varie, es stopped)
/// </summary>
protected bool isManual
protected virtual bool isManual
{
get
{
@@ -155,7 +155,7 @@ namespace IOB_WIN_NEXT
/// <summary>
/// Indica se abbia stato READY (condizioni varie, es ausiliari OK)
/// </summary>
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
{
+1
View File
@@ -365,5 +365,6 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
}
}
+45 -2
View File
@@ -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
}
}
/// <summary>
/// Indica se abbia stato POWER ON (multicondizione)
/// </summary>
protected override bool hasPowerOn
{
get
{
// da rivedere
return true;
//return checkMultiCondition(opcUaParams.condPowerOn);
}
}
/// <summary>
/// Indica se abbia stato MANUAL (condizioni varie, es stopped)
/// </summary>
protected override bool isManual
{
get
{
return false;
//return checkMultiCondition(opcUaParams.condManual);
}
}
/// <summary>
/// Indica se abbia stato READY (condizioni varie, es ausiliari OK)
/// </summary>
protected override bool isReady
{
get
{
return false;
//return checkMultiCondition(opcUaParams.condReady);
}
}
/// <summary>
/// Effettua vera scrittura parametri
/// </summary>