|
1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.MorkCL.Server
- {
- /// <summary>
- /// 压力锅服务类
- /// </summary>
- internal class PressureCookerServer : PressureCookerSet, IModbus
- {
- public PressureCookerServer()
- {
- //MyModbus = new ModbusTcp();
- }
- public void Init(string IP = "", int Port = 502, string PortName = "")
- {
-
- CommHelper.CreateModbusTcp(IP, Port).OnSuccess(S =>
- {
- MyModbus = S.Content;
- });
-
- //MyModbus = new ModbusTcp();
- //MyModbus.WithModbusTcp(IP, Port).UseConnected(() =>
- //{
- // ((ModbusTcp)MyModbus).master.Transport.ReadTimeout = 3000;
- // ((ModbusTcp)MyModbus).master.Transport.WriteTimeout = 3000;
- // TaskManage.GetInstance.StartLong(new Action(() =>
- // {
-
- // Thread.Sleep(100);
- // }), $"压力锅服务-{IP}", true);
- //});
- }
-
- public void WriteValue<T>(string address, T value)
- {
- throw new NotImplementedException();
- }
- }
- }
|