- bozza gestione rpgName x rilievo fase riscaldamento
This commit is contained in:
Samuele Locatelli
2025-02-05 17:10:10 +01:00
parent d371aa2195
commit 28dd831390
5 changed files with 93 additions and 60 deletions
+4 -1
View File
@@ -31,8 +31,11 @@ BIT2=PZCOUNT.MACRO.10100
;BIT2=STD.MACRO.10100
BIT3=Y31.4
BIT4=Y31.5
;BIT5=!X8.4
;ricerca stringa in variabile currPrgName che deve essere uguale al valore dopo separatore pipe
BIT6=currPrgName|O5000
; 8.4 --> emg armata= true, 0 = attiva mettere !8.4 (da verificare)
BIT5=!X8.4
BIT7=!X8.4
;BIT6=X8.4
AREAD_START=0
AREAD_SIZE=0
+4 -1
View File
@@ -31,8 +31,11 @@ BIT2=PZCOUNT.MACRO.10100
;BIT2=STD.MACRO.10100
BIT3=Y1.4
BIT4=Y1.5
;BIT5=!X8.4
;ricerca stringa in variabile currPrgName che deve essere uguale al valore dopo separatore pipe
BIT6=currPrgName|O5000
; 8.4 --> emg armata= true, 0 = attiva mettere !8.4 (da verificare)
BIT5=!X8.4
BIT7=!X8.4
;BIT6=X8.4
AREAD_START=0
AREAD_SIZE=0
+5 -2
View File
@@ -36,9 +36,12 @@ BIT2=PZCOUNT.D.132
;BIT2=STD.MACRO.10100
BIT3=Y91.3
; poichè leggo da 15000 --> R0.0 --> R15000.0
;BIT4=R0.0
BIT4=R0.0
;BIT5=!X8.4
;ricerca stringa in variabile currPrgName che deve essere uguale al valore dopo separatore pipe
BIT6=currPrgName|O5000
; 8.4 --> emg armata= true, 0 = attiva mettere !8.4 (da verificare)
BIT5=!X8.4
BIT7=!X8.4
;BIT6=X33.4
AREAD_START=128
AREAD_SIZE=12
+2 -2
View File
@@ -19,8 +19,8 @@ CLI_INST=SteamWareSim
;STARTLIST=SIMUL_01,SIMUL_02,SIMUL_03,SIMUL_04
;STARTLIST=SIMUL_01
;STARTLIST=3025,3027,3028
;STARTLIST=3027
STARTLIST=VL27
;STARTLIST=VL27
STARTLIST=3027
MAXCNC=10
+78 -54
View File
@@ -542,11 +542,11 @@ namespace IOB_WIN_FANUC.Iob
{
if (FANUC_ref.Connected)
{
stopwatch.Restart();
sw.Restart();
EgwProxy.MultiCncLib.Focas1.ODBDY2_1 answ = FANUC_ref.getAllDynData();
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("PROC-DYN-DATA"), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("PROC-DYN-DATA"), sw.ElapsedTicks);
}
try
@@ -580,7 +580,7 @@ namespace IOB_WIN_FANUC.Iob
{
lgError(exc, "Errore in getDynData");
}
stopwatch.Stop();
sw.Stop();
}
}
return outVal;
@@ -641,11 +641,11 @@ namespace IOB_WIN_FANUC.Iob
public override Dictionary<string, string> getSysInfo()
{
Dictionary<string, string> outVal = new Dictionary<string, string>();
stopwatch.Restart();
sw.Restart();
EgwProxy.MultiCncLib.Focas1.ODBSYS answ = FANUC_ref.getSysInfo();
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("SYS-INFO"), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("SYS-INFO"), sw.ElapsedTicks);
}
try
@@ -715,11 +715,11 @@ namespace IOB_WIN_FANUC.Iob
cntAddr = 6711;
}
// processo parametro contapezzi (lavorati)
stopwatch.Restart();
sw.Restart();
FANUC_ref.F_RW_Param_Integer(false, cntAddr, 3, ref outputVal);
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-PAR", 4), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-PAR", 4), sw.ElapsedTicks);
}
// salvo ultimo conteggio rilevato
int newVal = -1;
@@ -733,12 +733,12 @@ namespace IOB_WIN_FANUC.Iob
// recupero parametro...
int.TryParse(memAddr.Replace("MACRO.", ""), out cntAddr);
// processo parametro
stopwatch.Restart();
sw.Restart();
double macroVal = 0;
FANUC_ref.F_Read_macro(cntAddr, ref macroVal);
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-MACRO", 5), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-MACRO", 5), sw.ElapsedTicks);
}
// salvo ultimo conteggio rilevato
int newVal = -1;
@@ -755,7 +755,7 @@ namespace IOB_WIN_FANUC.Iob
lgInfo("processContapezzi [0] area memoria: {0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType);
}
// leggo!
stopwatch.Restart();
sw.Restart();
// switch x tipo dati --> tipo lettura... e salvo ultimo
// conteggio rilevato
switch (areaCounter.vType)
@@ -793,7 +793,7 @@ namespace IOB_WIN_FANUC.Iob
}
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("R-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("R-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
}
// salvo...
int newVal = -1;
@@ -804,7 +804,7 @@ namespace IOB_WIN_FANUC.Iob
lgInfo("[3] contapezziPLC contapezzi: {0}", contapezziPLC);
//}
}
stopwatch.Stop();
sw.Stop();
}
}
}
@@ -838,14 +838,14 @@ namespace IOB_WIN_FANUC.Iob
// leggo tutto da 0 a 43...
int memIndex = 0;
// controllo modalità lettura memoria
stopwatch.Restart();
sw.Restart();
FanucMemRW(R, FANUC.MemType.G, memIndex, ref MemBlockG);
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-G-AREA", MemBlockG.Length), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-G-AREA", MemBlockG.Length), sw.ElapsedTicks);
}
stopwatch.Stop();
sw.Stop();
// verifico modo con valore corrente, se cambia aggiorno...
CNC_MODE newMode = decodeG43(MemBlockG[43]);
if (newMode != currMode)
@@ -864,7 +864,7 @@ namespace IOB_WIN_FANUC.Iob
{
lgError(exc, string.Format("Errore in process Mode G43: {0}{1}", Environment.NewLine, exc));
connectionOk = false;
stopwatch.Stop();
sw.Stop();
}
}
}
@@ -969,11 +969,11 @@ namespace IOB_WIN_FANUC.Iob
// byte) --> leggo!
if (MemBlockR.Length > 0)
{
stopwatch.Restart();
sw.Restart();
FanucMemRW(R, FANUC.MemType.R, areaR.startIdx, ref MemBlockR);
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-R", MemBlockR.Length), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-R", MemBlockR.Length), sw.ElapsedTicks);
}
// log
if (verboseLog)
@@ -987,11 +987,11 @@ namespace IOB_WIN_FANUC.Iob
// controllo area X: se ha dati (> 0 byte) --> leggo!
if (MemBlockX.Length > 0)
{
stopwatch.Restart();
sw.Restart();
FanucMemRW(R, FANUC.MemType.X, areaX.startIdx, ref MemBlockX);
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-X", MemBlockX.Length), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-X", MemBlockX.Length), sw.ElapsedTicks);
}
// log
if (verboseLog)
@@ -1005,11 +1005,11 @@ namespace IOB_WIN_FANUC.Iob
// controllo area Y: se ha dati (> 0 byte) --> leggo!
if (MemBlockY.Length > 0)
{
stopwatch.Restart();
sw.Restart();
FanucMemRW(R, FANUC.MemType.Y, areaY.startIdx, ref MemBlockY);
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-Y", MemBlockY.Length), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-Y", MemBlockY.Length), sw.ElapsedTicks);
}
// log
if (verboseLog)
@@ -1020,7 +1020,7 @@ namespace IOB_WIN_FANUC.Iob
}
}
}
stopwatch.Stop();
sw.Stop();
// salvo il solo BYTE dell'input decifrando il semaforo...
decodeToBitmap();
reportRawInput(ref currDispData);
@@ -1079,11 +1079,11 @@ namespace IOB_WIN_FANUC.Iob
}
// processo RESET contapezzi (lavorati)
stopwatch.Restart();
sw.Restart();
FANUC_ref.F_RW_Param_Integer(true, cntAddr, 3, ref newVal);
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("W{0}-PAR", 4), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("W{0}-PAR", 4), sw.ElapsedTicks);
}
}
else if (memAddr.StartsWith("MACRO."))
@@ -1095,12 +1095,12 @@ namespace IOB_WIN_FANUC.Iob
cntAddr = 9999;
}
// processo SET contapezzi (lavorati)
stopwatch.Restart();
sw.Restart();
double vTransf = (double)0;
answ = FanucMemMacroRW(true, cntAddr, ref vTransf);
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, "MACRO-SHORT", stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, "MACRO-SHORT", sw.ElapsedTicks);
}
}
// altrimenti se legge da area memoria specifica leggo da li... formto tipo STD.D.1604.DW
@@ -1113,7 +1113,7 @@ namespace IOB_WIN_FANUC.Iob
lgInfo("resetContapezziPLC [0] area memoria: {0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType);
}
// leggo!
stopwatch.Restart();
sw.Restart();
// switch x tipo dati --> tipo lettura... e salvo ultimo conteggio rilevato
switch (areaCounter.vType)
{
@@ -1139,10 +1139,10 @@ namespace IOB_WIN_FANUC.Iob
}
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("W-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("W-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
}
}
stopwatch.Stop();
sw.Stop();
}
}
catch (Exception exc)
@@ -1215,7 +1215,7 @@ namespace IOB_WIN_FANUC.Iob
}
lgTrace($"MACRO | ART Write 01 | memAddr: {memAddr} | idx: {cntAddr}");
// processo SET contapezzi (lavorati)
stopwatch.Restart();
sw.Restart();
// comincio scrivendo reset a zero x cominciare...
double vTransf = (double)valReq;
@@ -1223,10 +1223,10 @@ namespace IOB_WIN_FANUC.Iob
lgTrace($"MACRO | ART Write 02 | memAddr: {memAddr} | valReq: {valReq} | vTransf: {vTransf}");
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, "MACRO-SHORT", stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, "MACRO-SHORT", sw.ElapsedTicks);
}
}
stopwatch.Stop();
sw.Stop();
}
catch (Exception exc)
{
@@ -1266,16 +1266,16 @@ namespace IOB_WIN_FANUC.Iob
}
lgTrace($"MACRO | Com Write 01 | memAddr: {memAddr} | idx: {cntAddr}");
// processo SET contapezzi (lavorati)
stopwatch.Restart();
sw.Restart();
double vTransf = (double)valReq;
answ = FanucMemMacroRW(true, cntAddr, ref vTransf);
lgTrace($"MACRO | Com Write 02 | memAddr: {memAddr} | valReq: {valReq} | vTransf: {vTransf}");
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, "MACRO-SHORT", stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, "MACRO-SHORT", sw.ElapsedTicks);
}
}
stopwatch.Stop();
sw.Stop();
}
catch (Exception exc)
{
@@ -1328,11 +1328,11 @@ namespace IOB_WIN_FANUC.Iob
}
// processo SET contapezzi (lavorati)
stopwatch.Restart();
sw.Restart();
FANUC_ref.F_RW_Param_Integer(true, cntAddr, 3, ref newVal);
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("W{0}-PAR", 4), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("W{0}-PAR", 4), sw.ElapsedTicks);
}
}
else if (memAddr.StartsWith("MACRO."))
@@ -1345,7 +1345,7 @@ namespace IOB_WIN_FANUC.Iob
}
lgTrace($"MACRO | Pz Write 01 | memAddr: {memAddr} | idx: {cntAddr}");
// processo SET contapezzi (lavorati)
stopwatch.Restart();
sw.Restart();
// se > 2^16 scrivo con INT, sennò con double...
short valTrShr = 0;
double valTrDbl = 0;
@@ -1366,7 +1366,7 @@ namespace IOB_WIN_FANUC.Iob
}
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, "MACRO-SHORT", stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, "MACRO-SHORT", sw.ElapsedTicks);
}
}
// altrimenti se legge da area memoria specifica leggo da li... formto tipo STD.D.1604.DW
@@ -1379,7 +1379,7 @@ namespace IOB_WIN_FANUC.Iob
lgInfo("setPzComm [0] area memoria: {0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType);
}
// leggo!
stopwatch.Restart();
sw.Restart();
// switch x tipo dati --> tipo lettura... e salvo ultimo conteggio rilevato
switch (areaCounter.vType)
{
@@ -1405,10 +1405,10 @@ namespace IOB_WIN_FANUC.Iob
}
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("W-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("W-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
}
}
stopwatch.Stop();
sw.Stop();
}
}
catch (Exception exc)
@@ -2175,6 +2175,30 @@ namespace IOB_WIN_FANUC.Iob
}
}
}
// altrimenti se è gestione nome prog corrente
else if (bVal.StartsWith("currPrgName"))
{
// il valore da cercare è quello inserito dopo il segno pipe...
string prgNameTgt = "";
if (bVal.Contains("|"))
{
var prgData = bVal.Split('|');
if (prgData.Length > 1)
{
prgNameTgt = prgData[1];
}
}
// ora verifico se prog corrente è valido
if (!string.IsNullOrEmpty(currPrgName))
{
// e se sia uguale al valore tgt
if (currPrgName == prgNameTgt)
{
// inserisco bit!
B_input += 1 << i;
}
}
}
else // area "normale" byte.bit
{
// di norma è segnale normale => 1, altrimenti inverse => 0...
@@ -2287,11 +2311,11 @@ namespace IOB_WIN_FANUC.Iob
lgInfo("START MemDump", tipoMem);
}
stopwatch.Restart();
sw.Restart();
FanucMemRW(R, tipoMem, memIndex, ref MemBlockCurr);
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-{1}", MemBlockCurr.Length, tipoMem), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-{1}", MemBlockCurr.Length, tipoMem), sw.ElapsedTicks);
}
if (verboseLog)
@@ -2366,7 +2390,7 @@ namespace IOB_WIN_FANUC.Iob
lgInfo("START ParamDump");
}
stopwatch.Restart();
sw.Restart();
for (int i = 0; i < numPar; i++)
{
FANUC_ref.F_RW_Param_Integer(false, memIndex + i, 3, ref paramsArray[i]);
@@ -2374,7 +2398,7 @@ namespace IOB_WIN_FANUC.Iob
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-PAR", 4 * numPar), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-PAR", 4 * numPar), sw.ElapsedTicks);
}
if (verboseLog)
@@ -2425,11 +2449,11 @@ namespace IOB_WIN_FANUC.Iob
// recupero parametro...
int.TryParse(memAddr.Replace("PAR.", ""), out cntAddr);
// processo parametro
stopwatch.Restart();
sw.Restart();
FANUC_ref.F_RW_Param_Integer(false, cntAddr, 3, ref outputVal);
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-PAR", 4), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("R{0}-PAR", 4), sw.ElapsedTicks);
}
// salvo valore
answ = outputVal.ToString();
@@ -2442,11 +2466,11 @@ namespace IOB_WIN_FANUC.Iob
int.TryParse(memAddr.Replace("MACRO.", ""), out cntAddr);
lgTrace($"MACRO | Read 01 | memAddr: {memAddr} | idx: {cntAddr} | macroVal: {macroVal}");
// processo parametro
stopwatch.Restart();
sw.Restart();
FANUC_ref.F_Read_macro(cntAddr, ref macroVal);
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, "R-MACRO", stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, "R-MACRO", sw.ElapsedTicks);
}
// salvo valore
answ = macroVal.ToString();
@@ -2463,7 +2487,7 @@ namespace IOB_WIN_FANUC.Iob
}
// leggo!
stopwatch.Restart();
sw.Restart();
// switch x tipo dati --> tipo lettura... e salvo ultimo conteggio rilevato
switch (areaCounter.vType)
{
@@ -2500,7 +2524,7 @@ namespace IOB_WIN_FANUC.Iob
}
if (utils.CRB("recTime"))
{
TimingData.addResult(cIobConf.codIOB, string.Format("R-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), stopwatch.ElapsedTicks);
TimingData.addResult(cIobConf.codIOB, string.Format("R-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), sw.ElapsedTicks);
}
// salvo...
@@ -2510,7 +2534,7 @@ namespace IOB_WIN_FANUC.Iob
lgInfo($"[3] Mem letta: {memAddr} | {answ}");
}
}
stopwatch.Stop();
sw.Stop();
return answ;
}