v 1.0.9: completato fix vari + config + nuovo installer CMS
This commit is contained in:
@@ -94,11 +94,10 @@ namespace MTC_Adapter
|
||||
{
|
||||
// carico status allarmi (completo)
|
||||
lg.Info("Inizio refresh completo stato allarmi...");
|
||||
StFlag32 forceAlarm = (StFlag32)unchecked((int)UInt32.MaxValue);
|
||||
refreshAlarmState(forceAlarm, false);
|
||||
lg.Info("Completato refresh completo stato allarmi!");
|
||||
|
||||
if (utils.CRB("recTime")) logTimeResults();
|
||||
forceAlarmCheck();
|
||||
|
||||
lg.Info("Completato refresh completo stato allarmi!");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -147,14 +146,6 @@ namespace MTC_Adapter
|
||||
{
|
||||
lg.Error("Errore connessione mancante in getStrobeAndAckStatus");
|
||||
}
|
||||
|
||||
#if false
|
||||
// hard coded: leggo le 16 word standard dello strobe... R10500--> R10515
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.R, 10500, ref Acknowl);
|
||||
|
||||
// hard coded: leggo le 16 word standard dello strobe... R10516--> R10532
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.R, 10516, ref Strobes);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -477,7 +468,11 @@ namespace MTC_Adapter
|
||||
/// <param name="giveAck">boolean: se si debba tornare ACK</param>
|
||||
public override void refreshAlarmState(StFlag32 Alarm2Refresh, bool giveAck)
|
||||
{
|
||||
base.refreshAlarmState(Alarm2Refresh, giveAck);
|
||||
// log bitmap se verboso attivo + ho allarmi da refreshare
|
||||
if ((Alarm2Refresh != StFlag32.NONE) && utils.CRB("verbose"))
|
||||
{
|
||||
lg.Info("Richiesto refresh allarmi x bitmask: {0}", utils.binaryForm((int)Alarm2Refresh));
|
||||
}
|
||||
|
||||
bool ackReturned = false;
|
||||
// byte di acknowledge...
|
||||
@@ -485,17 +480,12 @@ namespace MTC_Adapter
|
||||
// inizio impostando una bitmap x ACK che abbia i bit abbassati se lo strobe è disattivo: AND logico tra STR e ACK
|
||||
retACK_DW0 = BitConverter.GetBytes(Convert.ToUInt32(STRB_DW0 & ACK_DW0));
|
||||
|
||||
// log bitmap se verboso attivo + ho allarmi da refreshare
|
||||
if ((Alarm2Refresh != StFlag32.NONE) && utils.CRB("verbose"))
|
||||
{
|
||||
lg.Info("Richiesto refresh allarmi x bitmask: {0}", utils.binaryForm((int)Alarm2Refresh));
|
||||
}
|
||||
|
||||
inizio = DateTime.Now;
|
||||
byte[] MemBlock;
|
||||
// primo blocco memoria allarmi
|
||||
int memIndex = 10532;
|
||||
// controllo, SE devo leggere tutto uso un unico accesso ai 128byte, altrimenti leggo a blocchi di 32bit...
|
||||
|
||||
if (Alarm2Refresh == (StFlag32)unchecked((int)UInt32.MaxValue))
|
||||
{
|
||||
// blocco memoria x lettura dati COMPLETO (4Byte*32 = 128Byte)
|
||||
@@ -504,8 +494,16 @@ namespace MTC_Adapter
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.R, memIndex, ref MemBlock);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-STRB_DW0", MemBlock.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// aggiorno vettore allarmi x intero!
|
||||
Buffer.BlockCopy(MemBlock, 0, AlarmFlags, 0, MemBlock.Length);
|
||||
|
||||
try
|
||||
{
|
||||
// aggiorno vettore allarmi x intero!
|
||||
Buffer.BlockCopy(MemBlock, 0, AlarmFlags, 0, MemBlock.Length);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lg.Error(string.Format("Errore in BLOCKCOPY{0}{1}", Environment.NewLine, exc));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -730,12 +728,15 @@ namespace MTC_Adapter
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.D, memIndex, ref tabDatiMtz);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-DatiMtz", tabDatiMtz.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// uno ad uno vado a inserirli nella mappa dei dati dell'adapter...
|
||||
int shift = 0;
|
||||
int shift = 4; // 32bit
|
||||
int numero = 0;
|
||||
uint valRead = 0;
|
||||
for (int i = 0; i < maintData.Length; i++)
|
||||
{
|
||||
numero = 0;
|
||||
shift = Convert.ToInt32(maintData[i].codNum) - 1;
|
||||
valRead = 0;
|
||||
// 2016.07.06 uso indice i * 4 x selezionare area memoria...
|
||||
//shift = Convert.ToInt32(maintData[i].codNum) - 1;
|
||||
|
||||
if (maintData[i].varName == "ACC_TIME")
|
||||
{
|
||||
@@ -787,7 +788,17 @@ namespace MTC_Adapter
|
||||
{ }
|
||||
if (numero > 0)
|
||||
{
|
||||
istNumInvAssi[numero - 1] = BitConverter.ToUInt32(tabDatiMtz, shift * i);
|
||||
// 2016.07.06 debug di valori che potrebbero essere nulli...
|
||||
try
|
||||
{
|
||||
valRead = BitConverter.ToUInt32(tabDatiMtz, shift * i);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
valRead = 0;
|
||||
lg.Error(string.Format("Errore in recupero num inversioni:{0}parametro: {1}{0}shift: {2}{0}i: {3}{0}Exc: {4}", Environment.NewLine, maintData[i].varName, shift, i, exc));
|
||||
}
|
||||
istNumInvAssi[numero - 1] = valRead;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -950,9 +961,6 @@ namespace MTC_Adapter
|
||||
// ora trimmo vettore al solo numero VERO degli allarmi caricati...
|
||||
Array.Resize<otherData>(ref maintData, rumRiga);
|
||||
|
||||
// inizializzo a zero il vettore allarmi...
|
||||
int numByte = (int)Math.Ceiling(Convert.ToDecimal(rumRiga) / 8);
|
||||
AlarmFlags = new byte[numByte];
|
||||
if (utils.CRB("verbose")) lg.Info("Fine caricamento vettore variabili manutenzione gestite");
|
||||
}
|
||||
|
||||
@@ -1056,10 +1064,6 @@ namespace MTC_Adapter
|
||||
|
||||
parentForm.dataMonitor += sb.ToString();
|
||||
}
|
||||
|
||||
// in base al num max di UnOp recupero i dati utensile... PROCEDURA AD HOC!!!
|
||||
getDatiUtCMS_Fanuc(numUnOp);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// procedura di lettura (Multipla) dati da memoria x caricare dati utensile
|
||||
@@ -1077,7 +1081,7 @@ namespace MTC_Adapter
|
||||
int[] tabFamUt = new int[maxMemAddr];
|
||||
int memIndex = 0;
|
||||
byte[] int16Mem = new byte[2];
|
||||
byte[] int8Mem = new byte[1];
|
||||
byte int8Mem = new byte();
|
||||
|
||||
// step 1: lettura ID dell'utensile x ogni testa...
|
||||
byte[] elencoUtMem = new byte[2 * maxNumOp];
|
||||
@@ -1138,19 +1142,22 @@ namespace MTC_Adapter
|
||||
// step 3a: devo cercare la famiglia dell'UT di ogni UnOp nella Tabella Famiglie
|
||||
for (int i = 0; i < maxNumOp; i++)
|
||||
{
|
||||
// poiché potrei trovarlo replicato dopo la prima volta che lo trovo evito di ricontrollare...
|
||||
bool 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 (tabFamUt[j] == idFamUt[i])
|
||||
if (tabFamUt[j] == idFamUt[i] && !found)
|
||||
{
|
||||
// leggo FamUt puntuale..
|
||||
memIndex = 10700 + 2 * j;
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.D, memIndex, ref int8Mem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-FamUT", int8Mem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-FamUT", 8), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// step 3b: leggo puntualmente il TIPO DI vita UT dal suo indice...
|
||||
idTipoVitaUt[i] = Convert.ToInt16(int8Mem);
|
||||
idTipoVitaUt[i] = int8Mem;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1375,21 +1382,6 @@ namespace MTC_Adapter
|
||||
}
|
||||
vettAxis[i].mAxDir.Value = newDir;
|
||||
|
||||
// 2016.06.05 tolto x gestione da procNumInvAssi
|
||||
#if false
|
||||
// se la direzione è variata salvo il cambio direzione...
|
||||
if (newDir != prevDirAxis[i])
|
||||
{
|
||||
// salvo "+1" come cambi direzione
|
||||
vettAxis[i].mAxInvDDone.Value = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// salvo "0"...
|
||||
vettAxis[i].mAxInvDDone.Value = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
// salvo valori vettore prec...
|
||||
prevPosAxis[i] = newPos;
|
||||
prevDirAxis[i] = newDir;
|
||||
|
||||
@@ -549,6 +549,10 @@ namespace MTC_Adapter
|
||||
/// </summary>
|
||||
protected bool adpRunning;
|
||||
/// <summary>
|
||||
/// DataOra ultimo avvio adapter x watchdog
|
||||
/// </summary>
|
||||
protected DateTime adpStartRun;
|
||||
/// <summary>
|
||||
/// Data/ora ultimo avvio adapter
|
||||
/// </summary>
|
||||
public DateTime dtAvvioAdp = DateTime.Now;
|
||||
@@ -1328,11 +1332,13 @@ namespace MTC_Adapter
|
||||
mAdapter.Begin();
|
||||
// imposto flag adapter running..
|
||||
adpRunning = true;
|
||||
adpStartRun = DateTime.Now;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
parentForm.displayTaskAndWait(string.Format("Adapter NOT STARTED!!!{0}{1}", Environment.NewLine, exc));
|
||||
adpRunning = false;
|
||||
adpStartRun = DateTime.Now;
|
||||
}
|
||||
if (adpRunning)
|
||||
{
|
||||
@@ -1396,6 +1402,13 @@ namespace MTC_Adapter
|
||||
{
|
||||
// log ADP running
|
||||
lg.Error("Non eseguo chiamata: ADP ancora in running");
|
||||
// se è bloccato da oltre maxSec lo sblocco...
|
||||
if (DateTime.Now.Subtract(adpStartRun).TotalSeconds > utils.CRI("maxAdapterLockSec"))
|
||||
{
|
||||
// tolgo flag running
|
||||
adpRunning = false;
|
||||
adpStartRun = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1499,8 +1512,14 @@ namespace MTC_Adapter
|
||||
{
|
||||
// carico status allarmi (completo)
|
||||
StFlag32 forceAlarm = (StFlag32)unchecked((int)UInt32.MaxValue);
|
||||
refreshAlarmState(forceAlarm, false);
|
||||
|
||||
try
|
||||
{
|
||||
refreshAlarmState(forceAlarm, false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
lg.Error("Errore in fase di esecuzione di forceAlarmCheck");
|
||||
}
|
||||
if (utils.CRB("recTime")) logTimeResults();
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
@@ -10,8 +10,11 @@
|
||||
<add key="timerIntMs" value="5" /> <!--invio da adapter ad agent: 10ms-->
|
||||
<add key="fastCount" value="20" /> <!--100ms-->
|
||||
<add key="normCount" value="50" /> <!--250ms-->
|
||||
<add key="slowCount" value="1000" /> <!--5 sec-->
|
||||
<add key="slowCount" value="500" /> <!--2.5 sec-->
|
||||
<add key="alarmSyncCount" value="6000" /> <!--30 sec-->
|
||||
|
||||
<!--parametri gestione watchdog-->
|
||||
<add key="maxAdapterLockSec" value="5" />
|
||||
|
||||
<!--AREA CONF IP FANUC-->
|
||||
<!--SIMULATORE LOCALE
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("1.0.7.92")]
|
||||
[assembly: AssemblyFileVersion("1.0.7.92")]
|
||||
[assembly: AssemblyVersion("1.0.9.92")]
|
||||
[assembly: AssemblyFileVersion("1.0.9.92")]
|
||||
[assembly: AssemblyCopyright("Steamware-SCM-CMS © 2015-2016")]
|
||||
[assembly: AssemblyCompany("Steamware-SCM-CMS")]
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("1.0.7.<#= this.RevisionNumber #>")]
|
||||
[assembly: AssemblyFileVersion("1.0.7.<#= this.RevisionNumber #>")]
|
||||
[assembly: AssemblyVersion("1.0.9.<#= this.RevisionNumber #>")]
|
||||
[assembly: AssemblyFileVersion("1.0.9.<#= this.RevisionNumber #>")]
|
||||
[assembly: AssemblyCopyright("Steamware-SCM-CMS © 2015-<#= DateTime.Now.Year #>")]
|
||||
[assembly: AssemblyCompany("Steamware-SCM-CMS")]
|
||||
<#+
|
||||
|
||||
Reference in New Issue
Block a user