Merge branch 'release/FixSimEmerg01'

This commit is contained in:
Samuele Locatelli
2023-10-14 12:09:53 +02:00
17 changed files with 182 additions and 143 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ namespace IOB_UT_NEXT
// solo se ho dei pezzi rilevati...
if (pzCountPLC > 0 && pzCountIOB > 0)
{
answ = (currTC >= limitTC);
answ = (currTC >= limitTC && limitTC > 0);
}
return answ;
}
+4 -4
View File
@@ -43,13 +43,13 @@ PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
;gestione invio pezzi in blocco
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=50
MAX_SEND_PZC_BLOCK=200
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
; gestione cambio ODL automatico (minuti minimi durata)
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10100
SIM_PZCNT=25|1
SIM_PZCNT=5|1
SIM_ALARM=100|10
SIM_MANU=50|6
; indica gestione e simulazione bit 5 --> slow
+3 -3
View File
@@ -43,13 +43,13 @@ PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
;gestione invio pezzi in blocco
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=50
MIN_SEND_PZC_BLOCK=5
MAX_SEND_PZC_BLOCK=200
; gestione cambio ODL automatico (minuti minimi durata)
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9500
SIM_PZCNT=48|1
SIM_PZCNT=8|1
SIM_ALARM=900|15
SIM_MANU=40|5
; indica gestione e simulazione bit 5 --> slow/emergenza
+3 -3
View File
@@ -44,7 +44,7 @@ PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10400
SIM_PZCNT=65|1
SIM_PZCNT=15|1
SIM_ALARM=1000|20
SIM_MANU=100|4
; indica gestione e simulazione bit 5 --> slow/emergenza
@@ -72,9 +72,9 @@ FORCE_DYN_DATA=TRUE
NEW_DYN_DATA=TRUE
;gestione invio pezzi in blocco
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=50
MIN_SEND_PZC_BLOCK=5
MAX_SEND_PZC_BLOCK=200
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; indica parametri gestione TcMan
TC_MAX_TC_FACTOR=3.9
TC_LAMBDA=0.4
+3 -3
View File
@@ -43,7 +43,7 @@ PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10300
SIM_PZCNT=53|1
SIM_PZCNT=13|1
SIM_ALARM=1000|20
SIM_MANU=100|10
; indica gestione e simulazione bit 5 --> slow/emergenza
@@ -71,9 +71,9 @@ FORCE_DYN_DATA=TRUE
NEW_DYN_DATA=TRUE
;gestione invio pezzi in blocco
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=50
MIN_SEND_PZC_BLOCK=5
MAX_SEND_PZC_BLOCK=200
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; indica parametri gestione TcMan
TC_MAX_TC_FACTOR=3.9
TC_LAMBDA=0.4
+3 -3
View File
@@ -43,7 +43,7 @@ PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10200
SIM_PZCNT=63|1
SIM_PZCNT=13|1
SIM_ALARM=1000|20
SIM_MANU=100|10
; indica gestione e simulazione bit 5 --> slow/emergenza
@@ -71,9 +71,9 @@ FORCE_DYN_DATA=TRUE
NEW_DYN_DATA=TRUE
;gestione invio pezzi in blocco
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=50
MIN_SEND_PZC_BLOCK=5
MAX_SEND_PZC_BLOCK=200
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; indica parametri gestione TcMan
TC_MAX_TC_FACTOR=3.9
TC_LAMBDA=0.4
+3 -3
View File
@@ -43,7 +43,7 @@ PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9600
SIM_PZCNT=33|1
SIM_PZCNT=13|1
SIM_ALARM=1000|20
SIM_MANU=100|10
; indica gestione e simulazione bit 5 --> slow/emergenza
@@ -71,9 +71,9 @@ FORCE_DYN_DATA=TRUE
NEW_DYN_DATA=TRUE
;gestione invio pezzi in blocco
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=50
MIN_SEND_PZC_BLOCK=5
MAX_SEND_PZC_BLOCK=200
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; indica parametri gestione TcMan
TC_MAX_TC_FACTOR=3.9
TC_LAMBDA=0.4
+3 -3
View File
@@ -43,7 +43,7 @@ PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9900
SIM_PZCNT=47|1
SIM_PZCNT=13|1
SIM_ALARM=200|20
SIM_MANU=150|3
; indica gestione e simulazione bit 5 --> slow
@@ -71,9 +71,9 @@ FORCE_DYN_DATA=TRUE
NEW_DYN_DATA=TRUE
;gestione invio pezzi in blocco
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=50
MIN_SEND_PZC_BLOCK=5
MAX_SEND_PZC_BLOCK=200
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; indica parametri gestione TcMan
TC_MAX_TC_FACTOR=3.9
TC_LAMBDA=0.4
+3 -3
View File
@@ -42,7 +42,7 @@ PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9800
SIM_PZCNT=73|1
SIM_PZCNT=13|1
SIM_ALARM=200|10
SIM_MANU=130|3
; indica gestione e simulazione bit 5 --> slow
@@ -70,9 +70,9 @@ FORCE_DYN_DATA=TRUE
NEW_DYN_DATA=TRUE
;gestione invio pezzi in blocco
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=50
MIN_SEND_PZC_BLOCK=5
MAX_SEND_PZC_BLOCK=200
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; indica parametri gestione TcMan
TC_MAX_TC_FACTOR=3.9
TC_LAMBDA=0.4
+2 -2
View File
@@ -45,10 +45,10 @@ ENABLE_PZ_RESET=TRUE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10500
SIM_PZCNT=30|3
SIM_PZCNT=10|3
SIM_ALARM=1000|20
SIM_MANU=50|6
; 1 = indica che la macchina è multi --> allo scadere del contapezzo gestisce ANCHE il giro tavola sui bit relativi
+111 -83
View File
@@ -1,87 +1,115 @@
{
"mMapWrite": {
"setArt": {
"name": "setArt",
"description": "Articolo",
"memAddr": "DB150.DBB12",
"tipoMem": "String",
"index": 12,
"size": 20
},
"setComm": {
"name": "setComm",
"description": "Commessa",
"memAddr": "DB150.DBB32",
"tipoMem": "String",
"index": 32,
"size": 20
},
"setPzComm": {
"name": "setPzComm",
"description": "Qta Richiesta",
"memAddr": "DB150.DBB8",
"tipoMem": "Int",
"index": 8,
"size": 4
},
"forceSetPzCount": {
"name": "forceSetPzCount",
"description": "Imposta Qta",
"memAddr": "DB150.DBB8",
"tipoMem": "Int",
"index": 8,
"size": 4
}
"mMapWrite": {
"setArt": {
"name": "setArt",
"description": "Articolo",
"memAddr": "DB150.DBB12",
"tipoMem": "String",
"index": 12,
"size": 20,
"displOrdinal": 1
},
"mMapRead": {
"TEMP_01": {
"name": "TEMP_01",
"description": "Temperatura 01",
"tipoMem": "Real",
"minVal": 18,
"maxVal": 24
},
"POWER_01": {
"name": "POWER_01",
"description": "Potenza impianto",
"tipoMem": "Int",
"minVal": 40,
"maxVal": 80
},
"FEED_OVER": {
"name": "FEED_OVER",
"description": "FEED override",
"tipoMem": "Int",
"minVal": 0,
"maxVal": 100
},
"RAPID_OVER": {
"name": "RAPID_OVER",
"description": "RAPID override",
"tipoMem": "Int",
"minVal": 50,
"maxVal": 120
},
"POS_X": {
"name": "POS_X",
"description": "Asse X",
"tipoMem": "Int",
"minVal": -2000,
"maxVal": 2000
},
"POS_Y": {
"name": "POS_Y",
"description": "Asse Y",
"tipoMem": "Int",
"minVal": 0,
"maxVal": 2000
},
"POS_Z": {
"name": "POS_Z",
"description": "Asse Z",
"tipoMem": "Int",
"minVal": 0,
"maxVal": 1500
}
"setComm": {
"name": "setComm",
"description": "Commessa",
"memAddr": "DB150.DBB32",
"tipoMem": "String",
"index": 32,
"size": 20,
"displOrdinal": 2
},
"setPzComm": {
"name": "setPzComm",
"description": "Qta Richiesta",
"memAddr": "DB150.DBB8",
"tipoMem": "Int",
"index": 8,
"size": 4,
"displOrdinal": 3
},
"forceSetPzCount": {
"name": "forceSetPzCount",
"description": "Imposta Qta",
"memAddr": "DB150.DBB8",
"tipoMem": "Int",
"index": 8,
"size": 4,
"displOrdinal": 11
}
},
"mMapRead": {
"TEMP_01": {
"name": "TEMP_01",
"description": "Temperatura 01",
"tipoMem": "Real",
"minVal": 18,
"maxVal": 24,
"displOrdinal": 4
},
"POWER_01": {
"name": "POWER_01",
"description": "Potenza impianto",
"tipoMem": "Int",
"minVal": 40,
"maxVal": 80,
"displOrdinal": 5
},
"FEED_OVER": {
"name": "FEED_OVER",
"description": "FEED override",
"tipoMem": "Int",
"minVal": 0,
"maxVal": 100,
"displOrdinal": 6
},
"RAPID_OVER": {
"name": "RAPID_OVER",
"description": "RAPID override",
"tipoMem": "Int",
"minVal": 50,
"maxVal": 120,
"displOrdinal": 7
},
"POS_X": {
"name": "POS_X",
"description": "Asse X",
"tipoMem": "Int",
"minVal": -2000,
"maxVal": 2000,
"displOrdinal": 8
},
"POS_Y": {
"name": "POS_Y",
"description": "Asse Y",
"tipoMem": "Int",
"minVal": 0,
"maxVal": 2000,
"displOrdinal": 9
},
"POS_Z": {
"name": "POS_Z",
"description": "Asse Z",
"tipoMem": "Int",
"minVal": 0,
"maxVal": 1500,
"displOrdinal": 10
}
},
"optKVP": {
"hasRecipe": true,
"maxPodlQty": 530,
"useLocalRecipe": true,
"path-locBase": "C:\\MesData\\",
"path-00-Arch": "ArchivioRicette\\FIMAT",
"path-01-Temp": "01-Temp\\FIMAT",
"path-02-Sent": "02-Inviate\\FIMAT",
"path-03-Recv": "03-Ricevute\\FIMAT",
"path-04-remReq": "Y:\\",
"path-05-remExe": "C:\\MesData\\Remote\\Dosed",
"path-06-remRec": "R:\\",
"path-outReport": "C:\\MesData\\Report",
"path-confSetup": "C:\\MesData\\Setup\\setupConsumi.json",
"replace-<Variant>": "<Variant>{{PODL}}",
"replace-<Info1>": "<Info1>Kg{{Qty}} | {{Note}}"
}
}
+2 -2
View File
@@ -45,10 +45,10 @@ ENABLE_PZ_RESET=TRUE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=10400
SIM_PZCNT=40|2
SIM_PZCNT=10|2
SIM_ALARM=1000|20
SIM_MANU=50|6
; 1 = indica che la macchina multi --> allo scadere del contapezzo gestisce ANCHE il giro tavola sui bit relativi
+2 -2
View File
@@ -40,7 +40,7 @@ PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9800
SIM_PZCNT=33|1
SIM_PZCNT=13|1
SIM_ALARM=200|10
SIM_MANU=130|3
; indica gestione e simulazione bit 5 --> slow
@@ -61,7 +61,7 @@ NEW_DYN_DATA=TRUE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; indica parametri gestione TcMan
TC_MAX_TC_FACTOR=3.9
TC_LAMBDA=0.4
+2 -2
View File
@@ -40,7 +40,7 @@ PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9800
SIM_PZCNT=33|1
SIM_PZCNT=13|1
SIM_ALARM=200|10
SIM_MANU=130|3
; indica gestione e simulazione bit 5 --> slow
@@ -61,7 +61,7 @@ NEW_DYN_DATA=TRUE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; indica parametri gestione TcMan
TC_MAX_TC_FACTOR=3.9
TC_LAMBDA=0.4
+2 -2
View File
@@ -40,7 +40,7 @@ PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9800
SIM_PZCNT=33|1
SIM_PZCNT=13|1
SIM_ALARM=200|10
SIM_MANU=130|3
; indica gestione e simulazione bit 5 --> slow
@@ -61,7 +61,7 @@ NEW_DYN_DATA=TRUE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; indica parametri gestione TcMan
TC_MAX_TC_FACTOR=3.9
TC_LAMBDA=0.4
+2 -2
View File
@@ -40,7 +40,7 @@ PZCOUNT_MODE=BIT
ENABLE_PZ_RESET=TRUE
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 10 secondi)
PER_BASE=9800
SIM_PZCNT=33|1
SIM_PZCNT=13|1
SIM_ALARM=200|10
SIM_MANU=130|3
; indica gestione e simulazione bit 5 --> slow
@@ -61,7 +61,7 @@ NEW_DYN_DATA=TRUE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
MIN_DURATA_ODL=1440
MIN_DURATA_ODL=960
; indica parametri gestione TcMan
TC_MAX_TC_FACTOR=3.9
TC_LAMBDA=0.4
+33 -22
View File
@@ -807,7 +807,7 @@ namespace IOB_WIN_NEXT.Iob
/// <param name="bit2proc"></param>
protected void tryRedDuration(int bit2proc)
{
if (lastRedDuration.AddMilliseconds(periodoMSec) < DateTime.Now)
if (lastRedDuration.AddMilliseconds(periodoMSec / 20) < DateTime.Now)
{
switch (bit2proc)
{
@@ -938,6 +938,7 @@ namespace IOB_WIN_NEXT.Iob
// invio SOLO SE sono OLTRE i numSim pz e li invio TUTTI in blocco
if ((contapezziPLC - contapezziIOB) > minSendPzCountBlock)
{
sigPzCount = true;
trySendPzCountBlock(machName);
sigPzCount = false;
}
@@ -976,10 +977,10 @@ namespace IOB_WIN_NEXT.Iob
{
// errore salvataggio contapezzi
lgInfo($"Errore salvataggio Contapezzi SIMULA 02: contapezziIOB {contapezziIOB} | risposta: {retVal}");
if(!isMulti)
if (!isMulti)
{
// rileggo il counter pezzi da server
pzCntReload(true, machName);
// rileggo il counter pezzi da server
pzCntReload(true, machName);
}
}
sigPzCount = false;
@@ -1000,7 +1001,7 @@ namespace IOB_WIN_NEXT.Iob
}
// questa parte la processo SOLO SE sono in run --> B_input == 3
if (B_input == 3)
if (B_input == 3 || B_input == 7)
{
// di base NON emergenza
B_input += (1 << 7);
@@ -1028,6 +1029,8 @@ namespace IOB_WIN_NEXT.Iob
// simulo terminazione allarme
currSimAlarmCode = 0;
}
tryConfirm();
}
else if (bit6 != null && bit6.wait <= 0)
{
@@ -1041,7 +1044,7 @@ namespace IOB_WIN_NEXT.Iob
bit6 = setupSimPar("SIM_WUCD");
}
// in warm up: provo split ODL
trySplitOdl();
processAutoOdl();
}
else if (bit7 != null && bit7.wait <= 0)
{
@@ -1055,7 +1058,7 @@ namespace IOB_WIN_NEXT.Iob
bit7 = setupSimPar("SIM_EMRG");
}
// in emergenza: provo split ODL
trySplitOdl();
processAutoOdl();
}
else if (bit4 != null && bit4.wait <= 0)
{
@@ -1069,14 +1072,14 @@ namespace IOB_WIN_NEXT.Iob
bit4 = setupSimPar("SIM_MANU");
}
// in manuale: provo split ODL
trySplitOdl();
processAutoOdl();
}
else if (bit2 != null && bit2.wait <= 0)
{
// salvo nuovo contapezziPLC
var rand = new Random();
// se online vero delta (1..6) altrimenti 1
int delta = IobOnline ? rand.Next(1, 6) : 1;
// se online vero delta (1..10) altrimenti 1
int delta = IobOnline ? rand.Next(1, 10) : 1;
if (MPOnline)
{
// solo se MP online...
@@ -1145,8 +1148,8 @@ namespace IOB_WIN_NEXT.Iob
lastPzCountSend = DateTime.Now;
}
}
// provo a fare split ODL SE NON E' multi....
trySplitOdl();
// provo a fare split ODL...
processAutoOdl();
}
else
{
@@ -1259,6 +1262,14 @@ namespace IOB_WIN_NEXT.Iob
}
}
/// <summary>
/// Provo ad effettuare conferma pezzi SE sono oltre uno scalino del 10% dall'ultima conferma...
/// </summary>
/// <exception cref="NotImplementedException"></exception>
private void tryConfirm()
{
}
/// <summary>
/// Setup parametri di simulazione per BIT indicato
/// </summary>
@@ -1294,18 +1305,18 @@ namespace IOB_WIN_NEXT.Iob
/// </summary>
private void trySplitOdl()
{
if (!isMulti)
//if (!isMulti)
//{
// solo se ODL è in lavorazione da ALMENO minDurataODL minuti...
DateTime inizioOdl = DateTime.Now.AddDays(-1);
string rawDataInizio = callUrl(urlInizioOdlIob, false);
DateTime.TryParse(rawDataInizio, out inizioOdl);
if (DateTime.Now.Subtract(inizioOdl).TotalMinutes > minDurataODL)
{
// solo se ODL è in lavorazione da ALMENO minDurataODL minuti...
DateTime inizioOdl = DateTime.Now.AddDays(-1);
string rawDataInizio = callUrl(urlInizioOdlIob, false);
DateTime.TryParse(rawDataInizio, out inizioOdl);
if (DateTime.Now.Subtract(inizioOdl).TotalMinutes > minDurataODL)
{
// invio reset ODL...
forceSplitOdl();
}
// invio reset ODL...
forceSplitOdl();
}
//}
}
#endregion Private Methods