change - 空板入库信号捕捉逻辑修改

collectionStore
wenjy 6 months ago
parent dde12f07a8
commit b9298e42c1

@ -205,11 +205,12 @@ namespace Aucma.Scada.Business
/// 空板入库逻辑
/// </summary>
/// <param name="storeCode"></param>
private void BareBoardInStore(string storeCode)
private void BareBoardInStore(string storeCode,bool isFlag = true)
{
try
{
PrintLogInfoMessage(storeCode == appConfig.shellStoreCode ? "收到箱壳空板入库请求" : "收到内胆空板入库请求" + ";筛选异常货道创建入库任务");
string typeStr = isFlag ? "空板入库请求" : "读取失败自动进入异常道";
PrintLogInfoMessage(storeCode == appConfig.shellStoreCode ? "收到箱壳" : "收到内胆" + isFlag+";筛选异常货道创建入库任务");
//获取异常货道
var spaceList = _spaceInfoService.GetSpaceInfosByStoreCode(storeCode);

@ -106,7 +106,7 @@ namespace Aucma.Scada.Business
public delegate void InStoreAnswer(string storeCode, string taskCode);
public event InStoreAnswer InStoreAnswerEvent;
public delegate void BareBoardHandle(string storeCode);
public delegate void BareBoardHandle(string storeCode,bool isFlag = true);
public event BareBoardHandle BareBoardHandleEvent;
#endregion
@ -419,12 +419,22 @@ namespace Aucma.Scada.Business
BareBoardHandleEvent?.Invoke(appConfig.shellStoreCode);
Thread.Sleep(500);
Thread.Sleep(1000);
}else if (isFlag == 1)
{
//_plc.writeInt32ByAddress(plcConfig.in_shell_bare_board, 0);
for (int i = 0; i < 20; i++)
{
int flag = _plc.readInt32ByAddress(plcConfig.in_shell_bare_board);
if(flag == 0)//代表PLC已经收到任务
{
continue;
}
Thread.Sleep(200);
}
BareBoardHandleEvent?.Invoke(appConfig.shellStoreCode,false);
Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss.ffff")}箱壳有料");
_plc.writeInt32ByAddress(plcConfig.in_shell_bare_board, 0);
Thread.Sleep(500);
}
Thread.Sleep(200);
@ -457,13 +467,22 @@ namespace Aucma.Scada.Business
BareBoardHandleEvent?.Invoke(appConfig.linerStoreCode);
Thread.Sleep(500);
Thread.Sleep(1000);
}
else if (isFlag == 1)
{
//_plc.writeInt32ByAddress(plcConfig.in_liner_bare_board, 0);
for (int i = 0; i < 20; i++)
{
int flag = _plc.readInt32ByAddress(plcConfig.in_liner_bare_board);
if (flag == 0)//代表PLC已经收到任务
{
continue;
}
Thread.Sleep(200);
}
BareBoardHandleEvent?.Invoke(appConfig.linerStoreCode, false);
Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss.ffff")}内胆有料");
_plc.writeInt32ByAddress(plcConfig.in_liner_bare_board, 0);
Thread.Sleep(500);
}

Loading…
Cancel
Save