|
|
@@ -2062,7 +2062,7 @@ namespace TeamAAS_VP.Core
|
|
|
if (visionResults[0].IsSucceed && visionResults[1].IsSucceed && visionResults[2].IsSucceed && visionResults[3].IsSucceed)
|
|
|
{
|
|
|
SendTaskMessage($"固定相机检测OK", MessageLevel.Debug);
|
|
|
- gapString = $"1-{visionResults[0].distance},2-{visionResults[1].distance},3-{visionResults[2].distance},4-{visionResults[3].distance}";
|
|
|
+ gapString = $"1-{visionResults[0].distance.Split(',')[1]},2-{visionResults[1].distance.Split(',')[1]},3-{visionResults[2].distance.Split(',')[1]},4-{visionResults[3].distance.Split(',')[1]}";
|
|
|
await plc.WriteNodeAsync(addressConfig.Out_FixedCameracheckStatus.Address, (Int16)1);
|
|
|
return;
|
|
|
}
|
|
|
@@ -2255,8 +2255,7 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
var code = plc.ReadNode<string>(string.Format(addressConfig.In_Code.Address, i));
|
|
|
string comp = PartSN;
|
|
|
- //code = "CN0NJTYVLXU0061W0001";
|
|
|
- //comp = "110RNYV4123456789012345";
|
|
|
+ SendTaskMessage($"产品sn:{code},辅料码:{comp}", MessageLevel.Info);
|
|
|
//询问mes
|
|
|
if (state == 1)
|
|
|
{
|
|
|
@@ -2374,12 +2373,46 @@ namespace TeamAAS_VP.Core
|
|
|
if (i==0)
|
|
|
{
|
|
|
gap = gapString;
|
|
|
- assypress = currentPressure[0].ToString();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ assypress = currentPressure[0].ToString("F2");
|
|
|
+ if (currentPressure[0] >= p1.PressureDownLimit && currentPressure[0]<=p1.PressureUpLimit)
|
|
|
+ {
|
|
|
+ resultIndex = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ resultIndex = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ assypress = "0";
|
|
|
+ resultIndex = 2;
|
|
|
+ }
|
|
|
+ SendTaskMessage($"gap:{gap},组装压力:{assypress}", MessageLevel.Info);
|
|
|
}
|
|
|
else if (i == 1)
|
|
|
{
|
|
|
- press = currentPressure[1].ToString();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ press = currentPressure[1].ToString("F2");
|
|
|
+ if (currentPressure[1] >= p2.PressureDownLimit && currentPressure[1] <= p2.PressureUpLimit)
|
|
|
+ {
|
|
|
+ resultIndex = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ resultIndex = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ press = "0";
|
|
|
+ resultIndex = 2;
|
|
|
+ }
|
|
|
presstime = p2.PressureTime.ToString();
|
|
|
+ SendTaskMessage($"保压压力:{press},保压时间:{presstime}", MessageLevel.Info);
|
|
|
}
|
|
|
//gap-复检gap参数, press-保压站实际压力值, presstime-保压站保压时间, assypress-组装站实际压力值
|
|
|
(bool isSuccess, string response) = await _mesService.SubmitGetAsync(i,code, comp, gap, press, presstime, assypress, resultIndex == 1 ? true : false, _LastMesCheckTime[i], DateTime.UtcNow);
|
|
|
@@ -2433,16 +2466,15 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- SendTaskMessage($"开始保压信号[{i}]已关闭", MessageLevel.Alarm);
|
|
|
- //// 关闭时的处理(如需)可放在这里
|
|
|
- //SendTaskMessage($"收到关闭保压信号[{i}]...", MessageLevel.Debug);
|
|
|
- //// 停止采集压力并保存
|
|
|
- //await StopAndSavePressureCollectionAsync(currentProduct.Name, code, i);
|
|
|
+ SendTaskMessage($"关闭开始保压信号[{i}]...", MessageLevel.Debug);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //停止组装
|
|
|
- else if (string.Format(addressConfig.In_WorkDone.Address, i).Contains(tuple.nodeId))
|
|
|
+ }
|
|
|
+ //开始/停止 组装/锁附
|
|
|
+ for (int i = 0; i < 7; i++)
|
|
|
+ {
|
|
|
+ if (string.Format(addressConfig.In_WorkDone.Address, i).Contains(tuple.nodeId))
|
|
|
{
|
|
|
if (tuple.value is Int16 state)
|
|
|
{
|