mirror of
https://github.com/OpenLogics/MewtocolNet.git
synced 2025-12-06 03:01:24 +00:00
Fixed plc info not getting set when reading it
- added auto poll of plc info each 25 cycles - counted up version
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@ namespace MewtocolNet {
|
||||
ErrorCode = error,
|
||||
StationNumber = int.Parse(station ?? "0"),
|
||||
};
|
||||
|
||||
PlcInfo = retInfo;
|
||||
return retInfo;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<PackageId>MewtocolNet</PackageId>
|
||||
<Version>0.3.0</Version>
|
||||
<Version>0.3.1</Version>
|
||||
<Authors>Felix Weiss</Authors>
|
||||
<Company>Womed</Company>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
|
||||
Reference in New Issue
Block a user