예제 #1
0
        static void Main(string[] args)
        {
            List <ModbusSlave> lstDevice = new List <ModbusSlave>();

            for (int i = 0; i < 100; i++)
            {
                TcpListener listener = new TcpListener(IPAddress.Any, 40022 + i);//for test
                var         slaveTCP = ModbusSerialSlaveTcp.CreateTcp(1, listener);
                slaveTCP.ModbusSlaveRequestReceived += Slave_ModbusSlaveRequestReceived;
                lstDevice.Add(slaveTCP);
            }
            StartListListen(lstDevice);
            Console.ReadLine();
        }