diff --git a/IOB-UT-NEXT/Config/Base/OdlDto.cs b/IOB-UT-NEXT/Config/Base/OdlDto.cs
index 669b3367..c54a337f 100644
--- a/IOB-UT-NEXT/Config/Base/OdlDto.cs
+++ b/IOB-UT-NEXT/Config/Base/OdlDto.cs
@@ -28,6 +28,12 @@ namespace IOB_UT_NEXT.Config.Base
///
public string ChangeOdlMode { get; set; } = "TIME";
+
+ ///
+ /// Periodo minimo tra richieste ODL corrente al server remoto
+ ///
+ public double VetoCheckOdlSec { get; set; } = 5;
+
///
/// Disabilitazione gestione ODL (lettura e gestione)
///
diff --git a/IOB-WIN-FORM/Iob/Generic.Protected.cs b/IOB-WIN-FORM/Iob/Generic.Protected.cs
index 0bc16389..0d87fed8 100644
--- a/IOB-WIN-FORM/Iob/Generic.Protected.cs
+++ b/IOB-WIN-FORM/Iob/Generic.Protected.cs
@@ -1346,12 +1346,25 @@ namespace IOB_WIN_FORM.Iob
///
protected int CurrOdl()
{
- int answ = 0;
- string sCurrODL = utils.callUrl(urlGetCurrODL);
- int.TryParse(sCurrODL, out answ);
- return answ;
+ int cODL = 0;
+ // vieto controllo prima di 5 sec... da configurare?
+ if (DateTime.Now.Subtract(vetoCheckOdl).TotalSeconds > IOBConfFull.Odl.VetoCheckOdlSec)
+ {
+
+ string sCurrODL = utils.CallUrlGet(urlGetCurrODL);
+ int.TryParse(sCurrODL, out cODL);
+ currIdxODL = cODL;
+ vetoCheckOdl = DateTime.Now;
+ }
+ else
+ {
+ cODL = currIdxODL;
+ }
+ return cODL;
}
+ private DateTime vetoCheckOdl = DateTime.Now;
+
///
/// Aggiunge o aggiorna nDict ad un Dict
///
diff --git a/IOB-WIN-SIEMENS/DATA/CONF/MAIN.ini b/IOB-WIN-SIEMENS/DATA/CONF/MAIN.ini
index 4abdb4f7..1a8ea97c 100644
--- a/IOB-WIN-SIEMENS/DATA/CONF/MAIN.ini
+++ b/IOB-WIN-SIEMENS/DATA/CONF/MAIN.ini
@@ -20,7 +20,6 @@ CLI_INST=SteamWareSim
;NB: mettere copy always ai file di conf x fare test...
;STARTLIST=PIZ08
-;STARTLIST=3020
;STARTLIST=1032
;STARTLIST=1033
;STARTLIST=1034
@@ -36,7 +35,8 @@ CLI_INST=SteamWareSim
;STARTLIST=GT554
;STARTLIST=PIZ08
;STARTLIST=iBTB1P
-STARTLIST=3010
+;STARTLIST=3010
+STARTLIST=3020
;STARTLIST=PIZ03
MAXCNC=10
diff --git a/IOB-WIN-SIEMENS/IOB-WIN-SIEMENS.csproj b/IOB-WIN-SIEMENS/IOB-WIN-SIEMENS.csproj
index 676cdc11..f37f8d20 100644
--- a/IOB-WIN-SIEMENS/IOB-WIN-SIEMENS.csproj
+++ b/IOB-WIN-SIEMENS/IOB-WIN-SIEMENS.csproj
@@ -186,18 +186,18 @@
-
- Always
-
-
- Always
-
+
+
-
-
+
+ Always
+
+
+ Always
+
diff --git a/IOB-WIN-SIEMENS/IobSiemens/SiemensTorri.cs b/IOB-WIN-SIEMENS/IobSiemens/SiemensTorri.cs
index efcdbbe0..9efd4e19 100644
--- a/IOB-WIN-SIEMENS/IobSiemens/SiemensTorri.cs
+++ b/IOB-WIN-SIEMENS/IobSiemens/SiemensTorri.cs
@@ -350,6 +350,17 @@ namespace IOB_WIN_SIEMENS.IobSiemens
// procedo SOLO SE รจ enabled IOB
if (IobOnline)
{
+ // 2026.04.24 controllo ODL solo se son passati ALMENO 10 sec
+ int newIdx = CurrOdl();
+ currODL = $"{currIdxODL}";
+#if DEBUG
+ lgInfo($"SiemensTorri | Verifica ODL | IdxODL {currIdxODL}");
+#else
+ lgDebug($"SiemensTorri | Verifica ODL | IdxODL {currIdxODL}");
+#endif
+
+ // 2026.04.24 tolto gestione ridondante
+#if false
try
{
currODL = utils.callUrl(urlGetCurrODL);
@@ -380,6 +391,7 @@ namespace IOB_WIN_SIEMENS.IobSiemens
lastWarnODL = DateTime.Now;
}
}
+#endif
}
else
{
@@ -387,10 +399,12 @@ namespace IOB_WIN_SIEMENS.IobSiemens
currODL = "";
if (periodicLog)
{
- lgInfo($"Fanuc | Lettura ODL non effettuata: IobOnline: {IobOnline} | currODL impostato a vuoto");
+ lgInfo($"Fanuc | Lettura ODL non effettuata: IobOnline: {IobOnline} | currODL: {currODL} | currIdxODL: {currIdxODL}");
}
}
- if (!string.IsNullOrEmpty(currODL) && currODL != "0")
+
+ //if (!string.IsNullOrEmpty(currODL) && currODL != "0")
+ if (!string.IsNullOrEmpty(currODL) && currIdxODL > 0)
{
// ora processo il contapezzi...
string retVal = "";
@@ -415,6 +429,7 @@ namespace IOB_WIN_SIEMENS.IobSiemens
// registro contapezzi
lgInfo($"Differenza Contapezzi: contapezziPLC: {contapezziPLC} | contapezziIOB: {contapezziIOB}");
}
+
if ((contapezziPLC > contapezziIOB))
{
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
@@ -471,7 +486,7 @@ namespace IOB_WIN_SIEMENS.IobSiemens
// log opzionale!
if (verboseLog)
{
- lgInfo("Trasformazione B_input: {B_input}");
+ lgInfo($"Trasformazione B_input: {B_input}");
}
}