终端一体化运控平台
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.
 
 
 

45 line
1.2 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace BPASmartClient.MorkCL.Server
  7. {
  8. /// <summary>
  9. /// 压力锅服务类
  10. /// </summary>
  11. internal class PressureCookerServer : PressureCookerSet, IModbus
  12. {
  13. public PressureCookerServer()
  14. {
  15. //MyModbus = new ModbusTcp();
  16. }
  17. public void Init(string IP = "", int Port = 502, string PortName = "")
  18. {
  19. CommHelper.CreateModbusTcp(IP, Port).OnSuccess(S =>
  20. {
  21. MyModbus = S.Content;
  22. });
  23. //MyModbus = new ModbusTcp();
  24. //MyModbus.WithModbusTcp(IP, Port).UseConnected(() =>
  25. //{
  26. // ((ModbusTcp)MyModbus).master.Transport.ReadTimeout = 3000;
  27. // ((ModbusTcp)MyModbus).master.Transport.WriteTimeout = 3000;
  28. // TaskManage.GetInstance.StartLong(new Action(() =>
  29. // {
  30. // Thread.Sleep(100);
  31. // }), $"压力锅服务-{IP}", true);
  32. //});
  33. }
  34. public void WriteValue<T>(string address, T value)
  35. {
  36. throw new NotImplementedException();
  37. }
  38. }
  39. }