|
|
@ -81,7 +81,7 @@ namespace Aucma.Scada.Business
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_plcDictionary = _pool.GetAll();
|
|
|
|
_plcDictionary = _pool.GetAll();
|
|
|
|
_taskInfoService = registerServices.GetService<IRealTaskInfoService>();
|
|
|
|
_taskInfoService = registerServices.GetService<IRealTaskInfoService>();
|
|
|
|
RealReadFinish();
|
|
|
|
// RealReadFinish();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -102,7 +102,7 @@ namespace Aucma.Scada.Business
|
|
|
|
if (_plcDictionary.Count > 0)
|
|
|
|
if (_plcDictionary.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IPlc _plc = _plcDictionary[appConfig.foamStoreCode];
|
|
|
|
IPlc _plc = _plcDictionary[appConfig.foamStoreCode];
|
|
|
|
if (_plc != null && _plc.IsConnected)
|
|
|
|
if (_plc != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//出库完成
|
|
|
|
//出库完成
|
|
|
|
if (_plc.readInt32ByAddress(plcConfig.out_foam_finish) == 1)
|
|
|
|
if (_plc.readInt32ByAddress(plcConfig.out_foam_finish) == 1)
|
|
|
@ -160,8 +160,7 @@ namespace Aucma.Scada.Business
|
|
|
|
|
|
|
|
|
|
|
|
if (_plc != null)
|
|
|
|
if (_plc != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_plc.IsConnected)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (_plc.readInt32ByAddress(plcConfig.out_foam_answer) == 1)
|
|
|
|
if (_plc.readInt32ByAddress(plcConfig.out_foam_answer) == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
logHelper.Info("泡后出库应答字为1,货道号:" + plcConfig.out_foam_spaceCode + ";写" + short.Parse(taskInfo.spaceCode.Substring(5, 1)));
|
|
|
|
logHelper.Info("泡后出库应答字为1,货道号:" + plcConfig.out_foam_spaceCode + ";写" + short.Parse(taskInfo.spaceCode.Substring(5, 1)));
|
|
|
@ -180,11 +179,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
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -214,17 +209,19 @@ namespace Aucma.Scada.Business
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_plc != null)
|
|
|
|
if (_plc != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_plc.IsConnected)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
do
|
|
|
|
do
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//读取PLC应答字为2时,上位机清空写入的出库内容
|
|
|
|
//读取PLC应答字为2时,上位机清空写入的出库内容
|
|
|
|
if (_plc.readInt32ByAddress(plcConfig.out_foam_answer) == 2)
|
|
|
|
if (_plc.readInt32ByAddress(plcConfig.out_foam_answer) == 2)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
logHelper.Info("出库应答字为2,货道号:" + plcConfig.out_foam_spaceCode + ";复位写0");
|
|
|
|
|
|
|
|
|
|
|
|
logHelper.Info("出库应答字写3,应答字为2,货道号:" + plcConfig.out_foam_spaceCode + ";复位写0");
|
|
|
|
//写入货道号
|
|
|
|
//写入货道号
|
|
|
|
_plc.writeInt32ByAddress(plcConfig.out_foam_spaceCode, 0);
|
|
|
|
_plc.writeInt32ByAddress(plcConfig.out_foam_spaceCode, 0);
|
|
|
|
|
|
|
|
//写入应答字3
|
|
|
|
|
|
|
|
_plc.writeInt32ByAddress(plcConfig.out_foam_answer, 3);
|
|
|
|
//写入出库数量
|
|
|
|
//写入出库数量
|
|
|
|
_plc.writeInt32ByAddress(plcConfig.out_foam_amount, 0);
|
|
|
|
_plc.writeInt32ByAddress(plcConfig.out_foam_amount, 0);
|
|
|
|
isFlag = false;
|
|
|
|
isFlag = false;
|
|
|
@ -234,11 +231,7 @@ namespace Aucma.Scada.Business
|
|
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(500);
|
|
|
|
Thread.Sleep(500);
|
|
|
|
} while (isFlag);
|
|
|
|
} while (isFlag);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
logHelper.Info($"仓库{appConfig.foamStoreCode};PLC未连接");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -268,12 +261,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;
|
|
|
|