using Autofac; using HybirdFrameworkCore.Autofac; using Service.PlcAfrica.Msg; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Service.PlcAfrica.Client { public class PlcAfricaMgr { public static PlcAfricaClient? PlcAfricaClient; public static PlcAfricaMsg PlcAfricaMsg = new PlcAfricaMsg(); /// /// 数据有效时间。单位秒 /// static int DataTimeSeconds = 20; /// /// 数据刷新时间 /// public static DateTime DataValidityTime = DateTime.Now; public static void PlcInit() { if (PlcAfricaClient == null) { PlcAfricaClient = AppInfo.Container.Resolve(); } Task.Run(() => PlcAfricaClient.Connect()); } } }