终端一体化运控平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

PressureCookerServer.cs 1.2 KiB

1年前
1年前
1年前
1年前
1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. }