dathlin / HslCommunication

A very popular industrial Internet of Things communication plug-in. Using this dll can be very convenient, stable, and fast to obtain data from PLC equipment of multiple brands, and also supports redis, mqtt, websocket, etc., which can let your data on the network Free transmission, reducing enterprise development costs.
http://www.hslcommunication.cn
1.56k stars 612 forks source link

丢包率过高 #19

Open shawn-show opened 2 years ago

shawn-show commented 2 years ago

对西门子S1500系列进行读写,丢包率达到40%。

            var Connector = new SiemensS7Net(SiemensPLCS.S1500, "172.16.2.121")
            {
                ConnectTimeOut = 5000
            };
            var result1 = Connector.ConnectServer();
            var amount = 0;
            for (short i = 0; i < 10000; i++)
            {
                Connector.Write("DB1001.6", i);
                var output = Connector.ReadInt16("DB1001.6").Content;
                if (i == output)
                {
                    amount++;
                }
            }
            Logger.LogDebug($"进行输入10000次,正确{amount}次");
            Connector.ConnectClose();

结果是进行输入10000次,正确6060次

dathlin commented 2 years ago

需要确保该地址没有被PLC或是其他程序使用,我们实际使用测试读写100万次,没有一次失败