diff --git a/MewtocolNet/Mewtocol/DynamicInterface.cs b/MewtocolNet/Mewtocol/DynamicInterface.cs index 03880ef..6aa0dd5 100644 --- a/MewtocolNet/Mewtocol/DynamicInterface.cs +++ b/MewtocolNet/Mewtocol/DynamicInterface.cs @@ -71,6 +71,8 @@ namespace MewtocolNet { ContinousReaderRunning = true; + int getPLCinfoCycleCount = 0; + while (ContinousReaderRunning) { //do priority tasks first @@ -78,6 +80,11 @@ namespace MewtocolNet { await PriorityTasks.FirstOrDefault(x => !x.IsCompleted); + } else if (getPLCinfoCycleCount > 25) { + + await GetPLCInfoAsync(); + getPLCinfoCycleCount = 0; + } foreach (var registerPair in Registers) { @@ -159,6 +166,8 @@ namespace MewtocolNet { } + getPLCinfoCycleCount++; + //invoke cycle polled event InvokePolledCycleDone(); diff --git a/MewtocolNet/Mewtocol/MewtocolInterfaceRequests.cs b/MewtocolNet/Mewtocol/MewtocolInterfaceRequests.cs index 9f5cc76..c71de00 100644 --- a/MewtocolNet/Mewtocol/MewtocolInterfaceRequests.cs +++ b/MewtocolNet/Mewtocol/MewtocolInterfaceRequests.cs @@ -44,6 +44,8 @@ namespace MewtocolNet { ErrorCode = error, StationNumber = int.Parse(station ?? "0"), }; + + PlcInfo = retInfo; return retInfo; } diff --git a/MewtocolNet/MewtocolNet.csproj b/MewtocolNet/MewtocolNet.csproj index b58129a..26a6ff6 100644 --- a/MewtocolNet/MewtocolNet.csproj +++ b/MewtocolNet/MewtocolNet.csproj @@ -2,7 +2,7 @@ netstandard2.0 MewtocolNet - 0.3.0 + 0.3.1 Felix Weiss Womed true