using BPASmartClient.Helper; using BPASmartClient.Modbus; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using BPASmartClient.S7Net; using BPASmartClient.CustomResource.Pages.Model; using System.Threading; namespace BPASmartClient.DosingHKProject.Model.HK_PLC { public class HKDeviceStatus { public SiemensHelper HK_PLC_S7 = new SiemensHelper(); public bool IsConnected => HK_PLC_S7.IsConnected; public void Init() { if (IsConnected) { ThreadManage.GetInstance().StartLong(new Action(() => { var res = this.HK_PLC_S7.ReadClass(1); if (res != null && res is HKPlcCommRead data) { GVL_SmallStation.GetInstance.plcRead = data; } Thread.Sleep(10); }),"信号交互"); } } } }