|
|
@@ -1214,7 +1214,23 @@ namespace TeamAAS_VP.Core
|
|
|
monitorNodeIds.Add(string.Format(addressConfig.In_MesCheck.Address, i));
|
|
|
}
|
|
|
//订阅PLC地址变化
|
|
|
- plc.SubscribeNodes("AutoSensor", monitorNodeIds, PlcCommandTrigger,OpcUaSubscriptionMode.CustomPolling);
|
|
|
+ //plc.SubscribeNodes("AutoSensor", monitorNodeIds, PlcCommandTrigger, OpcUaSubscriptionMode.CustomPolling);
|
|
|
+
|
|
|
+ plc.SubscribeNodes("AutoSensor", monitorNodeIds, PlcCommandTrigger, OpcUaSubscriptionMode.CustomPolling);
|
|
|
+
|
|
|
+ // 2. 监听重连事件,重连成功后自动重新订阅
|
|
|
+ plc.ConnectChangedEvent -= Plc_ConnectChanged; // 防止重复注册
|
|
|
+ plc.ConnectChangedEvent += Plc_ConnectChanged;
|
|
|
+
|
|
|
+ // 定义重连处理方法(写在同一个类里即可)
|
|
|
+ void Plc_ConnectChanged(object sender, bool isConnected)
|
|
|
+ {
|
|
|
+ if (isConnected)
|
|
|
+ {
|
|
|
+ // 重连成功后,重新订阅节点
|
|
|
+ plc.SubscribeNodes("AutoSensor", monitorNodeIds, PlcCommandTrigger, OpcUaSubscriptionMode.CustomPolling);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -1252,8 +1268,8 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
foreach (var item in current.PickPoints)
|
|
|
{
|
|
|
- //await item.WriteToPlcAddress(addressConfig.Out_Pick, plc, item.Feeder);
|
|
|
- await item.WriteToPlcAddress(addressConfig.Out_Pick, plc);
|
|
|
+ await item.WriteToPlcAddress(addressConfig.Out_Pick, plc, item.Feeder);
|
|
|
+ //await item.WriteToPlcAddress(addressConfig.Out_Pick, plc);
|
|
|
}
|
|
|
}
|
|
|
if (current.SecPosCameraPoints != null && current.SecPosCameraPoints.Count > 0)
|
|
|
@@ -1386,13 +1402,19 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
if (tuple.key != "AutoSensor")
|
|
|
{
|
|
|
+ SendTaskMessage("PLC指令错误", MessageLevel.Debug);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var addressConfig = _configService.GetPlcAddresses();
|
|
|
|
|
|
var plc = _plcService.GetPlcByNumber(addressConfig.PlcNo) as OpcUaClientPLC;
|
|
|
- if (plc == null || !plc.IsConnected) return;
|
|
|
+ if (plc == null || !plc.IsConnected)
|
|
|
+ {
|
|
|
+ SendTaskMessage("plc为空", MessageLevel.Debug);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
// 获取当前产品
|
|
|
var currentProduct = _productService.GetCurrentProduct();
|
|
|
if (currentProduct == null)
|
|
|
@@ -1664,10 +1686,21 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
UpCameraPutResults[1] = new PointF((float)visionResult.X, (float)visionResult.Y);
|
|
|
}
|
|
|
- else
|
|
|
+ else if(systemConfig.WorkMode==2)
|
|
|
{
|
|
|
UpCameraPutResults[cameraIndex] = new PointF((float)visionResult.X, (float)visionResult.Y);
|
|
|
}
|
|
|
+ else if(systemConfig.WorkMode==3)
|
|
|
+ {
|
|
|
+ if (cameraIndex <= 3)
|
|
|
+ {
|
|
|
+ UpCameraPutResults[1] = new PointF((float)visionResult.X, (float)visionResult.Y);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ UpCameraPutResults[cameraIndex] = new PointF((float)visionResult.X, (float)visionResult.Y);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (resultToMes.Contains($"Screw{cameraIndex}_Fail"))
|
|
|
{
|
|
|
resultToMes.Remove($"Screw{cameraIndex}_Fail");
|
|
|
@@ -1907,7 +1940,8 @@ namespace TeamAAS_VP.Core
|
|
|
//位置编号
|
|
|
Int16 positionIndex = plc.ReadNode<Int16>(addressConfig.In_ProductNum.Address);
|
|
|
SendTaskMessage(string.Format(Lang.编号0, positionIndex), MessageLevel.Info);
|
|
|
- // 开始采集压力值
|
|
|
+ // 开始采集压力值,ProductMainSN[i]
|
|
|
+ //StartPressureCollection(currentProduct.Name, _productService.CurrentProductCode, 0);
|
|
|
StartPressureCollection(currentProduct.Name, _productService.CurrentProductCode, 0);
|
|
|
}
|
|
|
else
|
|
|
@@ -2040,6 +2074,18 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
lastRes = true;
|
|
|
}
|
|
|
+ if (dataToMes.Keys.Contains($"Torque{lockResult.Number}"))
|
|
|
+ {
|
|
|
+ dataToMes.Remove($"Torque{lockResult.Number}");
|
|
|
+ }
|
|
|
+ if (dataToMes.Keys.Contains($"Turn{lockResult.Number}"))
|
|
|
+ {
|
|
|
+ dataToMes.Remove($"Turn{lockResult.Number}");
|
|
|
+ }
|
|
|
+ if (dataToMes.Keys.Contains($"Pressure{lockResult.Number}"))
|
|
|
+ {
|
|
|
+ dataToMes.Remove($"Pressure{lockResult.Number}");
|
|
|
+ }
|
|
|
dataToMes.Add($"Torque{lockResult.Number}", $"{lockResult.LockTorque:F2}");
|
|
|
dataToMes.Add($"Turn{lockResult.Number}", $"{lockResult.LockTurns:F2}");
|
|
|
dataToMes.Add($"Pressure{lockResult.Number}", $"{lockResult.Pressure:F2}");
|
|
|
@@ -2092,7 +2138,7 @@ namespace TeamAAS_VP.Core
|
|
|
return;
|
|
|
}
|
|
|
if (state == 1)
|
|
|
- {
|
|
|
+ {
|
|
|
SendTaskMessage(Lang.收到多相机坐标合并请求开始合并, MessageLevel.Debug);
|
|
|
//位置编号
|
|
|
Int16 positionIndex = plc.ReadNode<Int16>(addressConfig.In_ProductNum.Address);
|
|
|
@@ -2122,7 +2168,7 @@ namespace TeamAAS_VP.Core
|
|
|
SendTaskMessage($"点:{positionIndex},{point.X_Position:F3},{point.Y_Position:F4}", MessageLevel.Info);
|
|
|
await point.WriteToPlcAddress(addressConfig.Out_Screw, plc, positionIndex);
|
|
|
}
|
|
|
- //拍1打所有
|
|
|
+ //拍2打所有
|
|
|
else if (systemConfig.WorkMode == 2)
|
|
|
{
|
|
|
//根据UpCameraPutResults[]中的索引1、2,和拍照点对应的Local下的坐标,从创建Local坐标系
|
|
|
@@ -2149,6 +2195,59 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
await plc.WriteNodeAsync(addressConfig.Out_WorkNum.Address, (Int16)currentProduct.ScrewPoints.Count);
|
|
|
}
|
|
|
+ //拍2打所有
|
|
|
+ else if (systemConfig.WorkMode == 3)
|
|
|
+ {
|
|
|
+ if (positionIndex <= 3)
|
|
|
+ {
|
|
|
+ List<PlcPoint> plcPoints = new List<PlcPoint>();
|
|
|
+ foreach (var item in currentProduct.ScrewPoints)
|
|
|
+ {
|
|
|
+ if (item.IsUse)
|
|
|
+ {
|
|
|
+ plcPoints.Add(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var point = plcPoints[positionIndex - 1];
|
|
|
+ if (point == null)
|
|
|
+ {
|
|
|
+ SendTaskMessage($"点:{positionIndex}不存在", MessageLevel.Info);
|
|
|
+ await plc.WriteNodeAsync(addressConfig.Out_CameraDone.Address, (Int16)2);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ point = point.Clone();
|
|
|
+ point.X_Position = UpCameraPutResults[1].X + DowmCameraResults[1].X;
|
|
|
+ point.Y_Position = UpCameraPutResults[1].Y + DowmCameraResults[1].Y;
|
|
|
+ SendTaskMessage($"点:{positionIndex},{point.X_Position:F3},{point.Y_Position:F4}", MessageLevel.Info);
|
|
|
+ await point.WriteToPlcAddress(addressConfig.Out_Screw, plc, positionIndex);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //根据UpCameraPutResults[]中的索引1、2,和拍照点对应的Local下的坐标,从创建Local坐标系
|
|
|
+ PointF worldP1 = new PointF(UpCameraPutResults[4].X, UpCameraPutResults[4].Y);
|
|
|
+ PointF worldP2 = new PointF(UpCameraPutResults[5].X, UpCameraPutResults[5].Y);
|
|
|
+ PointF localP1 = new PointF(currentProduct.ScrewCameraLocalPos1.X_Position, currentProduct.ScrewCameraLocalPos1.Y_Position);
|
|
|
+ PointF localP2 = new PointF(currentProduct.ScrewCameraLocalPos2.X_Position, currentProduct.ScrewCameraLocalPos2.Y_Position);
|
|
|
+ CoordinateTransformer local = new CoordinateTransformer(worldP1, worldP2, localP1, localP2);
|
|
|
+
|
|
|
+ for (int i = 0; i < currentProduct.ScrewPoints.Count; i++)
|
|
|
+ {
|
|
|
+ var localPoint = new PointF(currentProduct.ScrewPoints[i].X_Position + currentProduct.ScrewPoints[i].X_Offset,
|
|
|
+ currentProduct.ScrewPoints[i].Y_Position + currentProduct.ScrewPoints[i].Y_Offset);
|
|
|
+ var worldPoint = local.ToOldCoord(localPoint.X, localPoint.Y);
|
|
|
+ var point = currentProduct.ScrewPoints[i].Clone();
|
|
|
+
|
|
|
+ //锁付点位在Local中已经加了偏移,这里写回PLC时需要将偏移清零,否则写入PLC端时会重复计算偏移
|
|
|
+ point.X_Offset = 0;
|
|
|
+ point.Y_Offset = 0;
|
|
|
+ point.X_Position = (float)worldPoint[0];
|
|
|
+ point.Y_Position = (float)worldPoint[1];
|
|
|
+ SendTaskMessage($"点:{i},{point.X_Position:F3},{point.Y_Position:F4}", MessageLevel.Info);
|
|
|
+ await point.WriteToPlcAddress(addressConfig.Out_Screw, plc);
|
|
|
+ }
|
|
|
+ await plc.WriteNodeAsync(addressConfig.Out_WorkNum.Address, (Int16)currentProduct.ScrewPoints.Count);
|
|
|
+ }
|
|
|
+ }
|
|
|
await plc.WriteNodeAsync(addressConfig.Out_CameraDone.Address, (Int16)1);
|
|
|
}
|
|
|
else
|
|
|
@@ -2375,6 +2474,15 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
if (tuple.value is Int16 state)
|
|
|
{
|
|
|
+
|
|
|
+ //var oldState = _LastMesCheck[i];
|
|
|
+ //_LastMesCheck[i] = state;
|
|
|
+ //SendTaskMessage($"站点{i},收到PLC状态为:{state},旧状态为:{oldState}",MessageLevel.Info);
|
|
|
+ //if (oldState == state)
|
|
|
+ //{
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
+
|
|
|
if (_LastMesCheck[i] != state)
|
|
|
{
|
|
|
_LastMesCheck[i] = state;
|
|
|
@@ -2417,7 +2525,7 @@ namespace TeamAAS_VP.Core
|
|
|
{
|
|
|
code = outputCollection["QR"].Value as string;
|
|
|
code = code.ToUpper();
|
|
|
- if (!string.IsNullOrEmpty(code))
|
|
|
+ if (!string.IsNullOrEmpty(code) && code.Length > 5)
|
|
|
{
|
|
|
if (systemConfig.IsBasePartCodeChooseScrew)//是否基于零件码,判断是不是当站要打的螺丝
|
|
|
{
|
|
|
@@ -2470,10 +2578,10 @@ namespace TeamAAS_VP.Core
|
|
|
//获取过站时间
|
|
|
_LastMesCheckTime[i] = (await _mesService.GetServerTimeAsync(i, code, 2)).Now;
|
|
|
if (_configService.GetDeviceInfo().EnableMES)
|
|
|
- {
|
|
|
+ {
|
|
|
LogHelper.WriteLogMes($"【mes开始QUERY】");
|
|
|
SendTaskMessage($"mes开始QUERY", MessageLevel.Info);
|
|
|
- dataToMes.Clear();
|
|
|
+ //dataToMes.Clear();
|
|
|
if (systemConfig.IsBasePartCodeGetSN)//是否基于零件码,判断是否过站
|
|
|
{
|
|
|
SendTaskMessage($"基于零件码,判断是否过站", MessageLevel.Debug);
|
|
|
@@ -2507,7 +2615,10 @@ namespace TeamAAS_VP.Core
|
|
|
if (snItem != null)
|
|
|
{
|
|
|
ProductMainSN[i] = snItem.Replace("sn=", "").Trim();
|
|
|
- _productService.CurrentProductCode = ProductMainSN[i];
|
|
|
+ if (i == 0)
|
|
|
+ {
|
|
|
+ _productService.CurrentProductCode = ProductMainSN[i];
|
|
|
+ }
|
|
|
//_eventAggregator.GetEvent<DelaySaveImageNotification>().Publish(true);//通知界面延迟保存图片,等待MES查询结果返回,避免图片和数据不同步
|
|
|
SendTaskMessage($"产品主sn:{ProductMainSN[i]}", MessageLevel.Info);
|
|
|
}
|
|
|
@@ -2564,7 +2675,7 @@ namespace TeamAAS_VP.Core
|
|
|
if (currentProduct.ID != productId)
|
|
|
{
|
|
|
//切换产品
|
|
|
- await _productService.LoadProductAsync(productId);
|
|
|
+ _productService.LoadProduct(productId);
|
|
|
_productService.SetCurrentProduct(productId);
|
|
|
await WriteParameterToPlcExAsync();
|
|
|
SendTaskMessage($"切换产品成功", MessageLevel.Debug);
|
|
|
@@ -2627,7 +2738,10 @@ namespace TeamAAS_VP.Core
|
|
|
if (snItem != null)
|
|
|
{
|
|
|
ProductMainSN[i] = snItem.Replace("sn=", "").Trim();
|
|
|
- _productService.CurrentProductCode = ProductMainSN[i];
|
|
|
+ if (i == 0)
|
|
|
+ {
|
|
|
+ _productService.CurrentProductCode = ProductMainSN[i];
|
|
|
+ }
|
|
|
SendTaskMessage($"产品主sn:{ProductMainSN[i]}", MessageLevel.Info);
|
|
|
}
|
|
|
string woItem = item.FirstOrDefault(f => f.Contains("wo="));
|
|
|
@@ -2683,7 +2797,7 @@ namespace TeamAAS_VP.Core
|
|
|
if (currentProduct.ID != productId)
|
|
|
{
|
|
|
//切换产品
|
|
|
- await _productService.LoadProductAsync(productId);
|
|
|
+ _productService.LoadProduct(productId);
|
|
|
_productService.SetCurrentProduct(productId);
|
|
|
await WriteParameterToPlcExAsync();
|
|
|
SendTaskMessage($"切换产品成功", MessageLevel.Debug);
|
|
|
@@ -2735,10 +2849,10 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
// 上传本站数据
|
|
|
else if (state == 2)
|
|
|
- {
|
|
|
+ {
|
|
|
DFC.Clear();//CTQ数据集合
|
|
|
-
|
|
|
- //获取当前工位的配置
|
|
|
+ // string productccode = ProductMainSN[i];
|
|
|
+ //获取当前工位的配置
|
|
|
var stationConfig = _configService.GetDeviceInfo(i);
|
|
|
SendTaskMessage($"收到{i}:{stationConfig.DeviceName}上传本站数据请求...", MessageLevel.Debug);
|
|
|
//从服务器中获取当前时间
|
|
|
@@ -2802,12 +2916,12 @@ namespace TeamAAS_VP.Core
|
|
|
PPID = saveppid,
|
|
|
ScrewNum = lockResult.Number,
|
|
|
PROCESS_NAME = stationConfig.DataInfo.PROCESS_NAME,
|
|
|
- PROCESS_START_TIME = _LastMesCheckTime[i].ToString("yyyy-MM-ddTHH:mm:ss.fffffff") + "+08:00",
|
|
|
+ PROCESS_START_TIME = _LastMesCheckTime[i].ToString("yyyy-MM-ddTHH:mm:ss") + "+08:00",
|
|
|
CTQ_NAME = "Torque",
|
|
|
CTQ_VALUE = lockResult.LockTorque,
|
|
|
CTQ_LSL = lockResult.TargetTorqueLowerLimit,
|
|
|
CTQ_USL = lockResult.TargetTorqueUpperLimit,
|
|
|
- PROCESS_END_TIME = serverTimeResult.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffffff") + "+08:00",
|
|
|
+ PROCESS_END_TIME = serverTimeResult.Now.ToString("yyyy-MM-ddTHH:mm:ss") + "+08:00",
|
|
|
SUPPLIER_NAME = stationConfig.DataInfo.SUPPLIER_NAME,
|
|
|
COMMODITY_TYPE = stationConfig.DataInfo.COMMODITY_TYPE,
|
|
|
REVISION = stationConfig.DataInfo.REVISION + "_" + revision[i],
|
|
|
@@ -2830,12 +2944,12 @@ namespace TeamAAS_VP.Core
|
|
|
PPID = saveppid,
|
|
|
ScrewNum = lockResult.Number,
|
|
|
PROCESS_NAME = stationConfig.DataInfo.PROCESS_NAME,
|
|
|
- PROCESS_START_TIME = _LastMesCheckTime[i].ToString("yyyy-MM-ddTHH:mm:ss.fffffff") + "+08:00",
|
|
|
+ PROCESS_START_TIME = _LastMesCheckTime[i].ToString("yyyy-MM-ddTHH:mm:ss") + "+08:00",
|
|
|
CTQ_NAME = "Turn",
|
|
|
CTQ_VALUE = lockResult.LockTurns,
|
|
|
CTQ_LSL = lockResult.TargetTurnsLowerLimit,
|
|
|
CTQ_USL = lockResult.TargetTurnsUpperLimit,
|
|
|
- PROCESS_END_TIME = serverTimeResult.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffffff") + "+08:00",
|
|
|
+ PROCESS_END_TIME = serverTimeResult.Now.ToString("yyyy-MM-ddTHH:mm:ss") + "+08:00",
|
|
|
SUPPLIER_NAME = stationConfig.DataInfo.SUPPLIER_NAME,
|
|
|
COMMODITY_TYPE = stationConfig.DataInfo.COMMODITY_TYPE,
|
|
|
REVISION = stationConfig.DataInfo.REVISION + "_" + revision[i],
|
|
|
@@ -2858,12 +2972,12 @@ namespace TeamAAS_VP.Core
|
|
|
PPID = saveppid,
|
|
|
ScrewNum = lockResult.Number,
|
|
|
PROCESS_NAME = stationConfig.DataInfo.PROCESS_NAME,
|
|
|
- PROCESS_START_TIME = _LastMesCheckTime[i].ToString("yyyy-MM-ddTHH:mm:ss.fffffff") + "+08:00",
|
|
|
+ PROCESS_START_TIME = _LastMesCheckTime[i].ToString("yyyy-MM-ddTHH:mm:ss") + "+08:00",
|
|
|
CTQ_NAME = "Pressure",
|
|
|
CTQ_VALUE = lockResult.Pressure,
|
|
|
CTQ_LSL = stationConfig.DataInfo.CTQ_LSL_Pressure,
|
|
|
CTQ_USL = stationConfig.DataInfo.CTQ_USL_Pressure,
|
|
|
- PROCESS_END_TIME = serverTimeResult.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffffff") + "+08:00",
|
|
|
+ PROCESS_END_TIME = serverTimeResult.Now.ToString("yyyy-MM-ddTHH:mm:ss") + "+08:00",
|
|
|
SUPPLIER_NAME = stationConfig.DataInfo.SUPPLIER_NAME,
|
|
|
COMMODITY_TYPE = stationConfig.DataInfo.COMMODITY_TYPE,
|
|
|
REVISION = stationConfig.DataInfo.REVISION + "_" + revision[i],
|
|
|
@@ -2879,36 +2993,38 @@ namespace TeamAAS_VP.Core
|
|
|
PD_ATTR_03 = "NA",
|
|
|
PD_ATTR_04 = productSn,
|
|
|
PD_ATTR_05 = "NA",
|
|
|
- });
|
|
|
+ });
|
|
|
}
|
|
|
if (systemConfig.IsBasePartOpenLightKB)
|
|
|
{
|
|
|
string midValue = "999", saveppid = "NA";
|
|
|
double upvlalue = 0, doenvlaue = 0;
|
|
|
if (stationConfig.SaveCsvPPID) saveppid = ppid[i];
|
|
|
- bool pressureRes=true;
|
|
|
+ bool pressureRes = true;
|
|
|
foreach (var item in mes_cc)
|
|
|
{
|
|
|
- switch(item.Key)
|
|
|
+ switch (item.Key)
|
|
|
{
|
|
|
case "1":
|
|
|
upvlalue = Convert.ToDouble(currentProduct.GlobalParamEx.CC1DownLimit.ToString("F3"));
|
|
|
doenvlaue = Convert.ToDouble(currentProduct.GlobalParamEx.CC1UpLimit.ToString("F3"));
|
|
|
midValue = ((currentProduct.GlobalParamEx.CC1DownLimit + currentProduct.GlobalParamEx.CC1UpLimit) / 2).ToString("F3");
|
|
|
+ if (Convert.ToDouble(item.Value) < upvlalue || Convert.ToDouble(item.Value) > doenvlaue)
|
|
|
+ {
|
|
|
+ resultToMes.Add($"CC{item.Key}_Fail");
|
|
|
+ SendTaskMessage($"CC{item.Key}:超限", MessageLevel.Error);
|
|
|
+ }
|
|
|
break;
|
|
|
case "2":
|
|
|
upvlalue = Convert.ToDouble(currentProduct.GlobalParamEx.CC2DownLimit.ToString("F3"));
|
|
|
doenvlaue = Convert.ToDouble(currentProduct.GlobalParamEx.CC2UpLimit.ToString("F3"));
|
|
|
midValue = ((currentProduct.GlobalParamEx.CC2DownLimit + currentProduct.GlobalParamEx.CC2UpLimit) / 2).ToString("F3");
|
|
|
- break;
|
|
|
- }
|
|
|
- if (doenvlaue<= currentProduct.GlobalParamEx.CC1DownLimit|| doenvlaue >= currentProduct.GlobalParamEx.CC1UpLimit)
|
|
|
- {
|
|
|
- pressureRes = false;
|
|
|
- }
|
|
|
- if (doenvlaue <= currentProduct.GlobalParamEx.CC2DownLimit|| doenvlaue >= currentProduct.GlobalParamEx.CC2UpLimit)
|
|
|
- {
|
|
|
- pressureRes = false;
|
|
|
+ if (Convert.ToDouble(item.Value) < upvlalue || Convert.ToDouble(item.Value) > doenvlaue)
|
|
|
+ {
|
|
|
+ resultToMes.Add($"CC{item.Key}_Fail");
|
|
|
+ SendTaskMessage($"CC{item.Key}:超限", MessageLevel.Error);
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
dataToMes.Add($"CC{item.Key}", $"{item.Value}");
|
|
|
DFC.Add(new DataFormCtq
|
|
|
@@ -2916,12 +3032,12 @@ namespace TeamAAS_VP.Core
|
|
|
PPID = saveppid,
|
|
|
ScrewNum = 1,
|
|
|
PROCESS_NAME = stationConfig.DataInfo.PROCESS_NAME,
|
|
|
- PROCESS_START_TIME = _LastMesCheckTime[i].ToString("yyyy-MM-ddTHH:mm:ss.fffffff") + "+08:00",
|
|
|
+ PROCESS_START_TIME = _LastMesCheckTime[i].ToString("yyyy-MM-ddTHH:mm:ss") + "+08:00",
|
|
|
CTQ_NAME = $"CC{item.Key}",
|
|
|
CTQ_VALUE = Convert.ToDouble(item.Value.ToString()),
|
|
|
CTQ_LSL = doenvlaue,
|
|
|
CTQ_USL = upvlalue,
|
|
|
- PROCESS_END_TIME = serverTimeResult.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffffff") + "+08:00",
|
|
|
+ PROCESS_END_TIME = serverTimeResult.Now.ToString("yyyy-MM-ddTHH:mm:ss") + "+08:00",
|
|
|
SUPPLIER_NAME = stationConfig.DataInfo.SUPPLIER_NAME,
|
|
|
COMMODITY_TYPE = stationConfig.DataInfo.COMMODITY_TYPE,
|
|
|
REVISION = stationConfig.DataInfo.REVISION + "_" + revision[i],
|
|
|
@@ -3080,13 +3196,14 @@ namespace TeamAAS_VP.Core
|
|
|
WriteProductLog(lockResultsAll, ProductMainSN[i], CTtime);
|
|
|
mes_cc.Clear();
|
|
|
LogHelper.WriteLogMes($"【mes结束ADD】");
|
|
|
- SendTaskMessage($"mes结束ADD", MessageLevel.Info);
|
|
|
+ SendTaskMessage($"mes结束ADD", MessageLevel.Info);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
SendTaskMessage($"{i}过站检查信号:state={state},处理为默认状态", MessageLevel.Alarm);
|
|
|
await plc.WriteNodeAsync(string.Format(addressConfig.Out_MesStatus.Address, i), (Int16)0);
|
|
|
}
|
|
|
+ // _LastMesCheck[i] = 0;
|
|
|
}
|
|
|
}
|
|
|
}
|