MVP!
This commit is contained in:
67
MisDataFunction/Function1052/OpcServer/Barcode.cs
Normal file
67
MisDataFunction/Function1052/OpcServer/Barcode.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
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)
|
||||
{
|
||||
|
||||
{
|
||||
var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
string barcode = Convert.ToString(msgEvent.TagValue);
|
||||
try
|
||||
{
|
||||
// 自动工位不进行物料扫码
|
||||
// 但是150工位需要扫模组码进行二次校验~
|
||||
// 读取PLC中的信息
|
||||
int EngineTypeID;//机型代码
|
||||
string EngineType;//机型
|
||||
string EngineID;//工件编号
|
||||
string OrderForm; // 工单号
|
||||
int PartPallet_Code;//托盘编号
|
||||
bool PartLoad_EngineGetOver_PLC;
|
||||
|
||||
MIS_BASE.GetEngineTypeFromPLC(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out OrderForm);
|
||||
// PDC产线plc只写了发动机号和机型代码,其余要从数据库中读取
|
||||
MisDataFun.Moby_Select_PDC(EngineID, out OrderForm, out EngineType, out int EngineTypeID2);
|
||||
if (!MisDataBaseFun.CheckMesApiIsOk(OpName, EngineID, "miFindCustomAndSfcData")) return; // 验证入站接口是否成功!
|
||||
|
||||
// 验证托盘码
|
||||
int ScanPalletCodeStatu = MisDataBaseFun.ScanPalletCode(OpName, barcode, EngineID);
|
||||
if (ScanPalletCodeStatu != 2)
|
||||
{
|
||||
// 走传递机型的流程
|
||||
// 机型信息写入数据库
|
||||
MisDataFun.OpName_MIS_MOBY_Insert(OpName, EngineTypeID, EngineType, EngineID, PartPallet_Code, OrderForm, 0, 0, "");
|
||||
EngineTypeGetOver_PLC_Work(OpName, EngineTypeID, EngineType, EngineID, PartPallet_Code, OrderForm);
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function02:Barcode");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user