Merge branch 'release/IobWinPing_01'
This commit is contained in:
@@ -1019,11 +1019,11 @@ namespace IOB_UT_NEXT
|
||||
public bool saveAndSendMessage(string memKey, string notifyChannel, string message)
|
||||
{
|
||||
bool fatto = false;
|
||||
// effettuo la scrittura nell'area di memoria indicata SE passato intervallo minimo
|
||||
// effettuo la scrittura nell'area di memoria indicata SE passato intervallo minimo di 5 sec
|
||||
bool doSave = true;
|
||||
if (LastKeySave.ContainsKey(memKey))
|
||||
{
|
||||
if (DateTime.Now.Subtract(LastKeySave[memKey]).TotalSeconds < 1)
|
||||
if (DateTime.Now.Subtract(LastKeySave[memKey]).TotalSeconds < 5)
|
||||
{
|
||||
doSave = false;
|
||||
}
|
||||
@@ -1036,7 +1036,7 @@ namespace IOB_UT_NEXT
|
||||
{
|
||||
cache.StringSet(memKey, message);
|
||||
LastKeySave[memKey] = DateTime.Now;
|
||||
Logging.Instance.Trace($"Redis Cache Key: {memKey}");
|
||||
Logging.Instance.Trace($"Redis Cache Key saved: {memKey}");
|
||||
}
|
||||
|
||||
// invio notifica tramite il canale richiesto
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
;Configurazione IOB-WIN
|
||||
[IOB]
|
||||
CNCTYPE=PingWatchdog
|
||||
PING_MS_TIMEOUT=500
|
||||
IOB_NAME=3024
|
||||
|
||||
[MACHINE]
|
||||
VENDOR=STEAMWARE
|
||||
MODEL=WATCHDOG
|
||||
|
||||
[CNC]
|
||||
IP=192.168.0.68
|
||||
;IP=192.168.1.7 Server MP
|
||||
PORT=0000
|
||||
|
||||
[SERVER]
|
||||
MPIP=http://192.168.1.7
|
||||
MPURL=/MP/IO
|
||||
CMDBASE=/IOB/input/
|
||||
CMDFLOG=/IOB/flog/
|
||||
CMDALIVE=/IOB
|
||||
CMDENABLED=/IOB/enabled/
|
||||
CMDADV1=?valore=
|
||||
CMDREBO=/sendReboot.aspx?idxMacchina=
|
||||
CMD_ODL_STARTED=/IOB/getCurrOdlStart/
|
||||
CMD_FORCLE_SPLIT_ODL=/IOB/forceSplitOdlFull/
|
||||
CMD_IDLE_TIME=/IOB/getIdlePeriod/
|
||||
|
||||
[MEMORY]
|
||||
|
||||
[BLINK]
|
||||
MAX_COUNTER_BLINK = 15
|
||||
BLINK_FILT=0
|
||||
|
||||
[OPTPAR]
|
||||
timerIntMs=300
|
||||
VETO_QUEUE_IN=15
|
||||
AUTO_CHANGE_ODL=false
|
||||
POWEROFF_TIMEOUT_SEC=60
|
||||
DISABLE_PZCOUNT=TRUE
|
||||
;; gestioni PING
|
||||
;MAX_TRY_PING=3
|
||||
;VETO_QUEUE_IN=4
|
||||
;VETO_PING_SEC=4
|
||||
;VETO_CHECKDIR_SEC=10
|
||||
;MAX_ELAPSED_TIME_SEC=60
|
||||
;VETO_SEND_SNAPSHOT=3
|
||||
|
||||
[BRANCH]
|
||||
NAME=master
|
||||
|
||||
; Tags manuali
|
||||
[TAGS]
|
||||
Customer=JETCO
|
||||
HostOS=WIN
|
||||
HostName=IOB-WIN-09
|
||||
HostAddr=192.168.1.133
|
||||
@@ -51,6 +51,7 @@ CLI_INST=SteamWareSim
|
||||
;STARTLIST=2014
|
||||
;STARTLIST=Tend_RAMA_10_47
|
||||
;STARTLIST=3024
|
||||
;STARTLIST=3024-PING
|
||||
STARTLIST=2015
|
||||
|
||||
|
||||
|
||||
@@ -37,6 +37,14 @@ BLINK_FILT=0
|
||||
VETO_QUEUE_IN=15
|
||||
AUTO_CHANGE_ODL=false
|
||||
POWEROFF_TIMEOUT_SEC=60
|
||||
DISABLE_PZCOUNT=TRUE
|
||||
;; gestioni PING
|
||||
;MAX_TRY_PING=3
|
||||
;VETO_QUEUE_IN=4
|
||||
;VETO_PING_SEC=4
|
||||
;VETO_CHECKDIR_SEC=10
|
||||
;MAX_ELAPSED_TIME_SEC=60
|
||||
;VETO_SEND_SNAPSHOT=3
|
||||
|
||||
|
||||
[BRANCH]
|
||||
|
||||
@@ -637,6 +637,9 @@
|
||||
<None Include="DATA\CONF\2014.ini" />
|
||||
<None Include="DATA\CONF\2014.json" />
|
||||
<None Include="DATA\CONF\3010_alarm.json" />
|
||||
<None Include="DATA\CONF\3024-PING.ini">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="DATA\CONF\3028.json" />
|
||||
<None Include="DATA\CONF\3028.ini" />
|
||||
<None Include="DATA\CONF\GIACO_CENTERFRIGO_MBlock_all.json" />
|
||||
|
||||
+14
-14
@@ -36,7 +36,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
lg.Debug(message);
|
||||
if (sendToForm)
|
||||
{
|
||||
@@ -56,7 +56,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
lg.Debug(message, args);
|
||||
sendToLogWatch("DEBUG", message, args);
|
||||
}
|
||||
@@ -72,7 +72,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
lg.Error(message);
|
||||
if (sendToForm)
|
||||
{
|
||||
@@ -92,7 +92,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
lg.Error(message, args);
|
||||
sendToLogWatch("ERROR", message, args);
|
||||
}
|
||||
@@ -110,7 +110,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
lg.Error(exception, message, args);
|
||||
sendToLogWatch("ERROR", message, exception, args);
|
||||
}
|
||||
@@ -126,7 +126,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
lg.Fatal(message);
|
||||
if (sendToForm)
|
||||
{
|
||||
@@ -146,7 +146,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
lg.Fatal(message, args);
|
||||
sendToLogWatch("FATAL", message, args);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
lg.Fatal(exception, message, args);
|
||||
sendToLogWatch("FATAL", message, exception, args);
|
||||
}
|
||||
@@ -180,7 +180,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
lg.Info(message);
|
||||
if (sendToForm)
|
||||
{
|
||||
@@ -200,7 +200,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
lg.Info(message, args);
|
||||
sendToLogWatch("INFO", message, args);
|
||||
}
|
||||
@@ -217,7 +217,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
DateTime adesso = DateTime.Now;
|
||||
if (adesso.Subtract(lastLogStartup).TotalMinutes > vetoLogStartupDuration)
|
||||
{
|
||||
@@ -246,7 +246,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
DateTime adesso = DateTime.Now;
|
||||
if (adesso.Subtract(lastLogStartup).TotalMinutes > vetoLogStartupDuration)
|
||||
{
|
||||
@@ -271,7 +271,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
lg.Trace(message);
|
||||
if (sendToForm)
|
||||
{
|
||||
@@ -291,7 +291,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// se non ho veto --> loggo
|
||||
if (!doVeto)
|
||||
{
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.codIOB;
|
||||
lg.Factory.Configuration.Variables["codIOB"] = cIobConf.filenameIOB;
|
||||
lg.Trace(message, args);
|
||||
sendToLogWatch("TRACE", message, args);
|
||||
}
|
||||
|
||||
+44
-31
@@ -1,8 +1,11 @@
|
||||
using IOB_UT_NEXT;
|
||||
using MapoSDK;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IOB_WIN_NEXT.IobNet
|
||||
{
|
||||
@@ -68,45 +71,55 @@ namespace IOB_WIN_NEXT.IobNet
|
||||
/// </summary>
|
||||
public override void readSemafori(ref newDisplayData currDispData)
|
||||
{
|
||||
int msVeto = 5000;
|
||||
Stopwatch sw = new Stopwatch();
|
||||
DateTime adesso = DateTime.Now;
|
||||
//lgInfo($"readSemafori | {adesso}");
|
||||
sw.Start();
|
||||
byte[] MemBlock = new byte[2];
|
||||
try
|
||||
if (adesso.Subtract(lastPING).TotalMilliseconds >= msVeto)
|
||||
{
|
||||
currDispData.semIn = Semaforo.SV;
|
||||
// in primis salvo data ping comunque...
|
||||
lastPING = DateTime.Now;
|
||||
try
|
||||
{
|
||||
currDispData.semIn = Semaforo.SV;
|
||||
// in primis salvo data ping comunque...
|
||||
lastPING = DateTime.Now;
|
||||
// salvo esito ping
|
||||
bool pingOK = testPingMachine == IPStatus.Success;
|
||||
addTest(pingOK);
|
||||
|
||||
// salvo esito ping
|
||||
bool pingOK = testPingMachine == IPStatus.Success;
|
||||
addTest(pingOK);
|
||||
// se passa il ping faccio il resto...
|
||||
if (pingStatusOk())
|
||||
{
|
||||
connectionOk = true;
|
||||
lastReadPLC = DateTime.Now;
|
||||
lastWatchDog = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
connectionOk = false;
|
||||
}
|
||||
|
||||
// se passa il ping faccio il resto...
|
||||
if (pingStatusOk())
|
||||
{
|
||||
connectionOk = true;
|
||||
lastReadPLC = DateTime.Now;
|
||||
lastWatchDog = DateTime.Now;
|
||||
if (connectionOk)
|
||||
{
|
||||
B_input = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
B_input = 0;
|
||||
}
|
||||
// annullo lettura bit signal IN pre/post x evitare invio automatico...
|
||||
B_output = B_input;
|
||||
B_previous = B_input;
|
||||
}
|
||||
else
|
||||
catch
|
||||
{
|
||||
connectionOk = false;
|
||||
currDispData.semIn = Semaforo.SR;
|
||||
}
|
||||
|
||||
if (connectionOk)
|
||||
{
|
||||
B_input = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
B_input = 0;
|
||||
}
|
||||
// annullo lettura bit signal IN pre/post x evitare invio automatico...
|
||||
B_output = B_input;
|
||||
B_previous = B_input;
|
||||
}
|
||||
catch
|
||||
{
|
||||
currDispData.semIn = Semaforo.SR;
|
||||
}
|
||||
sw.Stop();
|
||||
// fermo per una quota del tempo di attesa previsto
|
||||
Task.Delay(msVeto - (int)sw.ElapsedMilliseconds + 20);
|
||||
}
|
||||
|
||||
public override void startAdapter(bool resetQueue)
|
||||
|
||||
@@ -73,8 +73,8 @@ REM IOBVPN4MACHINE
|
||||
REM ROBOCOPY . \\10.51.90.5\Steamware\IOB-WIN-NEXT-DEB /MIR
|
||||
REM ROBOCOPY . \\10.51.90.5\Steamware\IOB-WIN-NEXT-DEB /MIR /log:RobocopyTransfer.log
|
||||
REM ROBOCOPY . Z:\IOB-WIN-NEXT-DEB /MIR
|
||||
REM ROBOCOPY . \\10.51.90.9\Steamware\IOB-WIN-NEXT-DEB /MIR
|
||||
ROBOCOPY . \\10.51.90.10\Steamware\IOB-WIN-NEXT-DEB /MIR
|
||||
ROBOCOPY . \\10.51.90.9\Steamware\IOB-WIN-NEXT-DEB /MIR
|
||||
REM ROBOCOPY . \\10.51.90.10\Steamware\IOB-WIN-NEXT-DEB /MIR
|
||||
|
||||
goto END
|
||||
|
||||
|
||||
Reference in New Issue
Block a user