Corretto Run ed Exe mode, correzione gestione assi, correzione InvDDone, inseriti appunti x dati prod...

This commit is contained in:
Samuele E. Locatelli
2016-07-12 16:24:28 +02:00
parent 550c58bbe8
commit 970527f45f
9 changed files with 78 additions and 38 deletions
+2 -2
View File
@@ -225,11 +225,11 @@
</dataRef>
<dataRef>
<Key>Path_01_RUN_MODE</Key>
<Value>FLAG#R10528.1:R10528.7</Value>
<Value>0</Value>
</dataRef>
<dataRef>
<Key>Path_01_EXE_MODE</Key>
<Value>FLAG#R10528.8:R10528.11</Value>
<Value>0</Value>
</dataRef>
<dataRef>
<Key>Path_01_CurrProg</Key>
+2 -2
View File
@@ -215,11 +215,11 @@
</dataRef>
<dataRef>
<Key>Path_01_RUN_MODE</Key>
<Value>FLAG#R10528.1:R10528.7</Value>
<Value>0</Value>
</dataRef>
<dataRef>
<Key>Path_01_EXE_MODE</Key>
<Value>FLAG#R10528.8:R10528.11</Value>
<Value>0</Value>
</dataRef>
<dataRef>
<Key>Path_01_CurrProg</Key>
+2 -2
View File
@@ -225,11 +225,11 @@
</dataRef>
<dataRef>
<Key>Path_01_RUN_MODE</Key>
<Value>FLAG#R10528.1:R10528.7</Value>
<Value>0</Value>
</dataRef>
<dataRef>
<Key>Path_01_EXE_MODE</Key>
<Value>FLAG#R10528.8:R10528.11</Value>
<Value>0</Value>
</dataRef>
<dataRef>
<Key>Path_01_CurrProg</Key>
+46 -29
View File
@@ -197,6 +197,15 @@ namespace MTC_Adapter
}
needSave = procMovTotAssi(needSave);
needSave = procPartId(needSave);
needSave = procPzProd(needSave);
needSave = procNumInvAssi(needSave);
needSave = procVacPump(needSave);
needSave = procVacAct(needSave);
needSave = procLubro(needSave);
// salvo se necessario!
if (needSave) parentForm.persistXmlData();
// -------------------------------------------
@@ -232,19 +241,41 @@ namespace MTC_Adapter
mPower.Value = "OFF";
}
// switch su run mode...
// switch su EXE mode...
/*
* MODO_X V[74].W --> byte (6)
* 0 = Modo NESSUNO 
* 1 = Modo MANUALE 
* 2 = Modo AUTOMATICO 
* 3 = Modo POM 
* 4 = Modo MDI 
* 5 = Modo SEMIAUTOMATICO 
* 6 = Modo RAP 
* 7 = Modo TES
* MODO_X V[70/71] --> byte (2-3)
* V70.2 = Modo RUN 
* V70.3 = Modo FeedHold
* V71.5 = Ready
* */
uint V74 = ncDevice.PLC_MemoryAreaV[6];
Byte V70 = ncDevice.PLC_MemoryAreaV[2];
Byte V71 = ncDevice.PLC_MemoryAreaV[3];
if (((StFlag8)V70).HasFlag(StFlag8.B3))
{
vettPath[idxPath].mPathExeMode.Value = "FEEDHOLD";
}
else if (((StFlag8)V70).HasFlag(StFlag8.B2))
{
vettPath[idxPath].mPathExeMode.Value = "RUN";
}
else if (((StFlag8)V71).HasFlag(StFlag8.B5))
{
vettPath[idxPath].mPathExeMode.Value = "READY";
}
// switch su run mode...
/*
* MODO_X V[74].W --> byte (6)
* 0 = Modo NESSUNO 
* 1 = Modo MANUALE 
* 2 = Modo AUTOMATICO 
* 3 = Modo POM 
* 4 = Modo MDI 
* 5 = Modo SEMIAUTOMATICO 
* 6 = Modo RAP 
* 7 = Modo TES
* */
uint V74 = ncDevice.PLC_MemoryAreaV[6];
switch (V74)
{
case 1:
@@ -313,7 +344,6 @@ namespace MTC_Adapter
{
case 0:
newPos = (double)BitConverter.ToInt32(BitConverter.GetBytes(ncDevice.PLC_MemoryRead[240]), 0);
//BitConverter.ToUInt16(ncDevice.PLC_MemoryRead, 240);
break;
case 1:
newPos = (double)BitConverter.ToInt32(BitConverter.GetBytes(ncDevice.PLC_MemoryRead[241]), 0);
@@ -350,7 +380,9 @@ namespace MTC_Adapter
// calcolo distanza e salvo valore...
distPerc = newPos - prevPosAxis[i];
vettAxis[i].mAxDistDone.Value = Math.Abs(distPerc);
#if false
vettAxis[i].mAxDistDone.Value = Math.Abs(distPerc);
#endif
// sistemo direzione +/- (POS/NEG se lineari, CCW/CW se rotativi)
if (distPerc != 0)
@@ -369,22 +401,7 @@ namespace MTC_Adapter
// salvo "+1" come cambi direzione
istNumInvAssi[i]++;
}
// 2016.06.05 tolto x gestione con procNumInvAssi
#if false
// se la direzione è variata salvo il cambio direzione...
if (newDir != prevDirAxis[i])
{
// salvo "+1" come cambi direzione
vettAxis[i].mAxInvDDone.Value = incrNumInvAssi(i, 1);
}
else
{
// salvo "0" come aumento...
vettAxis[i].mAxInvDDone.Value = incrNumInvAssi(i, 0);
}
#endif
// salvo valori vettore prec...
prevPosAxis[i] = newPos;
prevDirAxis[i] = newDir;
+1 -1
View File
@@ -2147,7 +2147,7 @@ namespace MTC_Adapter
if (istNumInvAssi[i] > contNumInvAssi[i])
{
uint delta = istNumInvAssi[i] - contNumInvAssi[i];
uint contTot = updateUnOpRefListByIncr(i, delta, "Axis_{0:00}_Invers");
uint contTot = updateAxisRefListByIncr(i, delta, "Axis_{0:00}_InvDDone");
// passo valore totale all'adapter
vettAxis[i].mAxInvDDone.Value = contTot.ToString();
// segnalo necessità salvataggio!
+2
View File
@@ -136,6 +136,7 @@
<Content Include="Resources\SCM\AlarmListEsaGv.txt" />
<Content Include="Resources\SCM\Appunti doc CFG.txt" />
<Content Include="Resources\SCM\Appunti SCM.txt" />
<Content Include="Resources\SCM\DecodFileProd.txt" />
<Content Include="Resources\SCM\Demo MonitorVariabili.avi" />
<Content Include="Resources\SCM\Demo ProView.avi" />
<Content Include="Resources\SCM\README.txt" />
@@ -197,6 +198,7 @@
<Content Include="AdapterConf\EsaKvara.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="Resources\SCM\SCM_prodFile.pro" />
<None Include="setupTgt.bat" />
</ItemGroup>
<ItemGroup>
@@ -0,0 +1,15 @@
#--------------------------------
# dati produzione
#--------------------------------
Ci sono file in cui si accumulano (per ora a fine "lotto") i dati di produzione SCM; i file in questione sono in "C:\Kvara\Xilog Plus Default\Report"
Questi file saranno copiati (ogni x minuti?) tramite task schedulato in dir IOT, come SCM_prodFile.pro
Il file verrà letto periodicamente, verranno decodificate le linee e veriicate con quelle in memoria
se ci sono novità (+ pezzi x stesso articolo o nuovo articolo) saranno salvati prima PartId poi produzione
E' stato richiesto che
- sia subito scritta linea x nuovo articolo (pz 0)
- sia aggiornata riga x tale articolo ogni n minuti (x refresh) - almeno ogni n=10 min
@@ -0,0 +1,6 @@
09,23,53,00076
AB,C:\Programme\Scm Group\Xilog Plus\Job\PRGCANTEST.PGM,,1600,600,50,13,14,23,13,18,47,00,03,03,00,04,05,2,00,01,31,50
AB,C:\Programme\Scm Group\Xilog Plus\Job\PRGCANTEST.PGM,,1600,600,50,13,38,39,13,41,16,00,02,37,00,02,40,1,00,02,37,00
AB,C:\Programme\Scm Group\Xilog Plus\Job\PRGCANTEST.PGM,,1600,600,50,13,57,11,14,02,53,00,03,50,00,03,53,1,00,03,50,00
AB,C:\Programme\Scm Group\Xilog Plus\Job\PRGCANTEST.PGM,,1600,600,50,14,32,41,15,07,23,00,34,25,00,34,45,7,00,04,55,00
AB,C:\Programme\Scm Group\Xilog Plus\Job\PRGCANTEST.PGM,,1600,600,50,15,18,04,00,00,49,08,39,58,08,42,45,65,00,07,59,96
+2 -2
View File
@@ -363,8 +363,8 @@ namespace MTC_Adapter
listaDR.Add(new DataRefItem<string, string>(string.Format("Path_{0:00}_Cod_M", i + 1), "0"));
listaDR.Add(new DataRefItem<string, string>(string.Format("Path_{0:00}_Cod_S", i + 1), "0"));
listaDR.Add(new DataRefItem<string, string>(string.Format("Path_{0:00}_Cod_T", i + 1), "0"));
listaDR.Add(new DataRefItem<string, string>(string.Format("Path_{0:00}_RUN_MODE", i + 1), "FLAG#R10528.1:R10528.7"));
listaDR.Add(new DataRefItem<string, string>(string.Format("Path_{0:00}_EXE_MODE", i + 1), "FLAG#R10528.8:R10528.11"));
listaDR.Add(new DataRefItem<string, string>(string.Format("Path_{0:00}_RUN_MODE", i + 1), "0"));
listaDR.Add(new DataRefItem<string, string>(string.Format("Path_{0:00}_EXE_MODE", i + 1), "0"));
listaDR.Add(new DataRefItem<string, string>(string.Format("Path_{0:00}_CurrProg", i + 1), "0"));
listaDR.Add(new DataRefItem<string, string>(string.Format("Path_{0:00}_CurrProg_RowNum", i + 1), "0"));
listaDR.Add(new DataRefItem<string, string>(string.Format("Path_{0:00}_ActiveAxes", i + 1), "0"));