|
|
@@ -962,12 +962,15 @@ namespace TeamAAS_VP.Core
|
|
|
addressConfig.In_FixedCameracheckExe.Address,
|
|
|
addressConfig.In_WorkStart.Address,
|
|
|
addressConfig.In_WorkDone.Address,
|
|
|
- addressConfig.In_MesCheck.Address,
|
|
|
+ //addressConfig.In_MesCheck.Address,
|
|
|
addressConfig.In_RequestPosition.Address,
|
|
|
addressConfig.In_ScrewTeachExe.Address,
|
|
|
addressConfig.In_PickINC.Address,
|
|
|
};
|
|
|
-
|
|
|
+ for (int i = 0; i < 10; i++)
|
|
|
+ {
|
|
|
+ monitorNodeIds.Add(string.Format(addressConfig.In_MesCheck.Address,i));
|
|
|
+ }
|
|
|
//订阅PLC地址变化
|
|
|
plc.SubscribeNodes("AutoSensor", monitorNodeIds, PlcCommandTrigger);
|
|
|
}
|
|
|
@@ -1784,33 +1787,7 @@ namespace TeamAAS_VP.Core
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // 过站检查
|
|
|
- else if (addressConfig.In_MesCheck.Address.Contains(tuple.nodeId))
|
|
|
- {
|
|
|
- if (tuple.value is Int16 state)
|
|
|
- {
|
|
|
- if (state == 1)
|
|
|
- {
|
|
|
- SendTaskMessage($"收到过站检查请求(当站是否生产)...", MessageLevel.Debug);
|
|
|
-
|
|
|
- //产品发生改变并且供料器发生了变化时,需要通知PLC进行取料更改
|
|
|
- await plc.WriteNodeAsync(addressConfig.Out_ScrewFeederIsChanged.Address, (Int16)1); //不发生改变
|
|
|
-
|
|
|
- await plc.WriteNodeAsync(addressConfig.Out_MesStatus.Address, (Int16)1);
|
|
|
- }
|
|
|
- // 上传本站数据
|
|
|
- else if (state == 2)
|
|
|
- {
|
|
|
- SendTaskMessage($"收到上传本站数据请求...", MessageLevel.Debug);
|
|
|
- await plc.WriteNodeAsync(addressConfig.Out_MesStatus.Address, (Int16)3);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- SendTaskMessage($"过站检查信号:state={state},处理为默认状态", MessageLevel.Alarm);
|
|
|
- await plc.WriteNodeAsync(addressConfig.Out_MesStatus.Address, (Int16)0);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
// 螺丝供料器螺丝递减
|
|
|
else if (addressConfig.In_PickINC.Address.Contains(tuple.nodeId))
|
|
|
{
|
|
|
@@ -1824,6 +1801,48 @@ namespace TeamAAS_VP.Core
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ // 过站检查
|
|
|
+ else
|
|
|
+ {
|
|
|
+ for (int i = 0; i < 10; i++)
|
|
|
+ {
|
|
|
+ if (string.Format( addressConfig.In_MesCheck.Address,i).Contains(tuple.nodeId))
|
|
|
+ {
|
|
|
+ if (tuple.value is Int16 state)
|
|
|
+ {
|
|
|
+ if (state == 1)
|
|
|
+ {
|
|
|
+ if (i == 0)
|
|
|
+ {
|
|
|
+ SendTaskMessage($"收到当前站过站检查请求(当站是否生产)...", MessageLevel.Debug);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SendTaskMessage($"收到{i}过站检查请求(当站是否生产)...", MessageLevel.Debug);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //产品发生改变并且供料器发生了变化时,需要通知PLC进行取料更改
|
|
|
+ await plc.WriteNodeAsync(addressConfig.Out_ScrewFeederIsChanged.Address, (Int16)1); //不发生改变
|
|
|
+
|
|
|
+ await plc.WriteNodeAsync(string.Format(addressConfig.Out_MesStatus.Address,i), (Int16)1);
|
|
|
+ }
|
|
|
+ // 上传本站数据
|
|
|
+ else if (state == 2)
|
|
|
+ {
|
|
|
+ SendTaskMessage($"收到上传本站数据请求...", MessageLevel.Debug);
|
|
|
+ await plc.WriteNodeAsync(string.Format(addressConfig.Out_MesStatus.Address, i), (Int16)3);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SendTaskMessage($"过站检查信号:state={state},处理为默认状态", MessageLevel.Alarm);
|
|
|
+ await plc.WriteNodeAsync(string.Format(addressConfig.Out_MesStatus.Address, i), (Int16)0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|