private void SendCommand_Click(object sender, EventArgs e) { var result = KM.WaitToken(1000); if (result == KMOTION_TOKEN.KMOTION_LOCKED) { KM.WriteLineWithEcho(Command.Text); while (true) { var status = KM.CheckIsReady(); if (status == KMOTION_CHECK_READY.READY) { KM.ReleaseToken(); break; } if (status == KMOTION_CHECK_READY.TIMEOUT || status == KMOTION_CHECK_READY.ERROR) { KM.ReleaseToken(); MessageBox.Show("Response Error"); break; } Thread.Sleep(10); } } else { MessageBox.Show("Unable to Send Command to Board"); } }
private void SendCommand_Click(object sender, EventArgs e) { KM.WriteLineWithEcho(Command.Text); KM.CheckIsReady(); }