Exemple #1
0
 public IPPort(ModbusConnection con) : base(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
 {
     _con = con;
     if (con.TimeOut != 0)
     {
         TimeOut = con.TimeOut;
     }
     base.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, TimeOut);
 }
Exemple #2
0
        void IDevice.Register(ModbusConnection con)
        {
            _con = con;
            switch (con.ComType)
            {
            case ComType.SerialPort: _iProtocol = new ModbusRTU(); break;

            case ComType.IPPort: _iProtocol = new ModbusTCP(); break;
            }
        }