public static ModBusWrapper CreateInstance(Protocol protocol) { if (_Instance == null) { switch (protocol) { case Protocol.TCPIP: _Instance = new ModBusTCPIPWrapper(); break; case Protocol.SerialPort: _Instance = new ModBusSerialPortWrapper(); break; default: break; } } return(_Instance); }
public TestModBus() { InitializeComponent(); this.Wrapper = ModBusWrapper.CreateInstance(Protocol.TCPIP); this.Wrapper.Logger = this; }