ulteriori minor fix + riallineato siemens

This commit is contained in:
Samuele E. Locatelli
2017-01-16 18:02:58 +01:00
parent 6710162648
commit d5f2fdfea8
3 changed files with 110 additions and 83 deletions
+42 -37
View File
@@ -308,7 +308,11 @@ namespace MTC_Adapter
}
// 2017.01.16 INVIO vettore azioni (1 o +)... SE CE NE SONO!
if (UserAction.Trim() != "") mUserAction.Value = UserAction.Trim();
if (UserAction.Trim() != "")
{
mUserAction.ForceChanged();
mUserAction.Value = UserAction.Trim();
}
// Invio comunque strobe non riconosciuti
mUnkStrobe.Value = UnkStrobe.Trim();
@@ -746,8 +750,8 @@ namespace MTC_Adapter
UnkStatus += string.Format(" [STATUS_{0:00}] ", i);
}
}
// invio comunque... SE !=""
if (UnkStatus.Trim() != "") mUnkStatus.Value = UnkStatus.Trim();
// invio comunque...
mUnkStatus.Value = UnkStatus.Trim();
// inizializzo SEMPRE a vuoto...
string SubMode = "";
@@ -1473,42 +1477,42 @@ namespace MTC_Adapter
if (utils.CRB("recTime")) TimingData.addResult("R-GCodModal", DateTime.Now.Subtract(inizio).Ticks);
string GCodAttivi = "";
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd0.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd1.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd2.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd3.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd4.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd5.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd6.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd7.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd8.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd9.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd10.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd11.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd12.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd13.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd14.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd15.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd16.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd17.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd18.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd19.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd20.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd21.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd22.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd23.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd24.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd25.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd26.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd27.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd0.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd1.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd2.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd3.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd4.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd5.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd6.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd7.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd8.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd9.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd10.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd11.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd12.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd13.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd14.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd15.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd16.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd17.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd18.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd19.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd20.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd21.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd22.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd23.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd24.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd25.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd26.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd27.code);
inizio = DateTime.Now;
vettGCodes = FANUC_ref.getPathGCode1Shot();
if (utils.CRB("recTime")) TimingData.addResult("R-GCodOneShot", DateTime.Now.Subtract(inizio).Ticks);
if (vettGCodes.gcd0.flag > 0) GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd0.code);
if (vettGCodes.gcd1.flag > 0) GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd1.code);
if (vettGCodes.gcd2.flag > 0) GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd2.code);
if (vettGCodes.gcd3.flag > 0) GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd3.code);
if (vettGCodes.gcd0.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd0.code);
if (vettGCodes.gcd1.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd1.code);
if (vettGCodes.gcd2.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd2.code);
if (vettGCodes.gcd3.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd3.code);
inizio = DateTime.Now;
CMSCncLib.Focas1.ODB5AXMAN vettTTCoord = FANUC_ref.getPathTTCoord();
@@ -1529,8 +1533,9 @@ namespace MTC_Adapter
vettPath[i].mPathPosActJ.Value = ((decimal)vettTTCoord.c2) / utils.CRI("fattdecimale");
vettPath[i].mPathPosActK.Value = "0"; // è 5 assi...nullo...
//vettPath[i].mPathCurrProgRowNum.Value = PtData.ProgrRow;
//vettPath[i].mPathActiveAxes.Value = PtData.ActiveAxes;
// 2017.01.16 da rivedere
vettPath[i].mPathCurrProgRowNum.Value = "";
vettPath[i].mPathActiveAxes.Value = "";
sb.AppendLine(string.Format("Path {0}, PROG: {1}", i + 1, vettPath[i].mPathCurrProg.Value));
+13 -2
View File
@@ -972,6 +972,7 @@ namespace MTC_Adapter
mAdapter.AddDataItem(mOperator);
// modalità esecutiva e funzionale
mFunctionalMode.Value = "";
mAdapter.AddDataItem(mFunctionalMode);
@@ -1528,8 +1529,6 @@ namespace MTC_Adapter
{
// processing degli strobes di allarme (da ULTIMA rappresentazione vettore dell'ADP)
processAlarm();
// processo e svuoto eventuali code di invio per Codici M/S/T
trySendCodMST();
// ciclo HF: recupero update status & strobes vari
@@ -1572,6 +1571,9 @@ namespace MTC_Adapter
forceAlarmCheck();
}
// processo e svuoto eventuali code di invio per Codici M/S/T
trySendCodMST();
// INVIO dati variati!
mAdapter.SendChanged();
}
@@ -1664,14 +1666,23 @@ namespace MTC_Adapter
if (codiceM != "")
{
vettPath[i].mPathCodM.Value = string.Format("M{0}", codiceM);
vettPath[i].mPathCodM.ForceChanged();
mMessage.Code = string.Format("[M{0}]", codiceM);
mMessage.Value = string.Format("[M{0}]", codiceM);
}
if (codiceS != "")
{
vettPath[i].mPathCodS.Value = string.Format("S{0}", codiceS);
vettPath[i].mPathCodS.ForceChanged();
mMessage.Code = string.Format("[S{0}]", codiceS);
mMessage.Value = string.Format("[S{0}]", codiceS);
}
if (codiceT != "")
{
vettPath[i].mPathCodT.Value = string.Format("T{0}", codiceT);
vettPath[i].mPathCodT.ForceChanged();
mMessage.Code = string.Format("[T{0}]", codiceT);
mMessage.Value = string.Format("[T{0}]", codiceT);
}
}
}
+55 -44
View File
@@ -160,6 +160,8 @@ namespace MTC_Adapter
catch (Exception exc)
{
lg.Fatal(exc, "Errore nella connessione all'adapter SIEMENS", szStatusConnection);
connectionOk = false;
lg.Info(string.Format("Segnalo Adapter NON running, pausa di {0} msec prima di ulteriori tentativi di riconnessione", utils.CRI("waitRecMSec")));
}
}
}
@@ -259,18 +261,18 @@ namespace MTC_Adapter
// AREA strobe USER ACTION
// chiamato Start...
bitNum = 4;
gestStrobeUserAction(bitNum, ref retACK_DW1, ref UserAction, "# START # ");
gestStrobeUserAction(bitNum, ref retACK_DW1, ref UserAction, " (START) ");
// chiamato Stop...
bitNum = 5;
gestStrobeUserAction(bitNum, ref retACK_DW1, ref UserAction, "# STOP # ");
gestStrobeUserAction(bitNum, ref retACK_DW1, ref UserAction, " (STOP) ");
// chiamato Reset...
bitNum = 6;
gestStrobeUserAction(bitNum, ref retACK_DW1, ref UserAction, "# RESET # ");
gestStrobeUserAction(bitNum, ref retACK_DW1, ref UserAction, " (RESET) ");
// processo tutti gli strobe x i BIT 7-29 NON gestiti in modo da dare comunque ACK e event...
for (int i = 7; i < 30; i++)
{
gestStrobeUserAction(i, ref retACK_DW1, ref UnkStrobe, string.Format("# STROBE_{0:00} # ", i));
gestStrobeUserAction(i, ref retACK_DW1, ref UnkStrobe, string.Format(" [STROBE_{0:00}] ", i));
}
// AREA strobe x TEST
@@ -305,8 +307,12 @@ namespace MTC_Adapter
}
}
// INVIO COMUNQUE vettore azioni (0 o +)...
mUserAction.Value = UserAction.Trim();
// 2017.01.16 INVIO vettore azioni (1 o +)... SE CE NE SONO!
if (UserAction.Trim() != "")
{
mUserAction.ForceChanged();
mUserAction.Value = UserAction.Trim();
}
// Invio comunque strobe non riconosciuti
mUnkStrobe.Value = UnkStrobe.Trim();
@@ -675,7 +681,7 @@ namespace MTC_Adapter
{
vettPath[idxPath].mPathRunMode.Value = "MANUAL"; // "JOG";
}
else if (STRB_DW2.HasFlag(StFlag32.B07))
else if (STRB_DW2.HasFlag(StFlag32.B06))
{
vettPath[idxPath].mPathRunMode.Value = "MANUAL"; //"JOGINC";
}
@@ -741,7 +747,7 @@ namespace MTC_Adapter
// converto! e aggiungo allarmi sollevati al corretto controller allarmi...
if (STRB_DW2.HasFlag((StFlag32)Math.Pow(2, i)))
{
UnkStatus += string.Format("# STATUS_{0:00} # ", i);
UnkStatus += string.Format(" [STATUS_{0:00}] ", i);
}
}
// invio comunque...
@@ -758,14 +764,18 @@ namespace MTC_Adapter
// converto! e aggiungo allarmi sollevati al corretto controller allarmi...
if (STRB_DW3.HasFlag((StFlag32)Math.Pow(2, i)))
{
SubMode += string.Format("# {0} #", elencoSubMode[i.ToString()]);
SubMode += string.Format(" [{0}]", elencoSubMode[i.ToString()]);
}
}
}
// INVIO SEMBRE (x prendere il reset/fronte discesa)...
// 2017.01.16 INVIO SOLO SE CAMBIA:..
if (vettPath[idxPath].mPathSubMode.Value.ToString() != SubMode.Trim())
{
// INVIO SEMPRE (x prendere il reset/fronte discesa)...
vettPath[idxPath].mPathSubMode.Value = SubMode.Trim();
}
}
public override void getConfigParam()
{
@@ -1467,42 +1477,42 @@ namespace MTC_Adapter
if (utils.CRB("recTime")) TimingData.addResult("R-GCodModal", DateTime.Now.Subtract(inizio).Ticks);
string GCodAttivi = "";
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd0.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd1.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd2.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd3.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd4.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd5.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd6.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd7.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd8.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd9.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd10.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd11.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd12.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd13.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd14.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd15.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd16.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd17.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd18.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd19.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd20.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd21.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd22.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd23.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd24.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd25.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd26.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd27.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd0.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd1.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd2.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd3.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd4.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd5.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd6.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd7.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd8.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd9.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd10.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd11.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd12.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd13.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd14.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd15.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd16.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd17.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd18.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd19.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd20.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd21.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd22.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd23.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd24.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd25.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd26.code);
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd27.code);
inizio = DateTime.Now;
vettGCodes = FANUC_ref.getPathGCode1Shot();
if (utils.CRB("recTime")) TimingData.addResult("R-GCodOneShot", DateTime.Now.Subtract(inizio).Ticks);
if (vettGCodes.gcd0.flag > 0) GCodAttivi += string.Format("# {0} #", vettGCodes.gcd0.code);
if (vettGCodes.gcd1.flag > 0) GCodAttivi += string.Format("# {0} #", vettGCodes.gcd1.code);
if (vettGCodes.gcd2.flag > 0) GCodAttivi += string.Format("# {0} #", vettGCodes.gcd2.code);
if (vettGCodes.gcd3.flag > 0) GCodAttivi += string.Format("# {0} #", vettGCodes.gcd3.code);
if (vettGCodes.gcd0.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd0.code);
if (vettGCodes.gcd1.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd1.code);
if (vettGCodes.gcd2.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd2.code);
if (vettGCodes.gcd3.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd3.code);
inizio = DateTime.Now;
CMSCncLib.Focas1.ODB5AXMAN vettTTCoord = FANUC_ref.getPathTTCoord();
@@ -1523,8 +1533,9 @@ namespace MTC_Adapter
vettPath[i].mPathPosActJ.Value = ((decimal)vettTTCoord.c2) / utils.CRI("fattdecimale");
vettPath[i].mPathPosActK.Value = "0"; // è 5 assi...nullo...
//vettPath[i].mPathCurrProgRowNum.Value = PtData.ProgrRow;
//vettPath[i].mPathActiveAxes.Value = PtData.ActiveAxes;
// 2017.01.16 da rivedere
vettPath[i].mPathCurrProgRowNum.Value = "";
vettPath[i].mPathActiveAxes.Value = "";
sb.AppendLine(string.Format("Path {0}, PROG: {1}", i + 1, vettPath[i].mPathCurrProg.Value));