From 0d783a041e71c91e24c338ee43a1b5f62d7954f2 Mon Sep 17 00:00:00 2001 From: czw <selecti@yeah.net> Date: 星期三, 23 七月 2025 15:25:04 +0800 Subject: [PATCH] 1 --- 2025年6月12日/AuxAllWCS/Build/Project/代码/自定义类.cs | 2 +- 2025年6月12日/AuxAllWCS/Build/Project/AuxAllWCS.csproj | 4 ++++ 2025年6月12日/AuxAllWCS/Build/Project/代码/VS自定义类/AutoThread.cs | 22 +++++++++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/AuxAllWCS.csproj" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/AuxAllWCS.csproj" index e3ac2e5..0acd728 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/AuxAllWCS.csproj" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/AuxAllWCS.csproj" @@ -38,6 +38,10 @@ <Reference Include="Microsoft.Web.WebView2.Wpf, Version=1.0.3351.48, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL"> <HintPath>packages\Microsoft.Web.WebView2.1.0.3351.48\lib\net462\Microsoft.Web.WebView2.Wpf.dll</HintPath> </Reference> + <Reference Include="S7.Net, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d5812d469e84c693, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>bin\Debug\S7.Net.dll</HintPath> + </Reference> <Reference Include="System"> <HintPath>..\..\Dlls\System.dll</HintPath> </Reference> diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" index 6a2d2b8..db756a8 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" @@ -30,6 +30,8 @@ using System.Net.NetworkInformation; using System.Windows.Documents; using System.Text.RegularExpressions; +using GZ.Device.PLC; +using S7.Net; namespace GZ.Projects.AuxAllWCS { @@ -149,6 +151,7 @@ // return _repository; // } //} + /// <summary> /// 閰嶇疆鍒濆鍖栥� /// </summary> @@ -173,6 +176,7 @@ Console.Clear(); } } + public void ThreaTotal(Tag tag, Device device) @@ -240,11 +244,27 @@ tasks.Add(GetTask(ThreadMXC5, tag, 3000)); tasks.Add(GetTask(ThreadMXC6, tag, 3000)); + tasks.Add(GetTask(ThreadS7helper, tag, 3000)); LogHelper.Info("ThreaTotal 绾跨▼鎬荤嚎runing"); Task.WaitAll(tasks.ToArray()); LogHelper.Info("ThreaTotal 绾跨▼鎬荤嚎over"); } + + public static ConcurrentDictionary<string, S7.Net.Plc> keyValuePairs = new ConcurrentDictionary<string, S7.Net.Plc>(); + + private void ThreadS7helper(Tag tag) + { + //var plc = new Plc(CpuType.S71500,); + + //foreach (var item in collection) + //{ + // S7.Net.Plc plc = new Plc(CpuType.S71500, item.address, 0, 1); + // Link(plc); + // PLCS.Add(item.deviceName, plc); + //} + } + void taskssss1(Tag tag) { sa1025(tag); @@ -264,7 +284,7 @@ sa3010(tag); } - public static ConcurrentDictionary<string, bool> Iponlines = new ConcurrentDictionary<string, bool>(); + //public static ConcurrentDictionary<string, bool> Iponlines = new ConcurrentDictionary<string, bool>(); public bool IsMachineOnline(string hostNameOrIp, int timeout = 1000) { //device.p鍙戦偅绉�涓嬬嚎.Config.IP diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" index c6bf882..52e3c02 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" @@ -653,7 +653,7 @@ N_CREATEMETHOD = 0 }; TaskActRepository taskserice = new TaskActRepository(); - + taskserice.Insert(action); taskserice.Disnull(); } -- Gitblit v1.9.1