Tagessicherung

This commit is contained in:
Maier Stephan SI
2024-07-22 17:01:21 +03:00
parent fb47ce09ab
commit bc23a8514f
9 changed files with 200 additions and 27 deletions

View File

@@ -3,7 +3,6 @@ using Sharp7;
using GuerrillaNtp;
using static FSI.BT.IR.Plc.TimeSync.Settings.Context;
namespace FSI.BT.IR.Plc.TimeSync
{
internal class SyncPlcTime : IPlc
@@ -25,10 +24,15 @@ namespace FSI.BT.IR.Plc.TimeSync
}
public string Name { get; set; }
public string Description { get; set; }
public string Adress { get; set; }
public int Rack { get; set; }
public int Slot { get; set; }
public int UpdateIntervall { get; set; }
public int TimeDifference { get; set; }
@@ -39,7 +43,6 @@ namespace FSI.BT.IR.Plc.TimeSync
public string NtpServer { get; set; }
public async Task Snyc(CancellationToken cancellationToken) =>
await Task.Run(async () =>
{
@@ -57,7 +60,8 @@ namespace FSI.BT.IR.Plc.TimeSync
{
_log.Error(Name + " Verbindung nicht hergestellt.");
_log.Error(Name + " Fehler: " + plc.ErrorText(connectionRslt));
return;
await Task.Delay(UpdateIntervall, cancellationToken);
continue;
}
var plcDateTime = new DateTime();