同步现场最新程序
This commit is contained in:
44
MisDataFunction/Function1062/OpcServer/PartLoad.cs
Normal file
44
MisDataFunction/Function1062/OpcServer/PartLoad.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// OP431 申请上线:只记录 PLC 申请状态,等待 PAD 扫描已有产品。
|
||||
/// </summary>
|
||||
private void PartLoad(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string opName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
MisDataFun.LogRecording_OP(opName, "INFO", "MIS", "PLC申请上线,等待PAD扫描已有产品!");
|
||||
MIS_BASE.Write_TagValueByTagTypeID(34, opName, false);
|
||||
SendMessage.AsyncSendMessage_Notice(opName, "【" + opName + "】PLC已申请上线,请PAD扫描产品码");
|
||||
// PAD 页面可能未打开,申请上线状态由 PadScanQuery 当前读取后返回。
|
||||
SendMessageFun.SendInfomation("PartLoad", "1", opName);
|
||||
return;
|
||||
}
|
||||
|
||||
MisDataFun.LogRecording_OP(opName, "INFO", "MIS", "PLC申请上线取消!");
|
||||
MIS_BASE.Write_EngineTypeGetOver_MES(opName, false);
|
||||
MIS_BASE.Write_FixAllow(opName, false);
|
||||
MIS_BASE.Write_TagValueByTagTypeID(34, opName, false);
|
||||
// 不向 OP431PAD 发送实时取消消息,避免 PAD 依赖可能丢失的 MQTT 状态。
|
||||
SendMessageFun.SendInfomation("PartLoad", "0", opName);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MyLog4Net.MyLogHelper.Error("Function1062.PartLoad", err.Message);
|
||||
MisDataFun.LogRecording_OP(ManualStaticOutOpName, "ERROR", "PartLoad", err.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user