Merge branch 'release/UpdateCallFrea_01'
This commit is contained in:
@@ -66,7 +66,7 @@ namespace IOB_UT_NEXT
|
||||
// NextDouble() ∈ [0.0, 1.0) → fattore ∈ [-1.0, 1.0)
|
||||
double factor = rnd.NextDouble() * 2.0 - 1.0;
|
||||
// ±10%
|
||||
return (int)(value * (1.0 + 0.10 * factor));
|
||||
return (int)(value * (1.0 + 0.20 * factor));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,4 +34,3 @@ CLI_INST=SteamWareSim
|
||||
STARTLIST=SIMUL_01
|
||||
|
||||
MAXCNC=10
|
||||
|
||||
|
||||
@@ -116,6 +116,11 @@ namespace IOB_WIN_FORM.Iob
|
||||
/// </summary>
|
||||
protected DateTime dtVetoAutoDossier = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// Veto x esecuzione Task2Exe troppo frequenti
|
||||
/// </summary>
|
||||
protected DateTime dtVetoTask2Exe = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// Veto x lettura contapezzi (in caso di autoODL con attesa reset ad esempio...)
|
||||
/// </summary>
|
||||
@@ -1089,14 +1094,6 @@ namespace IOB_WIN_FORM.Iob
|
||||
get => $@"{urlCommandIob("setCounter")}?counter=";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URL per salvataggio contapezzi (quelli della macchina: PLC/CNC)...
|
||||
/// </summary>
|
||||
protected string urlSetPzCountMAC
|
||||
{
|
||||
get => $@"{urlCommand("setCounter")}MAC_{IOBConfFull.General.CodIOB}?counter=";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URL per effettuare salvataggio parametri (snapshot) macchina...
|
||||
/// </summary>
|
||||
@@ -5680,18 +5677,25 @@ namespace IOB_WIN_FORM.Iob
|
||||
// solo se NON sono disabilitati i Task2Exe...
|
||||
if (!IOBConfFull.Device.DisabExeTask)
|
||||
{
|
||||
// recupero elenco delle cose da fare
|
||||
string resp = await getTask2exe("");
|
||||
// se ho qualcosa --> creo obj e lo accodo...
|
||||
if (!string.IsNullOrEmpty(resp) && resp.Length > 2)
|
||||
// se non ho veto task2exe
|
||||
DateTime adesso = DateTime.Now;
|
||||
if (adesso > dtVetoTask2Exe)
|
||||
{
|
||||
accodaServReq("", resp);
|
||||
if (isMulti)
|
||||
// blocco fisso a 5 sec x ora
|
||||
dtVetoTask2Exe = adesso.AddSeconds(5);
|
||||
// recupero elenco delle cose da fare
|
||||
string resp = await getTask2exe("");
|
||||
// se ho qualcosa --> creo obj e lo accodo...
|
||||
if (!string.IsNullOrEmpty(resp) && resp.Length > 2)
|
||||
{
|
||||
foreach (var item in IOBConfFull.Device.MultiIobList)
|
||||
accodaServReq("", resp);
|
||||
if (isMulti)
|
||||
{
|
||||
resp = await getTask2exe(item);
|
||||
accodaServReq(item, resp);
|
||||
foreach (var item in IOBConfFull.Device.MultiIobList)
|
||||
{
|
||||
resp = await getTask2exe(item);
|
||||
accodaServReq(item, resp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6108,7 +6112,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
}
|
||||
|
||||
// Imposto il veto per il prossimo controllo (se ConnOk + rapido sennò meno rapido)
|
||||
var msWait = baseUtils.nextPauseSendMSec * (connectionOk ? 6 : 100);
|
||||
var msWait = baseUtils.nextPauseSendMSec * (connectionOk ? 12 : 150);
|
||||
dtVetoCheckIOB = adesso.AddMilliseconds(msWait);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace IOB_WIN_FORM
|
||||
if (answ)
|
||||
{
|
||||
lgInfo("SERVER ONLINE");
|
||||
utils.dtVetoPing = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 3);
|
||||
utils.dtVetoPing = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -149,7 +149,7 @@ namespace IOB_WIN_FORM
|
||||
else
|
||||
{
|
||||
// allungo periodo controllo...
|
||||
utils.dtVetoPing = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 10);
|
||||
utils.dtVetoPing = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 20);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -158,7 +158,7 @@ namespace IOB_WIN_FORM
|
||||
utils.MPIO_Online = false;
|
||||
updateComStats(0, 0, false);
|
||||
// imposto veto a 10 volte reinvio dati standard...
|
||||
utils.dtVetoPing = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 20);
|
||||
utils.dtVetoPing = DateTime.Now.AddMilliseconds(baseUtils.nextPauseSendMSec * 30);
|
||||
utils.dtVetoSend = utils.dtVetoPing;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,4 +20,3 @@ CLI_INST=SteamWareSim
|
||||
STARTLIST=FTP_SONATEST
|
||||
|
||||
MAXCNC=10
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<add key="maxAliveErrors" value="1000" />
|
||||
<add key="maxErroriCheck" value="300" />
|
||||
<add key="maxSendErrors" value="100" />
|
||||
<add key="maxReadErrors" value="20" />
|
||||
<add key="maxReadErrors" value="40" />
|
||||
<!--parametri SIM-->
|
||||
<add key="waitSimPar" value="180" />
|
||||
|
||||
|
||||
@@ -2350,7 +2350,7 @@ namespace IOB_WIN_MBUS.IobModbusTCP
|
||||
// se > max errori --> disconnetto
|
||||
if (currReadErrors > maxReadErrors)
|
||||
{
|
||||
lgError($"Superato limite errori Read ({currReadErrors}) --> tryDisconnect");
|
||||
lgError($"Read Errors: Superato limite --> tryDisconnect | currReadErrors: {currReadErrors} | maxReadErrors: {maxReadErrors}");
|
||||
currReadErrors = 0;
|
||||
tryDisconnect();
|
||||
}
|
||||
|
||||
@@ -27,4 +27,3 @@ STARTLIST=3024
|
||||
;STARTLIST=LVF652
|
||||
|
||||
MAXCNC=10
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ ENABLE_CLI_RESTART=TRUE
|
||||
DELTA_VAL=0
|
||||
|
||||
; clock base (da 10ms)
|
||||
timerIntMs=50
|
||||
timerIntMs=100
|
||||
|
||||
; conf parametri memoria READ/WRITE
|
||||
OPC_PARAM_CONF=3026.json
|
||||
|
||||
@@ -34,4 +34,3 @@ STARTLIST=3026
|
||||
;STARTLIST=SIMUL_01
|
||||
|
||||
MAXCNC=10
|
||||
|
||||
|
||||
@@ -20,4 +20,3 @@ STARTLIST=SIMUL_08
|
||||
;STARTLIST=3023-PING,3024-PING
|
||||
|
||||
MAXCNC=10
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ CLI_INST=SteamWareSim
|
||||
;STARTLIST=3010
|
||||
;STARTLIST=PIZ03
|
||||
;STARTLIST=3020
|
||||
STARTLIST=SIMUL_01
|
||||
;STARTLIST=SIMUL_01
|
||||
STARTLIST=3010
|
||||
|
||||
MAXCNC=10
|
||||
|
||||
|
||||
@@ -186,8 +186,12 @@
|
||||
<None Include="DATA\CONF\1037.json" />
|
||||
<None Include="DATA\CONF\1038.ini" />
|
||||
<None Include="DATA\CONF\1038.json" />
|
||||
<None Include="DATA\CONF\3010.ini" />
|
||||
<None Include="DATA\CONF\3010_alarm.json" />
|
||||
<None Include="DATA\CONF\3010.ini">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="DATA\CONF\3010_alarm.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="DATA\CONF\3011.ini" />
|
||||
<None Include="DATA\CONF\3011_alarm.json" />
|
||||
<None Include="DATA\CONF\3013.ini" />
|
||||
|
||||
@@ -382,63 +382,29 @@ namespace IOB_WIN_SIEMENS.IobSiemens
|
||||
{
|
||||
if (!string.IsNullOrEmpty(currODL) && currIdxODL > 0)
|
||||
{
|
||||
// ora processo il contapezzi...
|
||||
string retVal = "";
|
||||
// controllo se è passato intervallo minimo tra 2 controlli/elaborazioni x
|
||||
// distanziare invio e ridurre letture
|
||||
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
|
||||
{
|
||||
// Salvo il contapezzi della macchina
|
||||
retVal = utils.CallUrlGet(urlSetPzCountMAC + contapezziPLC.ToString());
|
||||
// verifica se tutto OK, ovvero conferma i pezzi inviati
|
||||
if (retVal != contapezziPLC.ToString())
|
||||
// semplifico: se ho differenza invio in blocco
|
||||
if (contapezziPLC > contapezziIOB)
|
||||
{
|
||||
// errore salvataggio contapezzi
|
||||
lgInfo($"Errore salvataggio Contapezzi PLC SIEMENST-TORRI: {contapezziPLC} | contapezziIOB {contapezziIOB} | Valore tornato: {retVal}");
|
||||
// rileggo il counter pezzi da server
|
||||
pzCntReload(true);
|
||||
}
|
||||
|
||||
// se sono differenti MOSTRO...
|
||||
if (contapezziPLC != contapezziIOB)
|
||||
{
|
||||
// registro contapezzi
|
||||
lgInfo($"Differenza Contapezzi: contapezziPLC: {contapezziPLC} | contapezziIOB: {contapezziIOB}");
|
||||
}
|
||||
|
||||
if ((contapezziPLC > contapezziIOB))
|
||||
{
|
||||
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
|
||||
contapezziIOB++;
|
||||
needRefreshPzCount = true;
|
||||
// salvo in semaforo!
|
||||
B_input += 1 << 2;
|
||||
// registro contapezzi
|
||||
lgInfo($"contapezziPLC SIEMENST-TORRI: {contapezziPLC} | contapezziIOB {contapezziIOB}");
|
||||
}
|
||||
|
||||
if (needRefreshPzCount)
|
||||
{
|
||||
// Salvo il contapezzi della macchina
|
||||
retVal = utils.CallUrlGet(urlSetPzCount + contapezziIOB.ToString());
|
||||
// verifica se tutto OK, ovvero conferma i pezzi inviati
|
||||
if (retVal != contapezziIOB.ToString())
|
||||
{
|
||||
// errore salvataggio contapezzi
|
||||
lgInfo($"Errore salvataggio contapezziPLC SIEMENST-TORRI: {contapezziPLC} | contapezziIOB {contapezziIOB} | Valore tornato: {retVal}");
|
||||
// rileggo il counter pezzi da server
|
||||
pzCntReload(true);
|
||||
}
|
||||
// resetto timer...
|
||||
lastPzCountSend = DateTime.Now;
|
||||
|
||||
// verifico se variato contapezzi... e se passato ritardo minimo...
|
||||
if ((contapezziPLC - contapezziIOB) > minSendPzCountBlock)
|
||||
{
|
||||
trySendPzCountBlock();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
|
||||
contapezziIOB++;
|
||||
needRefreshPzCount = true;
|
||||
// salvo in semaforo!
|
||||
B_input += 1 << 2;
|
||||
}
|
||||
// registro contapezzi
|
||||
lgInfo($"contapezziPLC SIEMENST-TORRI: {contapezziPLC} | contapezziIOB {contapezziIOB}");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -24,4 +24,3 @@ STARTLIST=3018
|
||||
;STARTLIST=SIMUL_06
|
||||
|
||||
MAXCNC=10
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ using System.Diagnostics.CodeAnalysis;
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1056:Le proprietà Uri non devono essere stringhe", Justification = "<In sospeso>", Scope = "member", Target = "~P:IOB_WIN.IobGeneric.urlSetM2IOB")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1056:Le proprietà Uri non devono essere stringhe", Justification = "<In sospeso>", Scope = "member", Target = "~P:IOB_WIN.IobGeneric.urlSetOptVal")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1056:Le proprietà Uri non devono essere stringhe", Justification = "<In sospeso>", Scope = "member", Target = "~P:IOB_WIN.IobGeneric.urlSetPzCount")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1056:Le proprietà Uri non devono essere stringhe", Justification = "<In sospeso>", Scope = "member", Target = "~P:IOB_WIN.IobGeneric.urlSetPzCountMAC")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1056:Le proprietà Uri non devono essere stringhe", Justification = "<In sospeso>", Scope = "member", Target = "~P:IOB_WIN.IobGeneric.urlUpdateWriteParams")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1056:Le proprietà Uri non devono essere stringhe", Justification = "<In sospeso>", Scope = "member", Target = "~P:IOB_WIN.IobMTC.urlSaveDataItems")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1056:Le proprietà Uri non devono essere stringhe", Justification = "<In sospeso>", Scope = "member", Target = "~P:IOB_WIN.MainForm.updateUrl")]
|
||||
|
||||
Reference in New Issue
Block a user