Exemplo n.º 1
0
        private void OutInfo()
        {
            string    sql = string.Format(@"SELECT OutTem,OutTime FROM [dbo.tb_RnuInfo] ");
            DataTable dt  = SqlServerHelp.DtQuery(sql).Tables[0];

            string[] timeList = new string[]
            {
                OutAndInInfoHelp.time1,
                OutAndInInfoHelp.time2,
                OutAndInInfoHelp.time3,
                OutAndInInfoHelp.time4,
                OutAndInInfoHelp.time5,
                OutAndInInfoHelp.time6,
                OutAndInInfoHelp.time7,
                OutAndInInfoHelp.time8,
            };
            for (int i = 0; i < timeList.Length; i++)
            {
                timeList[i] = dt.Rows[i]["OutTem"].ToString();
            }
            while (true)
            {
                OutAndInInfoHelp.StopTimeAddress();//完成时,调用接口

                Thread.Sleep(5000);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// WebService接口参数配置:高温静置收数(每次循环提交给MES)
        /// </summary>
        /// <param name="str">小车内所有的托盘号</param>
        /// <param name="processLot">小车条码号</param>
        /// <param name="door">炉门</param>
        /// <param name="Info">出站状态(10=已经入站运行,15=已经出站一个小车,20=已经出站两个小车,)</param>
        /// <param name="resource">设备资源号</param>
        /// <param name="time">运行的时间</param>
        /// <param name="wd">监控温度</param>
        public static miDataCollectForProcessLotForEachResponse ReceiveNumber(List <string> str, string processLot, string door, string Info, string resource, string time, string wd)
        {                            //  sfcArray数组
            dataCollectSfcParametricData dataCollData = new dataCollectSfcParametricData();

            dataCollectSfcParametricData[] DATA = new dataCollectSfcParametricData[] { dataCollData };

            //出站数组
            nonConfirmCodeArray ncc = new nonConfirmCodeArray();

            nonConfirmCodeArray[] nonAdd = new nonConfirmCodeArray[] { ncc };


            //ParametricDataArray库位号数组
            ND.ChargeNumber.machineIntegrationParametricData mach = new ND.ChargeNumber.machineIntegrationParametricData();

            //ParametricDataArray托盘号数组
            ND.ChargeNumber.machineIntegrationParametricData machPallet = new ND.ChargeNumber.machineIntegrationParametricData();

            //ParametricDataArray时间数组
            //  ND.ChargeNumber.machineIntegrationParametricData machTime = new ND.ChargeNumber.machineIntegrationParametricData();

            //ParametricDataArray时间数组
            ND.ChargeNumber.machineIntegrationParametricData SJ = new ND.ChargeNumber.machineIntegrationParametricData();
            ND.ChargeNumber.machineIntegrationParametricData WD = new ND.ChargeNumber.machineIntegrationParametricData();

            //数组

            dataCollectSfcParametricData sfcData = new dataCollectSfcParametricData();


            ND.ChargeNumber.machineIntegrationParametricData[] jo = new ND.ChargeNumber.machineIntegrationParametricData[] { mach, machPallet, SJ, WD };


            miDataCollectForProcessLotForEachResponse receive = new miDataCollectForProcessLotForEachResponse();//返回数据接收

            try
            {
                MiDataCollectForProcessLotForEachServiceService MiDa     = new MiDataCollectForProcessLotForEachServiceService();
                dataCollectForProcessLotForEachRequest          dataColl = new dataCollectForProcessLotForEachRequest();

                miDataCollectForProcessLotForEach mh = new miDataCollectForProcessLotForEach();

                for (int i = 0; i < str.Count; i++)
                {
                    MiDa.Url     = ConfigureHelp.hargeNumberMES_WSDL;//"http://ndmesd003.ATLbattery.com:50000/atlmeswebservice/MiDataCollectForProcessLotForEachServiceService";
                    MiDa.Timeout = ConfigureHelp.hargeNumberTimeOut;

                    MiDa.Credentials = new System.Net.NetworkCredential(ConfigureHelp.hargeNumberUser, ConfigureHelp.hargeNumberPassword, null); //Baiduhai7     //验证信息



                    dataColl.site           = ConfigureHelp.hargeNumberSite;        //ConfigureHelp.hargeNumberOperation;//站点
                    dataColl.processLot     = processLot;                           //"PL0205005";//托盘号(小车)
                    dataColl.operation      = ConfigureHelp.hargeNumberOperation;   //"HSTDY1";//工位
                    dataColl.resource       = resource;                             //"HTSX0001";//设备资源号
                    dataColl.modeProcessSfc = ModeProcessSfc.MODE_PASS_SFC_POST_DC; //过站模式


                    dataCollData.sfc             = str[i];
                    dataCollData.dcGroup         = ConfigureHelp.hargeNumberDcGroup;         //"*";//dc采集组
                    dataCollData.dcGroupRevision = ConfigureHelp.hargeNumberDcGroupRevision; // "#";//dc采集组版号
                    // dataCollData.parametricDataArray

                    //数组
                    dataColl.sfcArray = DATA;


                    //出站数组
                    // 上传异常信息
                    ncc.hasNc  = true;
                    ncc.ncCode = "success";//上传异常信息

                    mach.name     = "HSTDBYSTATION";
                    mach.dataType = ND.ChargeNumber.ParameterDataType.TEXT;
                    mach.value    = resource;// "HTSX0001";//高温静置库位号


                    machPallet.name     = "HSTDBYTRAYID";
                    machPallet.dataType = ND.ChargeNumber.ParameterDataType.TEXT;
                    machPallet.value    = processLot;//"PL0205005";//高温静置托盘号



                    //machTime.name = "HSTDBYTIME";
                    //machTime.dataType = ND.ChargeNumber.ParameterDataType.NUMBER;
                    //machTime.value = time;//"30000";//高温静置时间



                    SJ.name     = "STADCAPTIM";
                    SJ.dataType = ND.ChargeNumber.ParameterDataType.NUMBER;
                    SJ.value    = time;

                    WD.name     = "STATEM";
                    WD.dataType = ND.ChargeNumber.ParameterDataType.NUMBER;
                    WD.value    = wd;//



                    //给定两个数组
                    // dataCollData.ncCodeArray = nonAdd;//ncCodeArray  数组
                    dataCollData.parametricDataArray = jo;

                    DateTime beginTime = DateTime.Now;
                    DateTime endTime   = DateTime.Now;
                    TimeSpan timeS     = new TimeSpan();
                    timeS = endTime - beginTime;
                    mh.DataCollectForProcessLotForEachRequest = dataColl;


                    receive = MiDa.miDataCollectForProcessLotForEach(mh);


                    //上传给接口信息保存(出站info)
                    ConfigureHelp.SaveInfoToCSVFileAtLog(beginTime.ToString("yyyy-MM-dd hh:mm:ss"), endTime.ToString("yyyy-MM-dd hh:mm:ss"), timeS.TotalMilliseconds.ToString(),
                                                         string.Format("开始时间代码Error [EndTime]( sfc(条码):{0}、HSTDBYSTATION(库位号)数组:{1}、 HSTDBYTRAYID(托盘号)数组{2} 、 STADCAPTIM(时间)数组:{3}、STATEM(温度)数组:{4})",
                                                                       str[i], resource, processLot, time, wd),
                                                         null + "", null, 3);

                    if ([email protected] == 0)//不等于0时挑出记录
                    {
                        //写结束CSV文件
                        ConfigureHelp.SaveInfoToCSVFileAtLog(beginTime.ToString("yyyy-MM-dd hh:mm:ss"), endTime.ToString("yyyy-MM-dd hh:mm:ss"), timeS.TotalMilliseconds.ToString(),
                                                             string.Format("开始时间代码Error [EndTime]({0}、{1}、{2}、{3})", processLot, time, wd, resource),
                                                             [email protected] + "", [email protected], 2);
                    }
                    else
                    {
                        if ([email protected] > 0)
                        {
                            string str1 = "";
                            foreach (var item in [email protected])//遍历数组
                            {
                                str1 = item.errorMessage;
                            }
                            //写错误CSV文件
                            ConfigureHelp.SaveInfoToCSVFileAtLog(beginTime.ToString("yyyy-MM-dd hh:mm:ss"), endTime.ToString("yyyy-MM-dd hh:mm:ss"), timeS.TotalMilliseconds.ToString(),
                                                                 string.Format("开始时间代码Error [EndTime]({0}、{1}、{2}、{3})", processLot, time, wd, resource),
                                                                 [email protected] + "", str1, 2);
                        }
                    }
                }
                OutAndInInfoHelp.PlcEndTime(Info, door);//出了几个小车写入数据库
            }
            catch (Exception ex)
            {
                ConfigureHelp.SaveInfoToCSVFile(processLot, door.ToString(), resource, ex.Message);     //有错误发生写入日志
            }
            return(receive);
        }