static public (bool boolIsGood, Exception exc) SendReceiveData2(byte[] byteArryData) { string strMethodName = MethodBase.GetCurrentMethod().Name; string strPathName = strLog + "\\" + strMethodName + ".txt"; byte[] inbyte = { 0 }; // log("outgoing: " + BitConverter.ToString(byteArryData), strPathName); bool boolIsGood = true; Exception ee = null; try { SerialObj.Encoding = Encoding.UTF8; SerialObj.DiscardNull = false; if (SerialObj.IsOpen == false) { SerialObj.Open(); } { SerialObj.Write(byteArryData, 0, byteArryData.Length); } SerialObj.RtsEnable = false; CommTimer tmrComm = new CommTimer(); tmrComm.Start(20000); SerialObj.DiscardOutBuffer(); }//try catch (Exception exc) { ee = exc; strPathName = strLog + "\\" + strMethodName + ".txt"; log(exc.Message, strPathName); Console.WriteLine(exc); boolIsGood = false; } return(boolIsGood, ee); }
private void btnReset_MouseDown(object sender, MouseEventArgs e) { lockedOut = false; CommTimer.Start(); }