fix gestione tabelle utensili (TROPPE letture stages 3a / 4)
This commit is contained in:
@@ -2423,7 +2423,7 @@ namespace MTC_Adapter
|
||||
for (int i = 0; i < currAdpConf.nPath; i++)
|
||||
{
|
||||
vettPath[i].mPathFeed.Value = FeedRate;
|
||||
vettPath[i].mPathFeedOver.Value = FeedRateOver;
|
||||
//vettPath[i].mPathFeedOver.Value = FeedRateOver;
|
||||
vettPath[i].mPathRapidOver.Value = RapidOver;
|
||||
}
|
||||
}
|
||||
@@ -3593,6 +3593,7 @@ namespace MTC_Adapter
|
||||
byte[] int32Mem = new byte[4];
|
||||
byte[] int16Mem = new byte[2];
|
||||
byte int8Mem = new byte();
|
||||
bool found = false;
|
||||
|
||||
// step 1: lettura ID dell'utensile x ogni testa... leggo area memoria degli UT montati
|
||||
memIndex = getDatiUt_step1(ref elencoUtMem);
|
||||
@@ -3612,16 +3613,19 @@ namespace MTC_Adapter
|
||||
// step 2b: devo cercare l'UT di ogni UnOp nella Tabella Utensili
|
||||
for (int i = 0; i < maxNumOp; i++)
|
||||
{
|
||||
// poiché potrei trovarlo replicato dopo la prima volta che lo trovo evito di ricontrollare...
|
||||
found = false;
|
||||
// spazzo la tab Utensili x cercare quelli delle UnOp...
|
||||
for (int j = 0; j < maxMemAddr; j++)
|
||||
{
|
||||
// controllo, se l'id utensile è quello dell'attuale UnOp...
|
||||
if (tabUt[j] == idUtMontato[i])
|
||||
if (tabUt[j] == idUtMontato[i] && !found)
|
||||
{
|
||||
// leggo FamUt puntuale..
|
||||
memIndex = getDatiUt_step2b(ref int16Mem, j);
|
||||
// step 2b: leggo puntualmente la FamUt dal suo indice...
|
||||
idFamUt[i] = BitConverter.ToUInt16(int16Mem, 0);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3638,7 +3642,7 @@ namespace MTC_Adapter
|
||||
for (int i = 0; i < maxNumOp; i++)
|
||||
{
|
||||
// poiché potrei trovarlo replicato dopo la prima volta che lo trovo evito di ricontrollare...
|
||||
bool found = false;
|
||||
found = false;
|
||||
// spazzo la tab Utensili x cercare quelli delle UnOp...
|
||||
for (int j = 0; j < maxMemAddr; j++)
|
||||
{
|
||||
@@ -3657,16 +3661,19 @@ namespace MTC_Adapter
|
||||
// step 4: recupero la vita residua dell'utente
|
||||
for (int i = 0; i < maxNumOp; i++)
|
||||
{
|
||||
// poiché potrei trovarlo replicato dopo la prima volta che lo trovo evito di ricontrollare...
|
||||
found = false;
|
||||
// spazzo la tab Utensili x cercare quelli delle UnOp...
|
||||
for (int j = 0; j < maxMemAddr; j++)
|
||||
{
|
||||
// controllo, se l'id utensile è quello dell'attuale UnOp...
|
||||
if (tabUt[j] == idUtMontato[i])
|
||||
if (tabUt[j] == idUtMontato[i] && !found)
|
||||
{
|
||||
// leggo FamUt puntuale..
|
||||
memIndex = getDatiUt_step4(ref int32Mem, j);
|
||||
// leggo puntualmente valore della vita ut residua da indice utensile...
|
||||
valVitaUtRes[i] = BitConverter.ToInt32(int32Mem, 0);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -738,7 +738,7 @@ namespace MTC_Adapter
|
||||
int memIndex = 4300 + 4 * j;
|
||||
inizio = DateTime.Now;
|
||||
SIEMENSMemRW_Byte(R, baseMemUT, memIndex, ref int32Mem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-VitaRes", int32Mem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-VitaRes", int32Mem.Length * 4), DateTime.Now.Subtract(inizio).Ticks);
|
||||
return memIndex;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -753,7 +753,7 @@ namespace MTC_Adapter
|
||||
int memIndex = 1900 + 1 * j;
|
||||
inizio = DateTime.Now;
|
||||
SIEMENSMemRW_Byte(R, baseMemUT, memIndex, ref int8Mem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-FamUT", 8), DateTime.Now.Subtract(inizio).Ticks);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-FamUT", 1), DateTime.Now.Subtract(inizio).Ticks);
|
||||
return memIndex;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -767,7 +767,7 @@ namespace MTC_Adapter
|
||||
int memIndex = 100;
|
||||
inizio = DateTime.Now;
|
||||
SIEMENSMemRW_Byte(R, baseMemUT, memIndex, ref tabFam_FamUt);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabFamUT-FamUT", tabFam_FamUt.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabFamUT-FamUT", tabFam_FamUt.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
return memIndex;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -782,7 +782,7 @@ namespace MTC_Adapter
|
||||
int memIndex = 2900 + 2 * j;
|
||||
inizio = DateTime.Now;
|
||||
SIEMENSMemRW_Byte(R, baseMemUT, memIndex, ref int16Mem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-FamUT", int16Mem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-FamUT", int16Mem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
return memIndex;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -796,7 +796,7 @@ namespace MTC_Adapter
|
||||
int memIndex = 2500;
|
||||
inizio = DateTime.Now;
|
||||
SIEMENSMemRW_Byte(R, baseMemUT, memIndex, ref tabUt_UT);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-UT", tabUt_UT.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-UT", tabUt_UT.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
return memIndex;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -810,7 +810,7 @@ namespace MTC_Adapter
|
||||
int memIndex = 280;
|
||||
inizio = DateTime.Now;
|
||||
SIEMENSMemRW_Byte(R, baseMemUO, memIndex, ref elencoUtMem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-NUMUT", elencoUtMem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-NUMUT", elencoUtMem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
return memIndex;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
<!--gestione TIMERS e periodi multipli x thread lenti-->
|
||||
<add key="startTimerMs" value="250"/>
|
||||
<add key="timerIntMs" value="10"/><!--invio da adapter ad agent: 5ms-->
|
||||
<add key="fastCount" value="20"/><!--100ms-->
|
||||
<add key="normCount" value="50"/><!--250ms-->
|
||||
<add key="slowCount" value="500"/><!--2.5 sec-->
|
||||
<add key="fastCount" value="10"/><!--100ms-->
|
||||
<add key="normCount" value="25"/><!--250ms-->
|
||||
<add key="slowCount" value="250"/><!--2.5 sec-->
|
||||
<add key="alarmSyncCount" value="6000"/><!--30 sec-->
|
||||
<add key="waitEndCycle" value="20"/><!--20ms attesa dopo ogni ciclo lettura...-->
|
||||
<add key="waitEndCycle" value="10"/><!--20ms attesa dopo ogni ciclo lettura...-->
|
||||
<!--30 sec-->
|
||||
|
||||
<!--parametri gestione watchdog-->
|
||||
|
||||
Reference in New Issue
Block a user