diff --git a/DosingSystem/Model/SiemensPlc/SensorInfo.cs b/DosingSystem/Model/SiemensPlc/SensorInfo.cs new file mode 100644 index 00000000..79f363ec --- /dev/null +++ b/DosingSystem/Model/SiemensPlc/SensorInfo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.DosingSystem.Model.SiemensPlc +{ + public class SensorInfo + { + public bool LocalEStop { get; set; } + public bool RemoteEStop {get; set; } + + public bool[] Sensor { get; set; } = new bool[8]; + + public bool[] Standby1 { get; set; } = new bool[6]; + public bool[] CylinderBase { get; set; } = new bool[8]; + public bool[] CylinderWork { get; set; } = new bool[8]; + + public bool[] Standby2 { get; set; } = new bool[8]; + public bool AlarmAxis1 { get; set; } + public bool AlarmAxis2 { get; set; } + } +} diff --git a/DosingSystem/ViewModel/RecipeControlViewModel.cs b/DosingSystem/ViewModel/RecipeControlViewModel.cs index 21ab5f1d..05ea2efb 100644 --- a/DosingSystem/ViewModel/RecipeControlViewModel.cs +++ b/DosingSystem/ViewModel/RecipeControlViewModel.cs @@ -117,14 +117,18 @@ namespace BPASmartClient.DosingSystem.ViewModel Stopwatch sw = new Stopwatch(); App.Current.Dispatcher.Invoke(() => { recipeProcesses.Add(Recipes.ElementAt(index)); }); sw.Restart(); - while (!GlobalDevice.PlcData.ResComplete) + while (true) { - if (sw.ElapsedMilliseconds >= 3000) + if (sw.ElapsedMilliseconds >= 3000 && !GlobalDevice.PlcData.ResComplete) { MessageNotify.GetInstance.ShowRunLog("获取配方下发反馈超时"); break; } - if (GlobalDevice.PlcData.ResComplete) SiemensDevice.GetInstance.MySiemens.Write("DB3.DBX0.1", false); + if (GlobalDevice.PlcData.ResComplete) + { + SiemensDevice.GetInstance.MySiemens.Write("DB3.DBX0.1", false); + break; + } Thread.Sleep(100); } #endregion