zw
CZ 6 months ago
parent f22e2c8d5d
commit 91e3088ee0

@ -191,8 +191,8 @@ public class PlcMgr
{ {
if (PlcClient != null) if (PlcClient != null)
{ {
HostToPlc writeHostToPlc = new HostToPlc();
heart = !heart; heart = !heart;
HostToPlc writeHostToPlc = new HostToPlc();
writeHostToPlc.CommunicationDiagnosis.Value = (ushort)(heart ? 1 : 0); writeHostToPlc.CommunicationDiagnosis.Value = (ushort)(heart ? 1 : 0);
writeHostToPlc.Years.Value = (ushort)DateTime.Now.Year; writeHostToPlc.Years.Value = (ushort)DateTime.Now.Year;
writeHostToPlc.Month.Value = (ushort)DateTime.Now.Month; writeHostToPlc.Month.Value = (ushort)DateTime.Now.Month;
@ -201,7 +201,7 @@ public class PlcMgr
writeHostToPlc.Points.Value = (ushort)DateTime.Now.Minute; writeHostToPlc.Points.Value = (ushort)DateTime.Now.Minute;
writeHostToPlc.Seconds.Value = (ushort)DateTime.Now.Second; writeHostToPlc.Seconds.Value = (ushort)DateTime.Now.Second;
bool write1 = PlcClient.WriteValue(writeHostToPlc.CommunicationDiagnosis); bool write0 = PlcClient.WriteValue(writeHostToPlc.CommunicationDiagnosis);
bool write1 = PlcClient.WriteValue(writeHostToPlc.Years); bool write1 = PlcClient.WriteValue(writeHostToPlc.Years);
bool write2 = PlcClient.WriteValue(writeHostToPlc.Month); bool write2 = PlcClient.WriteValue(writeHostToPlc.Month);
bool write3 = PlcClient.WriteValue(writeHostToPlc.Day); bool write3 = PlcClient.WriteValue(writeHostToPlc.Day);

Loading…
Cancel
Save