IModbusFactory.cs 629 B

12345678910111213141516171819
  1. using NModbus;
  2. using System;
  3. using System.IO.Ports;
  4. using System.Net.Sockets;
  5. namespace Team.Communicate.Modbus
  6. {
  7. public interface IModbusMasterFactory
  8. {
  9. IModbusTcpMaster CreateModbusTcpMaster(Guid id,string ip,int port);
  10. IModbusTcpMaster CreateModbusTcpMaster(Guid id, TcpClient tcpClient);
  11. IModbusTcpMaster GetModbusTcpMaster(Guid id);
  12. IModbusSerialMaster CreateModbusSerialMaster(Guid id,string portName);
  13. IModbusSerialMaster CreateModbusSerialMaster(Guid id, SerialPort serialPort);
  14. IModbusSerialMaster GetModbusSerialMaster(Guid id);
  15. //IModbusTcp
  16. }
  17. }