|
|
|
|
@ -54,6 +54,10 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
/// </summary>
|
|
|
|
|
private readonly BasePlcpoint reserialno06;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 提升机手自动状态
|
|
|
|
|
/// </summary>
|
|
|
|
|
private readonly BasePlcpoint hoisterStatus;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 提升机到位信号 读
|
|
|
|
|
/// </summary>
|
|
|
|
|
private readonly BasePlcpoint mesClose;
|
|
|
|
|
@ -80,7 +84,8 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
this.targetfloor06 = StaticData.BasePlcpointList.First(t => t.equipmentNo.Contains("Hoister") && t.plcpointNo.Contains("targetfloor06"));
|
|
|
|
|
//一楼提升机到位信号 读
|
|
|
|
|
this.reserialno06 = StaticData.BasePlcpointList.First(t => t.equipmentNo.Contains("Hoister") && t.plcpointNo.Contains("reserialno06"));
|
|
|
|
|
|
|
|
|
|
//提升机手自动状态
|
|
|
|
|
this.hoisterStatus = StaticData.BasePlcpointList.First(t => t.equipmentNo.Contains("Hoister") && t.plcpointNo.Contains("hoisterStatus"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -300,7 +305,6 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
{
|
|
|
|
|
if (StaticData.BigContainerCodes.Contains(RFID001Value))
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
var newTask = new WcsTask()
|
|
|
|
|
{
|
|
|
|
|
objid = StaticData.SnowId.NextId(),
|
|
|
|
|
@ -495,7 +499,7 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
{
|
|
|
|
|
using var scope = _host.Services.CreateScope();
|
|
|
|
|
using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
|
|
|
|
using var transaction = dbContext.Database.BeginTransaction();
|
|
|
|
|
@ -507,9 +511,10 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
var hoisterTrayIn06Value = StaticData.PlcDic[0].Read(this.hoistertrayin06.plcpointAddress); //提升机货物到位状态 读
|
|
|
|
|
var currentfloor06Value = StaticData.PlcDic[0].Read(this.currentfloor06.plcpointAddress); //提升机当前楼层 读
|
|
|
|
|
var targetfloor06Value = StaticData.PlcDic[0].Read(this.targetfloor06.plcpointAddress); //提升机目的楼层 写
|
|
|
|
|
var hoisterStatusValue = StaticData.PlcDic[0].Read(this.hoisterStatus.plcpointAddress); //提升机目的楼层 写
|
|
|
|
|
var reserialno06 = StaticData.PlcDic[0].Read(this.reserialno06.plcpointAddress); //反馈流水号
|
|
|
|
|
_logger.Info($"MES开启?{mesCloseValue},提升机流水号?{serialno06Value},提升机状态?{equipstate06Value},提升机货物到位状态?{hoisterTrayIn06Value},提升机当前楼层?{currentfloor06Value},提升机目的楼层?{targetfloor06Value},反馈流水号?{reserialno06}");
|
|
|
|
|
if (mesCloseValue != null && Convert.ToInt32(mesCloseValue) == 0)
|
|
|
|
|
_logger.Info($"MES开启?{mesCloseValue},提升机自动状态?{hoisterStatusValue},提升机流水号?{serialno06Value},提升机状态?{equipstate06Value},提升机货物到位状态?{hoisterTrayIn06Value},提升机当前楼层?{currentfloor06Value},提升机目的楼层?{targetfloor06Value},反馈流水号?{reserialno06}");
|
|
|
|
|
if (mesCloseValue != null && hoisterStatusValue != null && Convert.ToInt32(hoisterStatusValue) == 1 && Convert.ToInt32(mesCloseValue) == 0)
|
|
|
|
|
{
|
|
|
|
|
//正常读到plc值
|
|
|
|
|
if (targetfloor06Value != null && serialno06Value != null && equipstate06Value != null && currentfloor06Value != null && reserialno06 != null && hoisterTrayIn06Value != null)
|
|
|
|
|
|