15 lines
413 B
C#
15 lines
413 B
C#
|
using Microsoft.Extensions.Hosting;
|
|||
|
|
|||
|
namespace Seyounth.Auto.Hs.Runtime.Plc;
|
|||
|
|
|||
|
public class PlcBackgroundService(IPlcService plc) : BackgroundService
|
|||
|
{
|
|||
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
|||
|
{
|
|||
|
while (!stoppingToken.IsCancellationRequested)
|
|||
|
{
|
|||
|
await plc.QueryWarningInfo();
|
|||
|
await Task.Delay(50, stoppingToken);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|