终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
1.0 KiB

  1. using BPASmartClient.Helper;
  2. using BPASmartClient.Modbus;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using BPASmartClient.S7Net;
  9. using BPASmartClient.CustomResource.Pages.Model;
  10. using System.Threading;
  11. namespace BPASmartClient.DosingHKProject.Model.HK_PLC
  12. {
  13. public class HKDeviceStatus
  14. {
  15. public SiemensHelper HK_PLC_S7 = new SiemensHelper();
  16. public bool IsConnected => HK_PLC_S7.IsConnected;
  17. public void Init()
  18. {
  19. if (IsConnected)
  20. {
  21. ThreadManage.GetInstance().StartLong(new Action(() =>
  22. {
  23. var res = this.HK_PLC_S7.ReadClass<HKPlcCommRead>(1);
  24. if (res != null && res is HKPlcCommRead data)
  25. {
  26. GVL_SmallStation.GetInstance.plcRead = data;
  27. }
  28. Thread.Sleep(10);
  29. }),"信号交互");
  30. }
  31. }
  32. }
  33. }