public void Init() { try { this.Com.BaudRate = 9600; this.Com.Parity = Parity.None; this.Com.DataBits = 8; this.Com.StopBits = StopBits.One; this.Com.Open(); exit = false; start = false; readBarcode = ""; yaSuoJi = new cStandarBoard(Com, 1, 400); fengJi = new cStandarBoard(Com, 2, 400); thRead = new Thread(new ThreadStart(Flush)); thRead.IsBackground = true; thRead.Start(); } catch (Exception e) { Error = e.Message; } }
public bool mWbGonglvInit = false; //PLC初始化结果 /// <summary> /// WbGonglv1构造构造函数 /// </summary> /// <param name="mComPort">操作WbGonglv的串口</param> /// <param name="mAddress">WbGonglv的地址</param> /// <param name="mCurBase">电流互感比,一般为6</param> public cWbGonglv(SerialPort mComPort, byte mAddress, double mCurBase) { mStandarBoard = new cStandarBoard(mComPort, mAddress, timeOut); comPort = mComPort; WbGonglvAddress = mAddress; curBase = mCurBase; }