找传奇、传世资源到传世资源站!

汽车座椅装配条码防错

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

通过扫码识别座椅零件是否正确汽车座椅装配条码防错 常用C#方法-第1张
#region 串口声明        //声明该委托对象        UpdateTextEventHandler updateText;        SerialPort sPort = new SerialPort();        #endregion         #region 串口显示赋值        public void spReceive_DataReceived(object Sender, EventArgs e)        {            System.Threading.Thread.Sleep(100);            byte[] readBuffer = new byte[sPort.ReadBufferSize];            sPort.Read(readBuffer, 0, readBuffer.Length);            this.Invoke(updateText, new string[] { Encoding.ASCII.GetString(readBuffer) });             //string readString = sPort.ReadExisting();            //this.Invoke(updateText, new string[] { readString});        }        private void UpdateTextBox(string text)        {            try            {                string[] str1 = File.ReadAllLines("ProductNo.txt", Encoding.UTF8);                if (DateTime.Now.ToString("dd") == str1[0])                {                    productNo = int.Parse(str1[1]);                }                else                {                    productNo = 1;                }            }            catch            {            }             tBoxBarCode.Text = text;            if (text == "#############")            {               opc.WriteOPCItemString(opc.kepGroup, "MES.PLC.BarCode", "#############");                //MessageBox.Show("写入#已执行");            }            string str ="";//这里设置字符串a的值            if (text.IndexOf("'")==1)            {                str=text.Remove(0, 1);            }            else            {                str = text;            }            if (text.IndexOf("'")==text.Length)            {                str=str.Remove(text.Length,1);            }                       ////新修改的防错使用不使用苗提出            //if(opc.ReadOPC("MES.PLC.ErrorProofingUseSelect")=="True")            //{                //比较条码                ltextCompareResult.Text =mainClass.JudgePuductNo(ref dtVehicle, dGViewProduct, "ProductNo", text, ref pageNo);                if (pageNo != 1)                {                   mainClass.OpenPdfFile(axAcroPDF, @"D:\OperationInstruction", pageNo);                }                            }        #endregion

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复