fix controllo strobe secondo processo (OSAI e SIEMENS) + allineamento fanuc...

This commit is contained in:
Samuele E. Locatelli
2017-05-19 17:09:13 +02:00
parent 79b90af793
commit f3f1e38703
2 changed files with 12 additions and 11 deletions
+6 -6
View File
@@ -217,7 +217,7 @@ namespace MTC_Adapter
string UnkStrobe = "";
// !!!FARE!!! multipath...
// verifico i vari strobe x recuperare i dati... PER ORA SOLO DW1 per path1 (indice 0)...
//int idxPath = 0;
int idxPath = 0;
int memIndex = 0;
int bitNum = 0;
inizio = DateTime.Now;
@@ -272,18 +272,18 @@ namespace MTC_Adapter
// AREA strobe USER ACTION
// chiamato Start...
bitNum = 4;
gestStrobeUserAction(bitNum, ref retACK_DW1, ref UserAction, " (START) ");
gestStrobeUserAction(idxPath, bitNum, ref retACK_DW1, ref UserAction, " (START) ");
// chiamato Stop...
bitNum = 5;
gestStrobeUserAction(bitNum, ref retACK_DW1, ref UserAction, " (STOP) ");
gestStrobeUserAction(idxPath, bitNum, ref retACK_DW1, ref UserAction, " (STOP) ");
// chiamato Reset...
bitNum = 6;
gestStrobeUserAction(bitNum, ref retACK_DW1, ref UserAction, " (RESET) ");
gestStrobeUserAction(idxPath, 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(idxPath, i, ref retACK_DW1, ref UnkStrobe, string.Format(" [STROBE_{0:00}] ", i));
}
// AREA strobe x TEST
@@ -361,7 +361,7 @@ namespace MTC_Adapter
int memIndex = 10508;
return FanucMemRW(W, FANUC.MemType.R, memIndex, ref retACK_DW);
}
/// <summary>
/// Recupero info su test: numero + elenco parametri IN/OUT
/// </summary>
+6 -5
View File
@@ -2389,13 +2389,14 @@ namespace MTC_Adapter
/// <summary>
/// Gestione strobe UserAction: salva dati e gestione ACK
/// </summary>
/// <param name="idxPath"></param>
/// <param name="bitNum"></param>
/// <param name="retACK_DW1"></param>
/// <param name="UserAction"></param>
/// <param name="azione"></param>
public void gestStrobeUserAction(int bitNum, ref byte[] retACK_DW1, ref string UserAction, string azione)
public void gestStrobeUserAction(int idxPath, int bitNum, ref byte[] retACK_DW1, ref string UserAction, string azione)
{
if (STRB_DW1.HasFlag((StFlag32)Math.Pow(2, bitNum)))
if (STRB_DW1.HasFlag((StFlag32)Math.Pow(2, bitNum + 16 * idxPath)))
{
// salvo evento UserAction in variabile...
UserAction += azione;
@@ -2838,13 +2839,13 @@ namespace MTC_Adapter
// AREA strobe USER ACTION
// chiamato Start...
bitNum = 4;
gestStrobeUserAction(bitNum, ref currACK_DW, ref UserAction, string.Format(" (P{0:00} START) ", idxPath + 1));
gestStrobeUserAction(idxPath, bitNum, ref currACK_DW, ref UserAction, string.Format(" (P{0:00} START) ", idxPath + 1));
// chiamato Stop...
bitNum = 5;
gestStrobeUserAction(bitNum, ref currACK_DW, ref UserAction, string.Format(" (P{0:00} STOP) ", idxPath + 1));
gestStrobeUserAction(idxPath, bitNum, ref currACK_DW, ref UserAction, string.Format(" (P{0:00} STOP) ", idxPath + 1));
// chiamato Reset...
bitNum = 6;
gestStrobeUserAction(bitNum, ref currACK_DW, ref UserAction, string.Format(" (P{0:00} RESET) ", idxPath + 1));
gestStrobeUserAction(idxPath, bitNum, ref currACK_DW, ref UserAction, string.Format(" (P{0:00} RESET) ", idxPath + 1));
}
else