diff --git a/Service/Plc/Client/PlcMgr.cs b/Service/Plc/Client/PlcMgr.cs
index 664f832..aa1b23a 100644
--- a/Service/Plc/Client/PlcMgr.cs
+++ b/Service/Plc/Client/PlcMgr.cs
@@ -182,12 +182,18 @@ public class PlcMgr
return false;
}
-
+ static bool heart = false;
+ ///
+ /// 发送心跳
+ ///
+ ///
public static bool SendHear()
{
if (PlcClient != null)
{
HostToPlc writeHostToPlc = new HostToPlc();
+ heart = !heart;
+ writeHostToPlc.CommunicationDiagnosis.Value = (ushort)(heart ? 1 : 0);
writeHostToPlc.Years.Value = (ushort)DateTime.Now.Year;
writeHostToPlc.Month.Value = (ushort)DateTime.Now.Month;
writeHostToPlc.Day.Value = (ushort)DateTime.Now.Day;
@@ -195,6 +201,7 @@ public class PlcMgr
writeHostToPlc.Points.Value = (ushort)DateTime.Now.Minute;
writeHostToPlc.Seconds.Value = (ushort)DateTime.Now.Second;
+ bool write1 = PlcClient.WriteValue(writeHostToPlc.CommunicationDiagnosis);
bool write1 = PlcClient.WriteValue(writeHostToPlc.Years);
bool write2 = PlcClient.WriteValue(writeHostToPlc.Month);
bool write3 = PlcClient.WriteValue(writeHostToPlc.Day);