KWD 3 months ago
parent
commit
4abf8fc268
1 changed files with 11 additions and 2 deletions
  1. 11 2
      TeamAAS-VM/Core/Management.cs

+ 11 - 2
TeamAAS-VM/Core/Management.cs

@@ -2741,8 +2741,17 @@ namespace TeamAAS_VP.Core
                                 {
                                     //这里缺少从MES获取产品配方的内容,需要补充
                                     _LastMesCheckTime[i] = (await _mesService.GetServerTimeAsync(code, 2)).Now;
-                                    ProductMainSN = "";
-                                    var stationConfig2 = _configService.GetDeviceInfo(0);
+                                    DeviceInfo stationConfig2 = new DeviceInfo();
+                                    try
+                                    {
+                                        stationConfig2 = _configService.GetDeviceInfo(i);
+                                    }
+                                    catch (Exception)
+                                    {
+                                        await plc.WriteNodeAsync(string.Format(addressConfig.Out_MesStatus.Address, i), (Int16)2);
+                                        SendTaskMessage($"设置无当前站点:{i}", MessageLevel.Error);
+                                        return;
+                                    }
 
                                     //if (homeview.IsNoCode == false)
                                     //{