pry 1 год назад
Родитель
Сommit
b464d785ae
2 измененных файлов: 31 добавлений и 3 удалений
  1. +24
    -0
      DosingSystem/Model/SiemensPlc/SensorInfo.cs
  2. +7
    -3
      DosingSystem/ViewModel/RecipeControlViewModel.cs

+ 24
- 0
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; }
}
}

+ 7
- 3
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


Загрузка…
Отмена
Сохранить