//Puts the device into binary mode and retreives the settings. public void validateDevice(Control c) { //Save object which called this function to return focus to later. control = c; //Put console window into binary mode. aqCon.consoleToBinary(); aqCon.rbtBinary_Checked(true); //Activate rx state machine. rxState = rxStates.RX_COM_VAL; //Prepare to send 'X' to stop any running processes. byte[] bArray = new byte[8]; bArray[0] = (byte)'X'; bArray[1] = (byte)'\r'; try//Send data to device. { sp.Write(bArray, 0, 2); } catch (Exception err) { comCloser(); comErrorHandler(err.ToString()); } //Set timer to wait for next step in validation process. aqTimer.setTimer(20, timerTypes.TIMER_COM_VAL2, control); }
private void AquaSift_FormClosed(object sender, FormClosedEventArgs e) { BeginInvoke((MethodInvoker) delegate { rxState = rxStates.RX_IDLE; dTestPanel.updateTimer.Stop(); sTestPanel.updateTimer.Stop(); comCloser(); }); }