Files
16-Xikai-MesProjectNew/MisDataFunction/Function1054/OpcServer/AllowAGVEnter.cs
2026-05-29 09:34:04 +08:00

51 lines
1.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using MesServerWork;
using MisDataFunDll;
using System;
namespace MesServerFunctions
{
partial class FunctionMES
{
/// <summary>
/// 允许AGV进入
/// </summary>
/// <param name="e"></param>
private void AllowAGVEnter(object e)
{
try
{
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
string OpName = Convert.ToString(msgEvent.OpName);
int tagValue = Convert.ToInt32(msgEvent.TagValue);
if (tagValue == 1)
{
string msg;
// PLC允许AGV离开信号被置位后应调用AGV允许进入接口
MIS_BASE.Read_EngineID(OpName, out string EngineID);
bool isOk = MisDataSaveDate.AGV_BusinessLogic.PassAgvInOut(OpName, EngineID, "apply");
if (isOk)
{
msg = $"【{OpName}】允许AGV进入成功!";
}
else
{
msg = $"【{OpName}】允许AGV进入失败请注意";
}
SendMessage.AsyncSendMessage_Notice(OpName, msg);
MyLog4Net.MyLogHelper.Info("AllowAGVLeave", msg);
}
else
{
MisDataFun.Location_MIS_MOBY_Insert(OpName, "AllowAGVEnter", "0");
}
}
catch (Exception err)
{
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(System.Reflection.MethodBase.GetCurrentMethod().Name, e, "Fun1054", err);
}
}
}
}