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

  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 void Init(string IP = "", int Port = 502, string PortName = "")
  14. {
  15. MyModbus = new ModbusTcp();
  16. MyModbus.WithModbusTcp(IP, Port).UseConnected(() =>
  17. {
  18. ((ModbusTcp)MyModbus).master.Transport.ReadTimeout = 3000;
  19. ((ModbusTcp)MyModbus).master.Transport.WriteTimeout = 3000;
  20. TaskManage.GetInstance.StartLong(new Action(() =>
  21. {
  22. Thread.Sleep(100);
  23. }), $"压力锅服务-{IP}", true);
  24. });
  25. }
  26. public void WriteValue<T>(string address, T value)
  27. {
  28. throw new NotImplementedException();
  29. }
  30. }
  31. }