嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
通过扫码识别座椅零件是否正确
#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