Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Samuele Locatelli
2022-09-21 18:30:10 +02:00
4 changed files with 37 additions and 46 deletions
@@ -18,8 +18,8 @@
"##",
"EMERGENZA FINECORSA GUIDA INGRESSO",
"ANOMALIA BARRA SALDATURA",
"TIMEOUT PROXIMITY SBOBINATORE INFERIORE",
"TIMEOUT PROXIMITY SBOBINATORE SUPERIORE",
"##TIMEOUT PROXIMITY SBOBINATORE INFERIORE",
"##TIMEOUT PROXIMITY SBOBINATORE SUPERIORE",
"ROTTURA FILM",
"ANOMALIA SONDA PT100 TUNNEL",
"ANOMALIA SONDA PT100 SALDATURA",
+7 -20
View File
@@ -4416,6 +4416,7 @@ namespace IOB_WIN_NEXT
bool answ = false;
int numErrors = 0;
int currStatus = 0;
ushort full16 = 65535;
int[] listInt = new int[2];
if (alarmMaps != null)
{
@@ -4425,31 +4426,17 @@ namespace IOB_WIN_NEXT
// banchi in array Int16 --> scompongo
for (int i = 0; i < item.size / 2; i++)
{
#if false
// verifico se usare LUT
bool useLUT = memSetR != null && memSetR.Count > 0;
if (useLUT)
currStatus = getAlarmStatus(item);
// ora filtro x l'i-esimo banco a 16 bit...
if (i == 0)
{
int lutAddress = 40000 + item.index;
if (HoldingRegisterLUT.ContainsKey(lutAddress))
{
try
{
listInt = HoldingRegisterLUT[lutAddress];
}
catch (Exception exc)
{
lgError($"Errore in lettura da HoldingRegisterLUT per indirizzo {lutAddress} | item {item.memAddr}{Environment.NewLine}{exc}");
}
}
currStatus = (ushort)(currStatus & full16);
}
else
{
listInt = readInputReg(item.index, item.size);
var temp = currStatus >> 16;
currStatus = (ushort)temp;
}
currStatus = ModbusClient.ConvertRegistersToInt(listInt);
#endif
currStatus = getAlarmStatus(item);
// aggiornamento blink counters dato nuovo valore
item.checkBlinkCounter(i, (uint)currStatus);
+2 -2
View File
@@ -610,7 +610,7 @@ namespace IOB_WIN_NEXT
}
/// <summary>
/// Recupero allarmi specifico x ModbusTCP
/// Recupero allarmi specifico x ModbusTCP (16 e 32 bit...)
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
@@ -850,7 +850,7 @@ namespace IOB_WIN_NEXT
parametri.memSizeRead = fIni.ReadInteger("MEMORY", "SIZE_READ", 0);
parametri.memSizeWrite = fIni.ReadInteger("MEMORY", "SIZE_WRITE", 0);
parametri.holdRegBaseAddr = fIni.ReadInteger("MEMORY", "HR_BASE_ADDR", 40001);
// valore delta base
// valore delta base e shift
deltaBase = fIni.ReadInteger("MEMORY", "DELTA_BASE", 0);
// salvo vettori memoria...
lgInfoStartup("Set RawInput dimensions...");
+26 -22
View File
@@ -1,5 +1,6 @@
using EasyModbus;
using System;
using System.Linq;
namespace IOB_WIN_NEXT
{
@@ -105,6 +106,9 @@ namespace IOB_WIN_NEXT
{
int[] listInt = new int[2];
listInt = HoldingRegisterLUT[statusReg];
var dataList = listInt.ToList();
dataList.Reverse();
listInt = dataList.ToArray();
answ = ModbusClient.ConvertRegistersToInt(listInt);
}
return answ;
@@ -132,7 +136,7 @@ namespace IOB_WIN_NEXT
* B4: manuale
* B5: TC Lento
* B6: WarmUp/CoolDown
* B7: Emergenza
* B7: Emergenza armata
*
----------------------------------------------------- */
@@ -146,37 +150,37 @@ namespace IOB_WIN_NEXT
}
// processo dagli stati + gravi...
if (EStop)
if (!EStop)
{
byteSignals += (1 << 7);
}
else if (hasAlarms())
if (hasAlarms())
{
byteSignals += (1 << 3);
}
else
// verifico gli stati specifici x decodificare... 41108
switch (StatusLavoro)
{
// verifico gli stati specifici x decodificare... 41108
switch (StatusLavoro)
{
// resta FERMA (pronta)
case 0:
default:
break;
// resta FERMA (pronta)
case 0:
default:
break;
case 1:
byteSignals += (1 << 6);
break;
case 1:
byteSignals += (1 << 6);
break;
case 2:
case 3:
byteSignals += (1 << 4);
break;
// spostato 2 in lavora
//case 2:
case 3:
byteSignals += (1 << 4);
break;
case 4:
byteSignals += (1 << 1);
break;
}
case 2:
case 4:
byteSignals += (1 << 1);
break;
}
// salvo!