private void button6_Click(object sender, EventArgs e) { timeup = 0; //wait for return signal// Myport.setcomstep(true); //reset comstep Myport.TxText("XYX" + textBoxTXdata.Text); do { Thread.Sleep(10); if (timeup == 1) { break; } } while (Myport.setcomstep() != '6'); textBoxRXtopic.Text = Myport.getRx(); Myport.TxText("XWX" + textBoxTXdata.Text); do { Thread.Sleep(10); if (timeup == 1) { break; } } while (Myport.setcomstep() != '5'); textBoxRXdata.Text = Myport.getRx(); //buttonRefresh.Text = "Refresh OK"; aTimer.Enabled = false; //disable timer }