Author Topic: Program to act like HyperTerminal in C#????  (Read 23098 times)

GlennP

  • Frequent Contributor
  • ****
  • Posts: 141
Program to act like HyperTerminal in C#????
« on: June 30, 2010, 09:24:16 am »
In the course of Work (mutter, mutter) I have come across an oddity I wrote a C# program to communicate via the serial ports which worked fine until a few weeks ago.  Some of our boards will now not work with my program so have gone back to try to emmulate HyperTerm which will do the job I have managed to get the out put to appear in real time as it is typed with a Rx Tx short (no click send button for text to be sent as a string) but the board sees the data (a flashing LED will indicate that data is being recieved) but the 12 Volt relay is not switched the input routine I am using is :

 private void rtbOutgoing_KeyPress(object sender, KeyPressEventArgs e)
{
   if (e.KeyChar == (char)13) // enter key
    {     
              myComPort.Write("\r\n");
             Thread.Sleep(200);
             tmrPollForRecievedData.Enabled = true;
             rtbOutgoing.Text = "";
    }    else if (e.KeyChar < 32 || e.KeyChar > 126)
    { 
      e.Handled = true; // ignores anything else outside printable ASCII range 
      }    else 
    {   
      myComPort.Write(e.KeyChar.ToString());
   }
  }
This appears to do every thing but the intended to the board I don't want to point fingers and cause my self to look like an idiot if there is a fault at my endbut will this act like Hyper Term?

Glenn

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Program to act like HyperTerminal in C#????
« Reply #1 on: June 30, 2010, 05:44:47 pm »
I've replied to this in the Serial Ports section of this forum.

Jan