Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 411983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:02:26+00:00 2026-05-12T18:02:26+00:00

I have written a program in .NET that listens to a particular Serial Port

  • 0

I have written a program in .NET that listens to a particular Serial Port and processes the data that is being received. I wrote a test program using com0com (the Null-modem emulator) and my program was working fine. I even tested it with HyperTerminal and that seemed to work fine too.
However when I interfaced the software with the original device (an output received from a control system), the data received was garbled. It contained special characters. The same device when connected with Hyper Terminal produced the desired output. I changed the baud rates, parity etc but the data received was the same set of garbage characters.
I have used the DataReceived event of the SerialPort component and used the following line of code to capture data:

    string data = portRecieve.ReadExisting();

Can somebody tell me where am i missing out? In the current environment, the output from the device is directly connected with a dot matrix printer which prints whatever is received on the port. The printer seems to catch what is being sent but my code couldn’t.
If you ever encountered a similar scenario, Please share your findings.
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:02:26+00:00Added an answer on May 12, 2026 at 6:02 pm

    I can think of the following reasons why the data might apperar garbled:

    • If there is a bad physical connection, you can sometimes just get garbage (rather than nothing at all). Try unplugging and replugging the leads – and check that you have the correct lead (e.g. do you need a nullmodem?). It looks as though you have this covered by checking in HyperTerminal.

    • If the baud rate, stop bits, parity are not correct – sounds like you have this one covered

    • You are trying to receive the data as a string. If it is not sent as plain text, or if your encoding is wrong, then it could easily appear garbage-like. Try using a binary receive and examine the raw data that you are receiving. This will tell you whether the data is just wrong or the .net conversion is screwing it up – eliminate the middle man!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a simple webapp in asp net. The first time I go
I have written few test scripts using JUnit 4 and Selenium. I have added
I'm writing a serial port software for Windows. To improve performance I'm trying to
I have started to develop an application in VB.NET and I am looking at
After having written a few helper classes in magento, now i have this problem,
I am new to servlet development, and I was reading an ebook, and found
For one of my projects thats kind of a content-aggregator i'd like to introduce
I am writing a simple script on Windows PowerShell in order to evaluate performance
Please forgive me if this post is in the wrong place, but as your
This question Measure execution time... allows programmers to find good tools to evaluate execution

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.