aggiunta visualizzazione fasi comunicazione siemens (cambia colore nome app MTC), commentate fasi scrittura (da rimappare), wait time portato a 20ms, verifica lettura variabili status Ok!
This commit is contained in:
@@ -1678,6 +1678,7 @@ namespace MTC_Adapter
|
||||
public virtual void startAdapter(int port)
|
||||
{
|
||||
lg.Info("Starting adapter...");
|
||||
parentForm.commPlcActive = false;
|
||||
adpRunning = true;
|
||||
dtAvvioAdp = DateTime.Now;
|
||||
TimingData.resetData();
|
||||
@@ -1867,6 +1868,7 @@ namespace MTC_Adapter
|
||||
parentForm.dataMonitor_2 = "";
|
||||
parentForm.dataMonitor_3 = "";
|
||||
parentForm.displayTaskAndWait("Adapter Stopped.");
|
||||
parentForm.commPlcActive = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace MTC_Adapter
|
||||
{
|
||||
try
|
||||
{
|
||||
parentForm.commPlcActive = true;
|
||||
// chiamo la versione multibyte...
|
||||
byte[] ValArray = new byte[1];
|
||||
SIEMENSMemRW_Byte(bWrite, MemType, memIndex, ref ValArray);
|
||||
@@ -54,6 +55,7 @@ namespace MTC_Adapter
|
||||
lg.Error(string.Format("Eccezione in SIEMENSMemRW_Byte: {0}{1}", Environment.NewLine, exc));
|
||||
}
|
||||
}
|
||||
parentForm.commPlcActive = false;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -71,6 +73,7 @@ namespace MTC_Adapter
|
||||
{
|
||||
try
|
||||
{
|
||||
parentForm.commPlcActive = true;
|
||||
answ = SIEMENS_ref.S_RW_Byte(bWrite, MemType, memIndex, ref Value);
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -78,6 +81,7 @@ namespace MTC_Adapter
|
||||
lg.Error(string.Format("Eccezione in SIEMENSMemRW_ByteArray: {0}{1}", Environment.NewLine, exc));
|
||||
}
|
||||
}
|
||||
parentForm.commPlcActive = false;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -95,6 +99,7 @@ namespace MTC_Adapter
|
||||
{
|
||||
try
|
||||
{
|
||||
parentForm.commPlcActive = true;
|
||||
answ = SIEMENS_ref.S_RW_Word(bWrite, MemType, memIndex, ref Value);
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -102,6 +107,7 @@ namespace MTC_Adapter
|
||||
lg.Error(string.Format("Eccezione in SIEMENSMemRW_Word: {0}{1}", Environment.NewLine, exc));
|
||||
}
|
||||
}
|
||||
parentForm.commPlcActive = false;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -119,6 +125,7 @@ namespace MTC_Adapter
|
||||
{
|
||||
try
|
||||
{
|
||||
parentForm.commPlcActive = true;
|
||||
answ = SIEMENS_ref.S_RW_DWord(bWrite, MemType, memIndex, ref Value);
|
||||
}
|
||||
catch(Exception exc)
|
||||
@@ -126,6 +133,7 @@ namespace MTC_Adapter
|
||||
lg.Error(string.Format("Eccezione in SIEMENSMemRW_DWord: {0}{1}", Environment.NewLine, exc));
|
||||
}
|
||||
}
|
||||
parentForm.commPlcActive = false;
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -324,7 +332,9 @@ namespace MTC_Adapter
|
||||
try
|
||||
{
|
||||
inizio = DateTime.Now;
|
||||
SIEMENSMemRW_Byte(W, baseMemDb, memIndexAck, ref currACK_DW);
|
||||
#if false
|
||||
SIEMENSMemRW_Byte(W, baseMemDb, memIndexAck, ref currACK_DW);
|
||||
#endif
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("W{0}-ACK_DW0", currACK_DW.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
fatto = true;
|
||||
}
|
||||
@@ -366,8 +376,11 @@ namespace MTC_Adapter
|
||||
/// <returns></returns>
|
||||
public override bool writeWatchDog(ref byte[] retACK_DW)
|
||||
{
|
||||
return false;
|
||||
#if false
|
||||
int memIndex = 38;
|
||||
return SIEMENSMemRW_Byte(W, baseMemDb, memIndex, ref retACK_DW);
|
||||
return SIEMENSMemRW_Byte(W, baseMemDb, memIndex, ref retACK_DW);
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua lettura dati TESTING
|
||||
@@ -400,9 +413,12 @@ namespace MTC_Adapter
|
||||
/// <returns></returns>
|
||||
public override bool writeAlarmAck(ref byte[] retACK_DW0)
|
||||
{
|
||||
return false;
|
||||
#if false
|
||||
// DB1499.DBX0.0
|
||||
int memIndexAck = 0;
|
||||
return SIEMENSMemRW_Byte(W, baseMemDb, memIndexAck, ref retACK_DW0);
|
||||
return SIEMENSMemRW_Byte(W, baseMemDb, memIndexAck, ref retACK_DW0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<add key="normCount" value="50"/><!--250ms-->
|
||||
<add key="slowCount" value="500"/><!--2.5 sec-->
|
||||
<add key="alarmSyncCount" value="6000"/><!--30 sec-->
|
||||
<add key="waitEndCycle" value="50"/><!--50ms attesa dopo ogni ciclo lettura...-->
|
||||
<add key="waitEndCycle" value="20"/><!--20ms attesa dopo ogni ciclo lettura...-->
|
||||
<!--30 sec-->
|
||||
|
||||
<!--parametri gestione watchdog-->
|
||||
|
||||
+539
-361
File diff suppressed because it is too large
Load Diff
@@ -601,6 +601,19 @@ namespace MTC_Adapter
|
||||
{
|
||||
MainProgrBar.Value = 0;
|
||||
}
|
||||
/// <summary>
|
||||
/// Visualizzazione stato di comunicazione attiva con PLC
|
||||
/// </summary>
|
||||
public bool commPlcActive
|
||||
{
|
||||
set
|
||||
{
|
||||
// se true --> comunica/verde, altrimenti grigio
|
||||
lblApp.ForeColor = value ? Color.Green : Color.Black;
|
||||
lblApp.Invalidate();
|
||||
statusStrip1.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAlarmSync()
|
||||
{
|
||||
|
||||
@@ -138,6 +138,24 @@
|
||||
<metadata name="K.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="X.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Y.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Z.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="I.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="J.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="K.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>104, 17</value>
|
||||
</metadata>
|
||||
@@ -2676,6 +2694,9 @@
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>59</value>
|
||||
</metadata>
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAA0AAAAAAAEAIAA3LgAA1gAAAICAAAABACAAKAgBAA0vAACAgAAAAQAIAChMAAA1NwEAQEAAAAEA
|
||||
|
||||
Reference in New Issue
Block a user