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 6703041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:07:30+00:00 2026-05-26T07:07:30+00:00

The operating system I am working with is Windows 7. I am needing to

  • 0

The operating system I am working with is Windows 7. I am needing to grab data at certain intervals from a broadband card. This car sends data to two separate COM ports. COM 3 and COM 4. Every interval I will need to query the line of info on both serial ports and write them to a file.

How do I read from two COM ports? Do I have to use threading? Is it good practice opening both at the same time?

  • 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-26T07:07:30+00:00Added an answer on May 26, 2026 at 7:07 am

    Take a look at this tutorial. If you open up the com port and then make a call to WaitComEvent in overlapped IO you’ll get a handle in the OVERLAPPED that can be used in WaitForMultipleObjects.

    You should be able to do it in a single thread with the general outline below:

    HANDLE hSerial3;
    hSerial3 = CreateFile("COM3",
        GENERIC_READ | GENERIC_WRITE,
        0,0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
    //...
    WaitCommEvent(hSerial3, &dwEventMask, &ov3);
    WaitCommEvent(hSerial4, &dwEventMask, &ov4);
    //pack ov.hEvent into arHandler
    WaitForMultipleObjects (3,arHandles,FALSE,INFINITE);
    

    Heavily edited due to feedback from @JimRhodes

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

Sidebar

Related Questions

Operating System: OSX Method: From the command line, so using sed, cut, gawk, although
What operating system and UI toolkit is this? It's not some fake Hollywood user
I just upgraded my operating system to Windows 7. Visual Studio 2008 also seems
In windows operating system, the stack memory is a thread-specific storage, and the call
Which Operating System would you recommend when working with Visual Studio 2008 and it's
AFAIK, the working paradigm of Windows Performance Counter is like this: When various programs
I want to check if Windows operating system's version is Windows 2008 or Above.
This might be in vain, as I know writing an operating system is unbearably
I am working in a java application. It is desktop application for Windows Operating
I have deployed my application on IIS 7.5 on windows server 2008 operating system

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.