TYPE "UDT_MES" VERSION : 0.1 STRUCT "PLC-MES" : Struct RequestCmd : Int := 16#00; // 空闲=0;SN 过站校验=1;上传数据=2;托盘过站校验=3;产品返工=4;产品打印=5;托盘查询 SN=6;SN 查询托盘=7; Alarm : Array[1..800] of Bool := [800(FALSE)]; // PLC报警位;需要PLC填写报警文本文件 StationId : String[20] := ''; // PLC填写自己的站ID WpcNumberId : String[20] := ''; // 托盘查询和数据上传是PLC填写;SN查询托盘时MES下发, SerialNumber : String[50] := ''; // PLC执行RequestCmd=1需要填写, Status : Struct // 产品状态区;PLC上传时进行填写 Result : Byte := 16#00; // Result=0 MES综合判断;Result=1 PLC判断Passed;Result=1 PLC判断Failed; StartTime : String[20] := ''; // 从DateTime复制过来 EndTime : String[20] := ''; // 从DateTime复制过来 CT : Int := 0; // CT =0 MES综合计算;CT不等于执行PLC_CT值; END_STRUCT; ProcessData : Array[1..40] of Struct // PLC删除不带上下限的数据 id : Int := 0; // 不等于0MES执行上传 Value : Real := 0.0; END_STRUCT; LimitTest : Array[1..40] of Struct // 有判断带上下限的数据 ID : Int := 0; // 不等于0MES执行上传 Max : Real := 0.0; Min : Real := 0.0; Value : Real := 0.0; Result : Int := 16#00; // Result=0 MES综合判断;Result=1 PLC判断Passed;Result=1 PLC判断Failed; END_STRUCT; PartCode : Array[1..10] of Struct // 物料绑定时使用 ID : Int := 0; // 不等于0MES执行上传 Code : String[50] := ''; END_STRUCT; END_STRUCT; "MES-PLC" : Struct Done : Int := 16#02; // RequestCmd=0,Done=0才可以执行命令,BUSY=1,DONE=2,ERROR=3 DateTime : String[20] := ''; // MES下发,的时间,PLC使用时间变化做超时报警,同时StartTime和EndTime可以从这里获取 ErrorId : Word := 16#0000; // MES下发的错误代码,需要HMI显示,PLC下次执行命令前需要清空 ErrorMessage : String[252] := ''; // MES下发,的错误内容,需要HMI显示,PLC下次执行命令前需要清空 IsWork : Int := 16#01; // MES下发,过站检查状态, ProductStatus : String[50] := ''; // MES下发,产品的最新状态 ProductStation : String[20] := ''; // MES下发,产品的最新位置 OrderNumber : String[20] := ''; // PLC执行RequestCmd=1 或RequestCmd=3,MES下发,产品订单号。 ProductName : String[20] := ''; // PLC执行RequestCmd=1 或RequestCmd=3,MES下发,产品名称。 WpcNumberId : String[20]; // PLC执行RequestCmd=7;MES下发托盘 SerialNumber : String[50]; // PLC执行RequestCmd=6 ;MES下发SN RecipeReal : Array[1..50] of Struct id : Int; Value : Real; END_STRUCT; RecipeString : Array[1..10] of Struct id : Int; Value : String[50]; END_STRUCT; END_STRUCT; End : Byte := 16#00; END_STRUCT; END_TYPE