|
|
@ -114,8 +114,7 @@ namespace Aucma.Scada.Business
|
|
|
|
|
|
|
|
|
|
|
|
if (_plc != null)
|
|
|
|
if (_plc != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_plc.IsConnected)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_plc.readInt32ByAddress(plcConfig.out_shell_answer) == 1)
|
|
|
|
if (_plc.readInt32ByAddress(plcConfig.out_shell_answer) == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -135,11 +134,7 @@ namespace Aucma.Scada.Business
|
|
|
|
result = 2;
|
|
|
|
result = 2;
|
|
|
|
logHelper.Info("应答字为2,下发新任务plc未就绪");
|
|
|
|
logHelper.Info("应答字为2,下发新任务plc未就绪");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
logHelper.Info($"仓库{taskInfo.storeCode};PLC未连接");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -167,8 +162,7 @@ namespace Aucma.Scada.Business
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_plc != null)
|
|
|
|
if (_plc != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_plc.IsConnected)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
do
|
|
|
|
do
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//读取PLC应答字为2时,上位机清空写入的出库内容
|
|
|
|
//读取PLC应答字为2时,上位机清空写入的出库内容
|
|
|
@ -187,11 +181,7 @@ namespace Aucma.Scada.Business
|
|
|
|
Thread.Sleep(500);
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
|
|
|
|
|
|
|
} while (isFlag);
|
|
|
|
} while (isFlag);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
logHelper.Info($"仓库{appConfig.shellStoreCode};PLC未连接");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -268,8 +258,7 @@ namespace Aucma.Scada.Business
|
|
|
|
|
|
|
|
|
|
|
|
if (_plc != null)
|
|
|
|
if (_plc != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_plc.IsConnected)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_plc.readInt32ByAddress(plcConfig.out_liner_answer) == 1)
|
|
|
|
if (_plc.readInt32ByAddress(plcConfig.out_liner_answer) == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -290,11 +279,7 @@ namespace Aucma.Scada.Business
|
|
|
|
logHelper.Info("内胆应答字为2,下发新任务plc未就绪");
|
|
|
|
logHelper.Info("内胆应答字为2,下发新任务plc未就绪");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
logHelper.Info($"仓库{taskInfo.storeCode};PLC未连接");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -322,8 +307,7 @@ namespace Aucma.Scada.Business
|
|
|
|
|
|
|
|
|
|
|
|
if (_plc != null)
|
|
|
|
if (_plc != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_plc.IsConnected)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
do
|
|
|
|
do
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
@ -344,11 +328,7 @@ namespace Aucma.Scada.Business
|
|
|
|
Thread.Sleep(500);
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
|
|
|
|
|
|
|
} while (isFlag);
|
|
|
|
} while (isFlag);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
logHelper.Info($"仓库{appConfig.linerStoreCode};PLC未连接");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -374,8 +354,7 @@ namespace Aucma.Scada.Business
|
|
|
|
IPlc _plc = _plcDictionary[appConfig.linerStoreCode];
|
|
|
|
IPlc _plc = _plcDictionary[appConfig.linerStoreCode];
|
|
|
|
if (_plc != null)
|
|
|
|
if (_plc != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_plc.IsConnected)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
do
|
|
|
|
do
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//读取PLC出库任务完成
|
|
|
|
//读取PLC出库任务完成
|
|
|
@ -394,11 +373,7 @@ namespace Aucma.Scada.Business
|
|
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
} while (isFlag);
|
|
|
|
} while (isFlag);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
logHelper.Info($"仓库{appConfig.linerStoreCode};PLC未连接");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -550,12 +525,11 @@ namespace Aucma.Scada.Business
|
|
|
|
|
|
|
|
|
|
|
|
if (_plc != null)
|
|
|
|
if (_plc != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_plc.IsConnected)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
spaceInfo.spaceStock = _plc.readInt32ByAddress(spaceAddress.onStore);
|
|
|
|
spaceInfo.spaceStock = _plc.readInt32ByAddress(spaceAddress.onStore);
|
|
|
|
spaceInfo.onRouteAmount = _plc.readInt32ByAddress(spaceAddress.onRoute);
|
|
|
|
spaceInfo.onRouteAmount = _plc.readInt32ByAddress(spaceAddress.onRoute);
|
|
|
|
// spaceInfo.spaceStatus = _plc.readInt32ByAddress(spaceAddress.spaceStatus);
|
|
|
|
// spaceInfo.spaceStatus = _plc.readInt32ByAddress(spaceAddress.spaceStatus);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return spaceInfo;
|
|
|
|
return spaceInfo;
|
|
|
@ -574,14 +548,13 @@ namespace Aucma.Scada.Business
|
|
|
|
|
|
|
|
|
|
|
|
if (_plc != null)
|
|
|
|
if (_plc != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_plc.IsConnected)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var spaceStock = _plc.readInt32ByAddress(spaceAddress.onStore);
|
|
|
|
var spaceStock = _plc.readInt32ByAddress(spaceAddress.onStore);
|
|
|
|
//var onRouteAmount = _plc.readInt32ByAddress(spaceAddress.onRoute);
|
|
|
|
//var onRouteAmount = _plc.readInt32ByAddress(spaceAddress.onRoute);
|
|
|
|
|
|
|
|
|
|
|
|
_plc.writeInt32ByAddress(spaceAddress.onStore, spaceStock - 1);
|
|
|
|
_plc.writeInt32ByAddress(spaceAddress.onStore, spaceStock - 1);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|