Files
2026-05-29 10:07:05 +08:00

59 lines
1.9 KiB
C#
Raw Permalink 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 System;
using MesServerWork;
//using SystemFramework;
namespace MesServerFunctions
{
partial class Functions_BASE_29
{
/// <summary>
/// 工件到位与离开时清空MES自身信号
/// </summary>
/// <param name="OpName"></param>
/// <param name="tagValue"></param>
private void WorkStart(object e)
{
try
{
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
string OpName = Convert.ToString(msgEvent.OpName);
int tagValue = Convert.ToInt32(msgEvent.TagValue);
if(tagValue==0)
{
MIS_BASE.Write_Match(OpName, false);//匹配结果
MIS_BASE.Write_MatchingCompleted(OpName, false);//匹配完成
}
string opName_PrimaryLine = "";
//获取总线工位号
if (MIS_BASE.hashtable_OpNameRepair == null)
{
MIS_BASE.InitHashtable_MesServerCode();
}
if (MIS_BASE.hashtable_OpNameRepair.ContainsKey(OpName))
{
opName_PrimaryLine = MIS_BASE.hashtable_OpNameRepair[OpName].ToString();
}
SendInfomation("ClearSubData", "0", opName_PrimaryLine);
sendmessage(opName_PrimaryLine, tagValue, "WorkStart_Subline");//显示分线工件到位、离开信号
}
catch(Exception err)
{
////ApplicationLog.WriteLog(err, "Function09:WorkStart");
}
}
//分线发送工件到位信号函数
private void sendmessage(string OpName, int tagValue, string Command)
{
string SendMessage = "MES|" + Command + "|" + OpName + "|" + tagValue;
AsyncSendMessage(SendMessage);
}
}
}