From e52744716da77be232ac6ecc7573a2ef2294e65c Mon Sep 17 00:00:00 2001 From: czw <selecti@yeah.net> Date: 星期五, 27 六月 2025 16:18:20 +0800 Subject: [PATCH] 1 --- S7/RunTime/Code/设备通信.cs | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git "a/S7/RunTime/Code/\350\256\276\345\244\207\351\200\232\344\277\241.cs" "b/S7/RunTime/Code/\350\256\276\345\244\207\351\200\232\344\277\241.cs" index 53be932..bd6814a 100644 --- "a/S7/RunTime/Code/\350\256\276\345\244\207\351\200\232\344\277\241.cs" +++ "b/S7/RunTime/Code/\350\256\276\345\244\207\351\200\232\344\277\241.cs" @@ -48,6 +48,8 @@ public GZ.Device.PLC.PlcBase 缁村笇灏旀姄鑷�=null; public GZ.Device.PLC.PlcBase 鎹风灛鎶撹噦1=null; public GZ.Device.PLC.PlcBase 鎹风灛鎶撹噦2=null; + public GZ.Device.PLC.PlcBase PLC3=null; + public GZ.Device.PLC.PlcBase PLC4=null; public Device() { PLC1 = GZ.Device.PLC.PlcFactory.CreateInstanceByFile @@ -110,6 +112,16 @@ System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs", "鎹风灛鎶撹噦2"), null ); + PLC3 = GZ.Device.PLC.PlcFactory.CreateInstanceByFile + ( + System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs", "PLC3"), + null + ); + PLC4 = GZ.Device.PLC.PlcFactory.CreateInstanceByFile + ( + System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs", "PLC4"), + null + ); if(System.Configuration.ConfigurationManager.AppSettings["AutoRunPLC"]=="1") { if(PLC1!=null){PLC1.Run();} @@ -124,6 +136,8 @@ if(缁村笇灏旀姄鑷�!=null){缁村笇灏旀姄鑷�.Run();} if(鎹风灛鎶撹噦1!=null){鎹风灛鎶撹噦1.Run();} if(鎹风灛鎶撹噦2!=null){鎹风灛鎶撹噦2.Run();} + if(PLC3!=null){PLC3.Run();} + if(PLC4!=null){PLC4.Run();} } } } @@ -284,6 +298,26 @@ } #endregion + #region PLC3 + public _PLC3 PLC3 = new _PLC3(); + /// <summary> + /// + /// </summary> + public class _PLC3 + { + } + #endregion + + #region PLC4 + public _PLC4 PLC4 = new _PLC4(); + /// <summary> + /// + /// </summary> + public class _PLC4 + { + } + #endregion + } #endregion -- Gitblit v1.9.1