示例#1
0
        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);
        }
示例#2
0
 public TestModBus()
 {
     InitializeComponent();
     this.Wrapper        = ModBusWrapper.CreateInstance(Protocol.TCPIP);
     this.Wrapper.Logger = this;
 }