MVP!
This commit is contained in:
41
MisDataFunction/Function1057/OpcServer/Barcode.cs
Normal file
41
MisDataFunction/Function1057/OpcServer/Barcode.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
|
||||
//using SystemFramework;
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
///1.扫描配送单号,用于接收物料,扫描单号的时候,将接收的物料信息显示在“物料拉动”Tab区域
|
||||
///2.扫描料箱标签/看板卡,用于追溯物料批次信息
|
||||
///3.扫描零件条码,根据零件图号进行防错
|
||||
///第一步,判断条码类型,根据条码类型,执行对应的存储过程
|
||||
///第二步,条码类型(将扫描的条码保存到对应的表中)
|
||||
///第三步,扫描完成之后给出允许工作信号
|
||||
/// 处理页面扫描条码
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="barcode"></param>
|
||||
public void Barcode(object e)
|
||||
{
|
||||
|
||||
{
|
||||
try
|
||||
{
|
||||
// 自动工位不进行物料扫码
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function02:Barcode");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
40
MisDataFunction/Function1057/OpcServer/ConfirmOkGo.cs
Normal file
40
MisDataFunction/Function1057/OpcServer/ConfirmOkGo.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
//using SystemFramework;
|
||||
using MesServerWork;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 合格放行
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void ConfirmOkGo(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
|
||||
//BaseDataSystemMES.Material_Insert(OpName, 1);
|
||||
|
||||
//更新订单完工数量及物料
|
||||
// Sendmessage("24", "11", OpName);
|
||||
|
||||
//工作完成
|
||||
//MIS_BASE.Write_MesWorkFinish(OpName, true);
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function02:ConfirmOkGo");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
257
MisDataFunction/Function1057/OpcServer/EngineGetOver.cs
Normal file
257
MisDataFunction/Function1057/OpcServer/EngineGetOver.cs
Normal file
@@ -0,0 +1,257 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Windows.Forms;
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using MisDataSaveDate;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// PLC传递机型处理
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void EngineTypeGetOver_PLC(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
//判断PLC机型与MES机型是否一致
|
||||
if (tagValue == 1)
|
||||
{
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", "PLC传递机型!");
|
||||
MIS_BASE.Write_TagValueByTagTypeID(34, OpName, false); // 复位报警(MES)
|
||||
|
||||
// 1.读取来件信息,有可能来一个件 有可能同时来两个件,来空托盘不交互
|
||||
string part1;
|
||||
string part2;
|
||||
MIS_BASE.Read_TagValueByTagTypeID(203, OpName, out part1);
|
||||
MIS_BASE.Read_TagValueByTagTypeID(204, OpName, out part2);
|
||||
// 2.判断PLC工件是否写入
|
||||
if ((part2 == "" && part1 == "") || (part2 == null && part1 == null) || (part2.Length < 5 && part1.Length < 5))
|
||||
{
|
||||
//不允许工作
|
||||
MIS_BASE.Write_FixAllow(OpName, false);
|
||||
// MES报警
|
||||
MIS_BASE.Write_TagValueByTagTypeID(34, OpName, true);
|
||||
string msg = "【" + OpName + "】" + "PLC两个产品信息为空,part1:" + part1 + ",part2:" + part2;
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "EngineTypeGetOver", msg);
|
||||
return;
|
||||
}
|
||||
bool part1_IsOk = true;
|
||||
bool part2_IsOk = true;
|
||||
|
||||
// 3.记录工件的进站数据
|
||||
if (part1 != null && part1 != "" && part1.Length > 5)
|
||||
{
|
||||
// 查询是否 不允许工作
|
||||
MisDataFun.Get_NotAllowWork(part1, OpName, out bool NotAllowWork);
|
||||
if (NotAllowWork)
|
||||
{
|
||||
MIS_BASE.Write_NotAllowWork(OpName, true); // 不允许工作
|
||||
part1_IsOk = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 调用进站接口
|
||||
CallWebService.Call_miFindCustomAndSfcData(OpName, part1, out string code, out string message);
|
||||
|
||||
if (code == "0")
|
||||
{
|
||||
string msg = "进站成功:" + part1;
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MOM", msg);
|
||||
MisDataFun.OpName_MIS_MOBY_Insert_JZ(OpName, part1);
|
||||
}
|
||||
else
|
||||
{
|
||||
part1_IsOk = false;
|
||||
string msg = "进站失败:" + part1 + ",code:" + code + ",message:" + message;
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "MOM", msg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (part2 != null && part2 != "" && part2.Length > 5)
|
||||
{
|
||||
// 查询是否 不允许工作
|
||||
MisDataFun.Get_NotAllowWork(part2, OpName, out bool NotAllowWork);
|
||||
if (NotAllowWork)
|
||||
{
|
||||
MIS_BASE.Write_NotAllowWork(OpName, true); // 不允许工作
|
||||
part2_IsOk = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 调用进站接口
|
||||
CallWebService.Call_miFindCustomAndSfcData(OpName, part2, out string code, out string message);
|
||||
|
||||
if (code == "0")
|
||||
{
|
||||
string msg = "进站成功:" + part2;
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MOM", msg);
|
||||
MisDataFun.OpName_MIS_MOBY_Insert_JZ(OpName, part2);
|
||||
}
|
||||
else
|
||||
{
|
||||
part2_IsOk = false;
|
||||
string msg = "进站失败:" + part2 + ",code:" + code + ",message:" + message;
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "MOM", msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 两个件都进站成功了 才允许工作
|
||||
if(part1_IsOk && part2_IsOk)
|
||||
{
|
||||
MIS_BASE.Write_FixAllow(OpName, true); // 允许PLC工作(MES)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", "PLC传递机型取消!");
|
||||
MIS_BASE.Write_FixAllow(OpName, false); // 允许PLC拧紧工作(MES)
|
||||
MIS_BASE.Write_NotAllowWork(OpName, false); // 不允许工作
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function08:EngineTypeGetOver_PLC");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// PLC传递机型处理
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void EngineTypeGetOver_PLC_part1Ng(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
//判断PLC机型与MES机型是否一致
|
||||
if (tagValue == 1)
|
||||
{
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "EngineTypeGetOver_PLC_part1Ng", "PLC产品1Ng传递机型!");
|
||||
MIS_BASE.Write_TagValueByTagTypeID(34, OpName, false); // 复位报警(MES)
|
||||
|
||||
// 1.读取来件信息,有可能来一个件 有可能同时来两个件,来空托盘不交互
|
||||
string part1;
|
||||
MIS_BASE.Read_TagValueByTagTypeID(203, OpName, out part1);
|
||||
// 2.判断PLC工件是否写入
|
||||
if (part1 == "" || part1 == null || part1.Length < 5)
|
||||
{
|
||||
// MES报警
|
||||
MIS_BASE.Write_TagValueByTagTypeID(34, OpName, true);
|
||||
string msg = "【" + OpName + "】" + "PLC位置1产品信息为空,part1:" + part1;
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "EngineTypeGetOver_PLC_part1Ng", msg);
|
||||
return;
|
||||
}
|
||||
|
||||
// 3.记录工件的进站数据
|
||||
if (part1 != null && part1 != "" && part1.Length > 5)
|
||||
{
|
||||
string msg;
|
||||
// 查询是否 不允许工作
|
||||
MisDataFun.Get_NotAllowWork(part1, OpName, out bool NotAllowWork);
|
||||
if (NotAllowWork)
|
||||
{
|
||||
MIS_BASE.Write_NotAllowWork(OpName, true); // 不允许工作
|
||||
msg = "产品不合格,不允许工作!" + part1;
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "EngineTypeGetOver_PLC_part1Ng", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = "产品1PLC中记录不合格,但PLCS中记录合格!" + part1;
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "EngineTypeGetOver_PLC_part1Ng", msg);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "EngineTypeGetOver_PLC_part1Ng", "PLC产品1Ng传递机型取消!");
|
||||
MIS_BASE.Write_NotAllowWork(OpName, false); // 不允许工作
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function08:EngineTypeGetOver_PLC");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// PLC传递机型处理
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void EngineTypeGetOver_PLC_part2Ng(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
//判断PLC机型与MES机型是否一致
|
||||
if (tagValue == 1)
|
||||
{
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "EngineTypeGetOver_PLC_part2Ng", "PLC产品2Ng传递机型!");
|
||||
MIS_BASE.Write_TagValueByTagTypeID(34, OpName, false); // 复位报警(MES)
|
||||
|
||||
// 1.读取来件信息,有可能来一个件 有可能同时来两个件,来空托盘不交互
|
||||
string part2;
|
||||
MIS_BASE.Read_TagValueByTagTypeID(204, OpName, out part2);
|
||||
// 2.判断PLC工件是否写入
|
||||
if (part2 == "" || part2 == null || part2.Length < 5)
|
||||
{
|
||||
// MES报警
|
||||
MIS_BASE.Write_TagValueByTagTypeID(34, OpName, true);
|
||||
string msg = "【" + OpName + "】" + "PLC位置2产品信息为空,part2:" + part2;
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "EngineTypeGetOver_PLC_part2Ng", msg);
|
||||
return;
|
||||
}
|
||||
|
||||
// 3.记录工件的进站数据
|
||||
if (part2 != null && part2 != "" && part2.Length > 5)
|
||||
{
|
||||
string msg;
|
||||
// 查询是否 不允许工作
|
||||
MisDataFun.Get_NotAllowWork(part2, OpName, out bool NotAllowWork);
|
||||
if (NotAllowWork)
|
||||
{
|
||||
MIS_BASE.Write_NotAllowWork(OpName, true); // 不允许工作
|
||||
msg = "产品2不合格,不允许工作!" + part2;
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "EngineTypeGetOver_PLC_part2Ng", msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = "产品2PLC中记录不合格,但PLCS中记录合格!" + part2;
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "EngineTypeGetOver_PLC_part2Ng", msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", "PLC产品2Ng传递机型取消!");
|
||||
MIS_BASE.Write_NotAllowWork(OpName, false); // 不允许工作
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function08:EngineTypeGetOver_PLC");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
45
MisDataFunction/Function1057/OpcServer/FalseGO.cs
Normal file
45
MisDataFunction/Function1057/OpcServer/FalseGO.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml.Linq;
|
||||
//using SystemFramework;
|
||||
using MesServerWork;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 不合格放行
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void FalseGO(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
//不合格放行信号
|
||||
//MIS_BASE.Write_FalseGO(OpName, true);
|
||||
//总合格标志2(不合格)
|
||||
|
||||
// BaseDataSystemMES.Material_Insert_NG(OpName, 2);
|
||||
|
||||
// Sendmessage("24", "11", OpName);
|
||||
|
||||
//工作完成
|
||||
//MIS_BASE.Write_MesWorkFinish(OpName, true);
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function02:FalseGO");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
101
MisDataFunction/Function1057/OpcServer/GetParkCode.cs
Normal file
101
MisDataFunction/Function1057/OpcServer/GetParkCode.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Threading;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void GetPackCode1(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
string tagValue = msgEvent.TagValue.ToString();
|
||||
if (tagValue == "1")
|
||||
{
|
||||
// 1.读取来件1信息,
|
||||
string part;
|
||||
MIS_BASE.Read_TagValueByTagTypeID(10, OpName, out part);
|
||||
|
||||
MisDataFun.GetPackByXT(OpName, part, out string pack);
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "GetPackCode", "获取箱体码1对应的PACK码1:" + pack);
|
||||
if (pack != "")
|
||||
{
|
||||
MIS_BASE.Write_TagValueByTagTypeID(74, OpName, pack);
|
||||
MIS_BASE.Write_TagValueByTagTypeID(31, OpName, true);
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "GetPackCode", "PACK码1写入完成!");
|
||||
}
|
||||
else
|
||||
{
|
||||
MIS_BASE.Write_TagValueByTagTypeID(74, OpName, "");
|
||||
MIS_BASE.Write_TagValueByTagTypeID(31, OpName, true);
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "GetPackCode", "获取PACK码1错误!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MIS_BASE.Write_TagValueByTagTypeID(74, OpName, "");
|
||||
MIS_BASE.Write_TagValueByTagTypeID(31, OpName, false);
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "GetPackCode", "PLC取消获取PACK码1!");
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataFun.LogRecording_OP("Function1057", "ERROR", "GetPackCode", err.Message.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void GetPackCode2(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
string tagValue = msgEvent.TagValue.ToString();
|
||||
if (tagValue == "1")
|
||||
{
|
||||
|
||||
// 1.读取来件1信息,
|
||||
string part;
|
||||
MIS_BASE.Read_TagValueByTagTypeID(11, OpName, out part);
|
||||
|
||||
MisDataFun.GetPackByXT(OpName, part, out string pack);
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "GetPackCode", "获取箱体码2对应的PACK码2:" + pack);
|
||||
if (pack != "")
|
||||
{
|
||||
MIS_BASE.Write_TagValueByTagTypeID(75, OpName, pack);
|
||||
MIS_BASE.Write_TagValueByTagTypeID(32, OpName, true);
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "GetPackCode", "PACK码2写入完成!");
|
||||
}
|
||||
else
|
||||
{
|
||||
MIS_BASE.Write_TagValueByTagTypeID(75, OpName, "");
|
||||
MIS_BASE.Write_TagValueByTagTypeID(32, OpName, true);
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "GetPackCode", "获取PACK码2错误!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MIS_BASE.Write_TagValueByTagTypeID(75, OpName, "");
|
||||
MIS_BASE.Write_TagValueByTagTypeID(32, OpName, false);
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "GetPackCode", "PLC取消获取PACK码2!");
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataFun.LogRecording_OP("Function1057", "ERROR", "GetPackCode", err.Message.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
34
MisDataFunction/Function1057/OpcServer/HeartBeat.cs
Normal file
34
MisDataFunction/Function1057/OpcServer/HeartBeat.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using MesServerWork;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// MES与PLC心跳监听
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void HeartBeat(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
//返写在MES心跳中
|
||||
MIS_BASE.Write_TagValueByTagTypeID(15, OpName, tagValue);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function02:FalseGO");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
152
MisDataFunction/Function1057/OpcServer/MesRead.cs
Normal file
152
MisDataFunction/Function1057/OpcServer/MesRead.cs
Normal file
@@ -0,0 +1,152 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using MisDataSaveDate;
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 保存完成(针对半自动和手动压装工位)
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void MesRead(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", "MesRead", "PLC允许保存数据!");
|
||||
|
||||
// 1.读取产品的静置信息,1/2个产品的,无产品不交互
|
||||
string part1;
|
||||
string part1_setAside_time;
|
||||
string part1_setAside_isOk;
|
||||
string tagID1 = "74200001";
|
||||
string part2;
|
||||
string part2_setAside_time;
|
||||
string part2_setAside_isOk;
|
||||
string tagID2 = "74200009";
|
||||
MIS_BASE.Read_TagValueByTagTypeID(205, OpName, out part1);
|
||||
MIS_BASE.Read_TagValueByTagTypeID(17, OpName, out part1_setAside_time);
|
||||
MIS_BASE.Read_TagValueByTagTypeID(18, OpName, out part1_setAside_isOk);
|
||||
|
||||
MIS_BASE.Read_TagValueByTagTypeID(206, OpName, out part2);
|
||||
MIS_BASE.Read_TagValueByTagTypeID(201, OpName, out part2_setAside_time);
|
||||
MIS_BASE.Read_TagValueByTagTypeID(202, OpName, out part2_setAside_isOk);
|
||||
|
||||
bool part1_IsOk = true;
|
||||
bool part2_IsOk = true;
|
||||
// 2.判断PLC工件是否写入
|
||||
if ((part2 == "" && part1 == "") || (part2 == null && part1 == null) || (part2.Length < 5 && part1.Length < 5))
|
||||
{
|
||||
// MES报警
|
||||
MIS_BASE.Write_TagValueByTagTypeID(34, OpName, true);
|
||||
string msg = "【" + OpName + "】" + "PLC两个产品信息为空,part1:" + part1 + ",part2:" + part2;
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "MesRead", msg);
|
||||
return;
|
||||
}
|
||||
|
||||
// 3.保存质量数据(静置时间,静置结果) 保存过站信息
|
||||
if (part1 != null && part1 != "" && part1.Length > 5)
|
||||
{
|
||||
// 保存过站信息
|
||||
MisDataFun.WorkStartInsert_JZ(OpName, part1, Convert.ToInt32(part1_setAside_isOk));
|
||||
|
||||
// 从数据库查出质量数据组 MOM_质量数据_上传_查询
|
||||
MisDataFun.GetPartQualityGroupParams(OpName, part1, out DataTable dt_quality);
|
||||
|
||||
// 调用工厂MES出站接口
|
||||
string code;
|
||||
string message;
|
||||
if (dt_quality.Rows.Count > 0)
|
||||
{
|
||||
CallWebService.Call_dataCollectForSfcEx(OpName, part1, dt_quality, Convert.ToInt32(part1_setAside_isOk), out code, out message);
|
||||
}
|
||||
else
|
||||
{
|
||||
CallWebService.Call_sfcComplete(OpName, part1, Convert.ToInt32(part1_setAside_isOk), out code, out message);
|
||||
}
|
||||
if (code == "0")
|
||||
{
|
||||
}
|
||||
else if (code == "13921") // 质量判定不合格 走不合格放行
|
||||
{
|
||||
MIS_BASE.Write_OpNameIsOk(OpName, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
part1_IsOk = false;
|
||||
string msg = "出站失败:" + part1 + ",code:" + code + ",message:" + message;
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "MOM", msg);
|
||||
}
|
||||
|
||||
}
|
||||
if (part2 != null && part2 != "" && part2.Length > 5)
|
||||
{
|
||||
|
||||
// 保存过站信息
|
||||
MisDataFun.WorkStartInsert_JZ(OpName, part2, Convert.ToInt32(part2_setAside_isOk));
|
||||
|
||||
// 从数据库查出质量数据组 MOM_质量数据_上传_查询
|
||||
MisDataFun.GetPartQualityGroupParams(OpName, part2, out DataTable dt_quality);
|
||||
|
||||
// 调用工厂MES出站接口
|
||||
string code;
|
||||
string message;
|
||||
if (dt_quality.Rows.Count > 0)
|
||||
{
|
||||
CallWebService.Call_dataCollectForSfcEx(OpName, part2, dt_quality, Convert.ToInt32(part2_setAside_isOk), out code, out message);
|
||||
}
|
||||
else
|
||||
{
|
||||
CallWebService.Call_sfcComplete(OpName, part2, Convert.ToInt32(part2_setAside_isOk), out code, out message);
|
||||
}
|
||||
if (code == "0")
|
||||
{
|
||||
}
|
||||
else if (code == "13921") // 质量判定不合格 走不合格放行
|
||||
{
|
||||
MIS_BASE.Write_OpNameIsOk(OpName, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
part2_IsOk = false;
|
||||
string msg = "出站失败:" + part2 + ",code:" + code + ",message:" + message;
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "MOM", msg);
|
||||
}
|
||||
}
|
||||
// 都出站成功了 才给PLC信号
|
||||
if (part1_IsOk && part2_IsOk)
|
||||
{
|
||||
// 4.通知PLC,MES保存完成 MES工作完成
|
||||
MIS_BASE.Write_MesReadOver(OpName, true);
|
||||
MIS_BASE.Write_MesWorkFinish(OpName, true);
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MesRead", "MES保存数据完成!");
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MesRead", "MES工作完成!");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
MIS_BASE.Write_MesReadOver(OpName, false);
|
||||
MIS_BASE.Write_MesWorkFinish(OpName, false);
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MesRead", "PLC允许保存数据取消!");
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function08:MesReadOver");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
54
MisDataFunction/Function1057/OpcServer/MesReadOver.cs
Normal file
54
MisDataFunction/Function1057/OpcServer/MesReadOver.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
//using SystemFramework;
|
||||
using MesServerWork;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 保存完成(针对半自动和手动压装工位)
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void MesReadOver(object e)
|
||||
{
|
||||
//try
|
||||
//{
|
||||
// DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
// string OpName = Convert.ToString(msgEvent.OpName);
|
||||
// var tagValue = msgEvent.TagValue.ToString ();
|
||||
|
||||
// if (tagValue == "1" | tagValue.ToLower () == "true")
|
||||
// {
|
||||
// int qualityMask;
|
||||
// MIS_BASE.Read_QualityMask(OpName, out qualityMask);
|
||||
|
||||
// SendInfomation("ShowTimelyQuality", "1&" + qualityMask.ToString(), OpName);//发给Web页面显示质量数据
|
||||
|
||||
// if (qualityMask == 1)//全部OK,给出合格放行
|
||||
// {
|
||||
// //如果存在线外扫描工位,根据扫描条码绑定线外数据 需要时解除禁用
|
||||
// //BaseDataSystemMES.TransLaunchDataByMainMaterial(OpName, EngineType, EngineID, EngineTypeID);
|
||||
|
||||
// //如果存在线外排队工位,根据排队编号绑定线外数据 需要时解除禁用
|
||||
// ////BaseDataSystemMES.MailLineAndSubLineData_InsertByEngineID_Subline(OpName,EngineID, EngineTypeID, EngineType);
|
||||
|
||||
// MIS_BASE.Write_ConfirmOkGo(OpName, true);
|
||||
// //MIS_BASE.Write_FalseGO(OpName, false);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //MIS_BASE.Write_ConfirmOkGo(OpName, false);
|
||||
// MIS_BASE.Write_FalseGO(OpName, true);
|
||||
// }
|
||||
|
||||
// }
|
||||
//}
|
||||
//catch (Exception err)
|
||||
//{
|
||||
// ////ApplicationLog.WriteLog(err, "Function02:MesReadOver");
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
39
MisDataFunction/Function1057/OpcServer/MesSaveNowData.cs
Normal file
39
MisDataFunction/Function1057/OpcServer/MesSaveNowData.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using MesServerWork;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// MES保存实时质量数据
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void MesSaveNowData(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
// 直接发送实时的 质量数据
|
||||
string message = MisDataSaveDateMesRead.Funtion.GetRealTimeQualityData(OpName);
|
||||
//推送质量数据到MES的页面
|
||||
SendMessage.AsyncSendMessage("MES|ShowTimelyQuality_Resources|" + OpName + "|" + message);
|
||||
//SendMessageFun.SendMessageMESToWEB("ShowTimelyQuality", "1&" + qualityMask.ToString(), OpName);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function02:FalseGO");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
315
MisDataFunction/Function1057/OpcServer/WebSubmit.cs
Normal file
315
MisDataFunction/Function1057/OpcServer/WebSubmit.cs
Normal file
@@ -0,0 +1,315 @@
|
||||
using System;
|
||||
using MesServerWork;
|
||||
using System.Threading;
|
||||
using MisDataSaveDate;
|
||||
using System.Collections;
|
||||
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 处理WEB页面发送过来的请求(m_Command + "|" + m_Value;)
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="Content"></param>
|
||||
private void WebSubmit(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
string Content = Convert.ToString(msgEvent.TagValue);
|
||||
|
||||
string opName_SubLine = "";
|
||||
string engineID = "";//工件信息
|
||||
string[] dataArray = Content.Split('|');
|
||||
|
||||
if (dataArray.Length != 2)
|
||||
return;
|
||||
|
||||
|
||||
string m_Command = dataArray[0].ToString();//消息类型
|
||||
string m_Value = dataArray[1].ToString();//消息参数
|
||||
string[] m_Value_array = m_Value.Split('&');//消息参数数量
|
||||
int m_Value_length = m_Value_array.Length; //消息参数长度
|
||||
|
||||
if (MIS_BASE.hashtable_EngineGetOver_EngineTypeID == null)
|
||||
{
|
||||
MIS_BASE.InitHashtable_MesServerCode();
|
||||
}
|
||||
if (MIS_BASE.hashtable_EngineGetOver_EngineID.ContainsKey(OpName))
|
||||
{
|
||||
engineID = MIS_BASE.hashtable_EngineGetOver_EngineID[OpName].ToString();
|
||||
}
|
||||
if (MIS_BASE.hashtable_OpNameRepair == null)
|
||||
{
|
||||
MIS_BASE.InitHashtable_MesServerCode();
|
||||
}
|
||||
var _e = new DeviceDriver_BasicData.CustomeEvetnArgs();
|
||||
_e.OpName = OpName;
|
||||
_e.TagValue = m_Value;
|
||||
string msg;
|
||||
bool bolVal;
|
||||
|
||||
//根据请求的命令处理逻辑
|
||||
switch (m_Command)
|
||||
{
|
||||
case "Barcode":
|
||||
if (m_Value_length > 1) return;
|
||||
fun_Barcode(_e);
|
||||
break;
|
||||
case "ConfirmOkGo"://合格放行
|
||||
//修改托盘状态
|
||||
//BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Delete(OpName, engineID);
|
||||
MIS_BASE.Write_ConfirmOkGo(OpName, true);
|
||||
MIS_BASE.Write_FalseGO(OpName, false);
|
||||
Thread.Sleep(1000);
|
||||
MIS_BASE.Write_ConfirmOkGo(OpName, false);
|
||||
break;
|
||||
case "FalseGO"://返修放行
|
||||
//修改托盘状态
|
||||
//BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Delete(OpName, engineID);
|
||||
MIS_BASE.Write_FalseGO(OpName, true);
|
||||
MIS_BASE.Write_ConfirmOkGo(OpName, false);
|
||||
Thread.Sleep(1000);
|
||||
MIS_BASE.Write_FalseGO(OpName, false);
|
||||
break;
|
||||
case "NgGO"://不合格放行
|
||||
//修改托盘状态
|
||||
//保存不合格信息(必须保存不合格放行信息,由于B5A的Moby没有不合格标志位)
|
||||
//BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Insert(OpName, engineID, "", "");
|
||||
MIS_BASE.Write_FalseGO(OpName, true);
|
||||
MIS_BASE.Write_ConfirmOkGo(OpName, false);
|
||||
Thread.Sleep(1000);
|
||||
MIS_BASE.Write_FalseGO(OpName, false);
|
||||
break;
|
||||
case "FixAllow"://重新拧紧
|
||||
break;
|
||||
case "RepairUplineMES"://返修上线
|
||||
MIS_BASE.Write_RepairUpline_MES(OpName, true);
|
||||
break;
|
||||
case "Normal"://启用正常拧紧工位
|
||||
MIS_BASE.Write_Normal(OpName, 1);
|
||||
MIS_BASE.Write_UnNormal(OpName, 0);
|
||||
break;
|
||||
case "UnNormal"://启用备用拧紧工位
|
||||
MIS_BASE.Write_Normal(OpName, 0);
|
||||
MIS_BASE.Write_UnNormal(OpName, 1);
|
||||
break;
|
||||
case "ResetDevice"://复位设备
|
||||
MIS_BASE.Write_ResetDevice(OpName, true);
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
MIS_BASE.Write_ResetDevice(OpName, false);
|
||||
break;
|
||||
case "IsNeedRepaire"://返修上线(返修上线点)
|
||||
if (Convert.ToInt32(m_Value) == 1)
|
||||
{
|
||||
//修改托盘状态
|
||||
MIS_BASE.Write_PalletInfo(OpName, 3);
|
||||
//通知修改成功
|
||||
MIS_BASE.Write_UpdatePalletOK(OpName, true);
|
||||
IsNeedRepaire_OK(OpName);
|
||||
}
|
||||
else if (Convert.ToInt32(m_Value) == 0)
|
||||
{
|
||||
//直接给出工作完成
|
||||
MIS_BASE.Write_MesWorkFinish(OpName, true);
|
||||
}
|
||||
break;
|
||||
case "PalletGO":
|
||||
if (Convert.ToInt32(m_Value) == 1)
|
||||
{
|
||||
//直接给出工作完成
|
||||
MIS_BASE.Write_MesWorkFinish(opName_SubLine, true);
|
||||
}
|
||||
break;
|
||||
case "ContinueMatch":
|
||||
//BaseDataSystemMES.QualityVerifyStatus_Hash_Write(OpName, true);
|
||||
fun_EngineTypeGetOverPLC(_e);
|
||||
break;
|
||||
//初始化网页信号
|
||||
case "IniSingalToWeb":
|
||||
InitializeSingalToWeb(OpName);
|
||||
break;
|
||||
// 检查项 检查完成
|
||||
case "checkWorkOver":
|
||||
//MIS_BASE.Write_TagValueByTagTypeID(30, OpName,1);
|
||||
//msg = "MES|checkWorkOverIsShow|" + OpName + "|" + 0;
|
||||
//SendMessage.AsyncSendMessage(msg);
|
||||
break;
|
||||
// 重新申请上线
|
||||
case "againPartLoad":
|
||||
// 判断是否有工件到位
|
||||
MIS_BASE.Read_WorkStart(OpName, out bolVal);
|
||||
if (bolVal)
|
||||
{
|
||||
MIS_BASE.Write_TagValueByTagTypeID(35, OpName, 1);
|
||||
msg = "【" + OpName + "】" + "重新申请上线完成!";
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = "【" + OpName + "】" + "当前无工件到位信号,请确认是否存在工件!";
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
}
|
||||
break;
|
||||
// 跳过交互
|
||||
case "skipWork":
|
||||
// 判断是否有工件到位
|
||||
MIS_BASE.Read_WorkStart(OpName, out bolVal);
|
||||
if (bolVal)
|
||||
{
|
||||
MIS_BASE.Write_EngineTypeGetOver_MES(OpName, true); // 传递机型
|
||||
MIS_BASE.Write_FixAllow(OpName, true); // 允许工作
|
||||
MIS_BASE.Write_TagValueByTagTypeID(30, OpName, 1); // 检查完成
|
||||
MIS_BASE.Write_MesReadOver(OpName, true); // 保存完成
|
||||
MIS_BASE.Write_MesWorkFinish(OpName, true); // 工作完成
|
||||
msg = "【" + OpName + "】" + "跳过交互完成!";
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = "【" + OpName + "】" + "当前无工件到位信号,请确认是否存在工件!";
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
}
|
||||
break;
|
||||
case "twoWorkSkip"://重新工作工件跳过工作(重新工作工件)
|
||||
//工作完成
|
||||
EngineTypeGetOver_PLC_Work_Skip(OpName);
|
||||
break;
|
||||
case "twoWork"://重新工作工件重新工作(重新工作工件)
|
||||
//允许工作
|
||||
EngineTypeGetOver_PLC_Work_two(OpName);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function08:WebSubmit");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 网页重现登录,恢复关闭前的页面状态
|
||||
/// </summary>
|
||||
/// <param name="Opname">工位号</param>
|
||||
private void InitializeSingalToWeb(string Opname)
|
||||
{
|
||||
int EngineTypeID;
|
||||
string EngineType;
|
||||
string EngineID;
|
||||
int PartPallet_Code;
|
||||
int ProcessCode;
|
||||
bool S_FixOK;
|
||||
bool S_FixOver;
|
||||
bool S_FixAllow;//允许工作 DBX3.1
|
||||
bool S_WorkStart;//工件到位 DBX0.1
|
||||
bool S_PartLoad;//申请上线
|
||||
bool S_EngineGetOver;//传递机型 DBX0.4
|
||||
bool S_MesRead;//允许保存 DBX3.1
|
||||
bool S_ReadOver;//保存完成
|
||||
bool S_MaterialVerifyOver;//工作完成 DBX0.3
|
||||
int BoltCode;
|
||||
int workStepProperty;
|
||||
int S_QualityMask;//合格标志 DBX588
|
||||
string S_plcStatus = "false";//DBX501.5 PLC直通,1 强制放行 0 正常循环
|
||||
|
||||
//获取Moby
|
||||
MIS_BASE.GetEngineTypeFromDB(Opname, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code);
|
||||
|
||||
MIS_BASE.Read_FixAllow(Opname, out S_FixAllow);
|
||||
MIS_BASE.Read_FixOK(Opname, out S_FixOK);
|
||||
MIS_BASE.Read_FixOver(Opname, out S_FixOver);
|
||||
MIS_BASE.Read_WorkStart(Opname, out S_WorkStart);
|
||||
MIS_BASE.Read_PartLoad(Opname, out S_PartLoad);
|
||||
MIS_BASE.Read_EngineGetOver_PLC(Opname, out S_EngineGetOver);
|
||||
MIS_BASE.Read_QualityData_Read_CF(Opname, out S_MesRead);
|
||||
MIS_BASE.Read_MesReadOver(Opname, out S_ReadOver);
|
||||
MIS_BASE.Read_MaterialVerifyOver(Opname, out S_MaterialVerifyOver);
|
||||
MIS_BASE.Read_QualityMask(Opname, out S_QualityMask);
|
||||
|
||||
if (S_WorkStart == true)
|
||||
{
|
||||
SendMessageFun.SendInfomation("WorkStart", Convert.ToString(Convert.ToInt32(S_WorkStart)), Opname);
|
||||
}
|
||||
//----------------------------------------------------
|
||||
if (S_PartLoad == true)
|
||||
{
|
||||
SendMessageFun.SendInfomation("PartLoad", Convert.ToString(Convert.ToInt32(S_PartLoad)), Opname);
|
||||
}
|
||||
//----------------------------------------------------
|
||||
if (S_EngineGetOver == true)
|
||||
{
|
||||
SendMessageFun.SendInfomation("EngineTypeGetOverPLC", Convert.ToString(Convert.ToInt32(S_EngineGetOver)), Opname);
|
||||
//通知web显示
|
||||
SendMessageFun.SendMessage("5123", "1111", Opname);
|
||||
}
|
||||
//----------------------------------------------------
|
||||
if (S_FixAllow == true)
|
||||
{
|
||||
SendMessageFun.SendInfomation("FixAllow", Convert.ToString(Convert.ToInt32(S_FixAllow)), Opname);
|
||||
}
|
||||
//----------------------------------------------------
|
||||
if (S_MesRead == true)
|
||||
{
|
||||
SendMessageFun.SendInfomation("MesRead", Convert.ToString(Convert.ToInt32(S_MesRead)), Opname);
|
||||
}
|
||||
//----------------------------------------------------
|
||||
if (S_ReadOver == true)
|
||||
{
|
||||
SendMessageFun.SendInfomation("MesReadOver", Convert.ToString(Convert.ToInt32(S_ReadOver)), Opname);
|
||||
}
|
||||
//----------------------------------------------------
|
||||
if (S_MaterialVerifyOver == true)
|
||||
{
|
||||
SendMessageFun.SendInfomation("MaterialVerifyOver", Convert.ToString(Convert.ToInt32(S_MaterialVerifyOver)), Opname);
|
||||
}
|
||||
//----------------------------------------------------
|
||||
if (S_QualityMask == 1)
|
||||
{
|
||||
SendMessageFun.SendInfomation("QualityMask", Convert.ToString(Convert.ToInt32(S_QualityMask)), Opname);
|
||||
}
|
||||
//----------------------------------------------------
|
||||
if (S_plcStatus.ToLower() == "false")
|
||||
{
|
||||
SendMessageFun.SendInfomation("PlcStatus", "0", Opname);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageFun.SendInfomation("PlcStatus", "1", Opname);
|
||||
}
|
||||
//----------------------------------------------------
|
||||
if (S_FixAllow == true)
|
||||
{
|
||||
SendMessageFun.SendInfomation("FixAllow", Convert.ToString(Convert.ToInt32(S_FixAllow)), Opname);
|
||||
}
|
||||
//----------------------------------------------------
|
||||
if (S_FixOK == true)
|
||||
{
|
||||
SendMessageFun.SendInfomation("FixOK", Convert.ToString(Convert.ToInt32(S_FixOK)), Opname);
|
||||
}
|
||||
//----------------------------------------------------
|
||||
if (S_FixOver == true)
|
||||
{
|
||||
SendMessageFun.SendInfomation("FixOver", Convert.ToString(Convert.ToInt32(S_FixOver)), Opname);
|
||||
}
|
||||
// 报警信息
|
||||
InitAlarm(Opname);
|
||||
}
|
||||
private void InitAlarm(string Opname)
|
||||
{
|
||||
FuntionMesRead.Alarm_InitAlarm_Send(Opname, out Hashtable ht);
|
||||
foreach (DictionaryEntry kv in ht)
|
||||
{
|
||||
var TagID = kv.Key.ToString();
|
||||
var TagValue = kv.Value.ToString();
|
||||
FuntionMesRead.Send_AlarmMsg(TagID, TagValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
44
MisDataFunction/Function1057/OpcServer/WorkIsOk.cs
Normal file
44
MisDataFunction/Function1057/OpcServer/WorkIsOk.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using MesServerWork;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 工位合格标志
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void IsOk(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
int qualityMask;
|
||||
MIS_BASE.Read_QualityMask(OpName, out qualityMask);
|
||||
//判断是否合格
|
||||
if (qualityMask == 1)
|
||||
{
|
||||
qualityMask = 1;
|
||||
} else {
|
||||
qualityMask = 0;
|
||||
}
|
||||
//通知WEB修改状态
|
||||
string message = "MES|QualityMask|" + OpName + "|" + qualityMask.ToString();
|
||||
SendMessage.AsyncSendMessage(message);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function02:FalseGO");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
57
MisDataFunction/Function1057/OpcServer/WorkStart.cs
Normal file
57
MisDataFunction/Function1057/OpcServer/WorkStart.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
using System;
|
||||
using System.Threading;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 工件到位与离开时,清空MES自身信号
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void WorkStart(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
string tagValue = msgEvent.TagValue.ToString();
|
||||
|
||||
if (tagValue == "1")
|
||||
{
|
||||
string msg = "工件到位!";
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", msg);
|
||||
MisDataFun.MOBY_TrayStart_Update(OpName); // 记录托盘到达时间
|
||||
}
|
||||
else
|
||||
{
|
||||
string msg = "工件离开!";
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", msg);
|
||||
// 清除工位数据
|
||||
MIS_BASE.Write_EngineTypeGetOver_MES(OpName, false); // 传递机型(MES)
|
||||
MIS_BASE.Write_MesWorkFinish(OpName, false); // 工作完成(MES)
|
||||
MIS_BASE.Write_FalseGO(OpName, false); // 不合格放行(MES)
|
||||
MIS_BASE.Write_ConfirmOkGo(OpName, false); // 合格放行(MES)
|
||||
MIS_BASE.Write_FixAllow(OpName, false); // 允许PLC拧紧工作(MES)
|
||||
MIS_BASE.Write_ProcessCode(OpName, 0); // 拧紧序号(MES)
|
||||
MIS_BASE.Write_BoltCode(OpName, 0); // 套筒号(MES)
|
||||
MIS_BASE.Write_MesReadOver(OpName, false); // MES保存完数据(MES)
|
||||
MIS_BASE.Write_EngineTypeID_MES(OpName, 0); // 机型标志(MES)
|
||||
MIS_BASE.Write_EngineID_MES(OpName, ""); // 工件编号(MES)
|
||||
MIS_BASE.Write_EngineType_MES(OpName, ""); // 产品型号(MES)
|
||||
MIS_BASE.Write_OrderForm_MES(OpName, ""); // 订单号(MES)
|
||||
MIS_BASE.Write_MesErrorType(OpName, 0); // MES报警点
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
MisDataFun.LogRecording_OP("Function1051", "INFO", "WorkStart", err.Message.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
BIN
MisDataFunction/Function1057/OpcServer/vssver2.scc
Normal file
BIN
MisDataFunction/Function1057/OpcServer/vssver2.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user