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

  • Home
  • SEARCH
  • 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 7828667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:25:56+00:00 2026-06-02T10:25:56+00:00

Can the Windows COM port be used by two programs running on the same

  • 0

Can the Windows COM port be used by two programs running on the same PC for inter process communication? Our ultimate goal is to write a program which communicates over COM port to control a hardware. Since the hardware is not available we want to emulate the hardware in a program which reads from a virtual COM port and responds.

A trivial emulator would be a program which waits for bytes to be read from the COM port and responds by writing on to the COM port. To start with the values of these messages can be hardcoded.

So what I do is I have two programs written in C/C++ using the ReadFile, WriteFile functions given by windows to read and write over the file. This approach will not work because of access conflict. Hence I was wondering if our approach for the emulator itself is wrong.

I am new to Windows based programming though I have programming experience in other areas. Any help would be greatly appreciated.

Update:

Solution:

  • Installed Virtual Serial Port Driver 7.1 by Eltima Software (trial version)
  • Added a pair of virtual ports (e.g. COM1 and COM2)
  • The controller program communicates through COM1
  • The emulator program communicates through COM2
  • Eltima software takes care of transferring the data between the two ports
  • 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-06-02T10:25:58+00:00Added an answer on June 2, 2026 at 10:25 am

    You can open a file with sharing parameters that allow both of the processes to read/write to it. But that’s not a good solution, because reading/writing serial port has a number of differences with reading and writing to a file.

    Instead I recommend to get a virtual COM port driver (like com0com.sourceforge.net, or select another from here en.wikipedia.org/wiki/COM_port_redirector). Install it, create two COM ports and connect them virtually. That way you will be sure that your program will work on real COM port too.

    If that solution is not acceptable look into using pipes rather than a file

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

Sidebar

Related Questions

On Windows I can do CreateProcess(..., CREATE_NEW_CONSOLE, ...) and my child process (which is
Does anybody know how to change the COM port number that Windows maps to
I have a Windows Service that monitors a COM port connected to a vendors
How can one communicate with a device via a COM port with C++? Is
Can anyone recommend any good Com port monitor tools, like Portmon, which also work
Is there a way I can create Windows firewall exceptions in VB2005? I'm trying
I know on client side (javascript) you can use windows.location.hash but could not find
Looking for an open source web testing tool that can do Windows Authentication. I've
Can you use windows hooks or other methods to do code injection with c#?
On Windows I can do: HANDLE hProcess = GetCurrentProcess(); FILETIME ftCreation, ftExit, ftKernel, ftUser;

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.