diff --git a/Service/Plc/Client/PlcMgr.cs b/Service/Plc/Client/PlcMgr.cs index 90078a4..1307953 100644 --- a/Service/Plc/Client/PlcMgr.cs +++ b/Service/Plc/Client/PlcMgr.cs @@ -193,6 +193,9 @@ public class PlcMgr { heart = !heart; HostToPlc writeHostToPlc = new HostToPlc(); + writeHostToPlc.ProtocolVersion1.Value = 2; + writeHostToPlc.ProtocolVersion2.Value = 0; + writeHostToPlc.ProtocolVersion3.Value = 1; writeHostToPlc.CommunicationDiagnosis.Value = (ushort)(heart ? 1 : 0); writeHostToPlc.Years.Value = (ushort)DateTime.Now.Year; writeHostToPlc.Month.Value = (ushort)DateTime.Now.Month; @@ -201,6 +204,9 @@ public class PlcMgr writeHostToPlc.Points.Value = (ushort)DateTime.Now.Minute; writeHostToPlc.Seconds.Value = (ushort)DateTime.Now.Second; + bool write01 = PlcClient.WriteValue(writeHostToPlc.ProtocolVersion1); + bool write02 = PlcClient.WriteValue(writeHostToPlc.ProtocolVersion2); + bool write03 = PlcClient.WriteValue(writeHostToPlc.ProtocolVersion3); bool write0 = PlcClient.WriteValue(writeHostToPlc.CommunicationDiagnosis); bool write1 = PlcClient.WriteValue(writeHostToPlc.Years); bool write2 = PlcClient.WriteValue(writeHostToPlc.Month);