| | |
| | | using System.Net.NetworkInformation; |
| | | using System.Windows.Documents; |
| | | using System.Text.RegularExpressions; |
| | | using GZ.Device.PLC; |
| | | using S7.Net; |
| | | |
| | | namespace GZ.Projects.AuxAllWCS |
| | | { |
| | |
| | | // return _repository; |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// é
ç½®åå§åã |
| | | /// </summary> |
| | |
| | | Console.Clear(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public void ThreaTotal(Tag tag, Device device) |
| | |
| | | |
| | | 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); |
| | |
| | | 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åé£ç§1ä¸çº¿.Config.IP |