fix: aggiunto path 2 in conf x SIEMENS, continuo fix indirizzi memoria PLC

This commit is contained in:
Samuele E. Locatelli
2017-05-19 16:18:07 +02:00
parent 77120da63b
commit 6420b99ebd
3 changed files with 22 additions and 17 deletions
+14 -17
View File
@@ -156,7 +156,7 @@ namespace MTC_Adapter
// !!!HARD CODED!!! aggiunto banco STATUS del 2 processo IN CODA... (4+1)DW=20byte x strobes...!!!
Strobes = new byte[20];
lg.Info("Start init Adapter SIEMENS", utils.CRS("ipPLC"));
lg.Info("Start init Adapter SIEMENS");
parentForm.commPlcActive = true;
Runtime.CreateNC(CNC.NcType.SIEMENS, utils.CRS("ipPLC"));
@@ -176,7 +176,6 @@ namespace MTC_Adapter
tryConnect();
lg.Info("End init Adapter SIEMENS");
}
/// <summary>
/// Override disconnessione
/// </summary>
@@ -243,7 +242,6 @@ namespace MTC_Adapter
}
}
}
/// <summary>
/// Verifico connessione SIEMENS...
/// </summary>
@@ -257,7 +255,7 @@ namespace MTC_Adapter
}
/// <summary>
/// Effettuo lettura dei 16 byte di strobe/status
/// Effettuo lettura dei 16+4 byte di strobe/status
/// </summary>
public override void getStrobeAndAckStatus()
{
@@ -295,14 +293,14 @@ namespace MTC_Adapter
// processo ora i dati dei path... di sicuro il primo
currStrobe = (StFlag8)(Strobes[4]); // 5° byte
currAck = (StFlag8)(Acknowl[4]); // 5° byte
procPathStrobes(0, currStrobe, currAck, 246, 24, ref UserAction);
procPathStrobes(0, currStrobe, currAck, 164, 4, ref UserAction);
//...e se c'è pure il secondo...
if (currAdpConf.nPath > 1)
{
currStrobe = (StFlag8)(Strobes[6]); // 7° byte
currAck = (StFlag8)(Acknowl[6]); // 7° byte
procPathStrobes(1, currStrobe, currAck, 292, 26, ref UserAction);
procPathStrobes(1, currStrobe, currAck, 210, 6, ref UserAction);
}
// 2017.01.16 INVIO vettore azioni (1 o +)... SE CE NE SONO!
@@ -315,7 +313,7 @@ namespace MTC_Adapter
// verifico strobe dell'auto-test
currStrobe = (StFlag8)(Strobes[7]); // 8° byte
currAck = (StFlag8)(Acknowl[7]); // 8° byte
processTestStrobe(currStrobe, currAck, 26, 1);
processTestStrobe(currStrobe, currAck, 7, 1);
// gestione bit di watchdog... sulal DWord successiva
sendWatchDog();
@@ -367,7 +365,6 @@ namespace MTC_Adapter
}
return fatto;
}
/// <summary>
/// Scrive watchdog
/// </summary>
@@ -389,7 +386,7 @@ namespace MTC_Adapter
try
{
// leggo tutto!!!
int memIndex = 522;
int memIndex = 256;
inizio = DateTime.Now;
SIEMENSMemRW_DWord(R, baseMemDb, memIndex, ref MemBlockTestData);
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TEST_DATA", MemBlockTestData.Length), DateTime.Now.Subtract(inizio).Ticks);
@@ -421,8 +418,8 @@ namespace MTC_Adapter
/// <returns></returns>
public override bool readAllAlarms(ref uint[] MemBlock)
{
// DB1499.DBW118
int memIndex = 118;
// DB1499.DBW36
int memIndex = 36;
return SIEMENSMemRW_DWord(R, baseMemDb, memIndex, ref MemBlock);
}
/// <summary>
@@ -433,9 +430,9 @@ namespace MTC_Adapter
/// <returns></returns>
public override bool readAlarmBlock(ref uint[] MemBlock, int blockIndex)
{
// DB1499.DBW118
int memIndex = 118;
return SIEMENSMemRW_DWord(R, baseMemDb, memIndex + blockIndex * 2, ref MemBlock);
// DB1499.DBW36
int memIndex = 36;
return SIEMENSMemRW_DWord(R, baseMemDb, memIndex + blockIndex * 4, ref MemBlock);
}
/// <summary>
/// Gestione lettura dati manutenzione
@@ -575,9 +572,9 @@ namespace MTC_Adapter
protected override void loadOtherFile()
{
base.loadOtherFile();
loadMaintData("DB1499", 822, 4);
loadStatusData("DB1499", 1334, 1);
loadAnalogData("DB1499", 1350, 1);
loadMaintData("DB1499", 524, 4);
loadStatusData("DB1499", 1036, 1);
loadAnalogData("DB1499", 1052, 1);
}
/// <summary>
/// Processing allarmi CNC
@@ -83,6 +83,10 @@
<ident>Path_01</ident>
<dataRefList />
</element>
<element>
<ident>Path_02</ident>
<dataRefList />
</element>
</Path>
<UnOp>
<element>
@@ -83,6 +83,10 @@
<ident>Path_01</ident>
<dataRefList />
</element>
<element>
<ident>Path_02</ident>
<dataRefList />
</element>
</Path>
<UnOp>
<element>