zw
CZ 6 months ago
parent 91e3088ee0
commit 06da4922f9

@ -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);

Loading…
Cancel
Save