locked
Share serial port between two programs on Windows CE 6.0 RRS feed

  • Question

  • Hi, Friends:

    I am working on a project based on Windows CE 6.0. One C++ application is using a serial port to communicate with an user via RS232 connection. And now I have to use the same serial port in another C# application to print out messages to the user. So here is the question. Can the same serial port be shared between two programs on Windows CE 6.0?



    Thanks,
    Michael 


    Sunday, March 24, 2019 6:41 PM

Answers

  • Yes, but you will need to do some work.  The driver will only allow one open at a time, so you will need to do one of the following (or figure out another option):

    1.  Write a Application, service or driver that allows multiple opens and manages the communications between the serial port and your two applications.
    2. Assuming that your apps only uses the port for output, you could use a mutex and then open, write, close the port every time that you need to write to it.

    Bruce Eitman
    Senior Enginer
    Bruce.Eitman AT Synopsys DOT com
    My BLOG http://geekswithblogs.net/bruceeitman
    I work for
    Synopsys


    • Edited by Bruce Eitman Monday, March 25, 2019 7:16 PM Added application to the options in #1
    • Marked as answer by mxz9102 Tuesday, March 26, 2019 5:17 AM
    Monday, March 25, 2019 12:52 PM

All replies

  • Yes, but you will need to do some work.  The driver will only allow one open at a time, so you will need to do one of the following (or figure out another option):

    1.  Write a Application, service or driver that allows multiple opens and manages the communications between the serial port and your two applications.
    2. Assuming that your apps only uses the port for output, you could use a mutex and then open, write, close the port every time that you need to write to it.

    Bruce Eitman
    Senior Enginer
    Bruce.Eitman AT Synopsys DOT com
    My BLOG http://geekswithblogs.net/bruceeitman
    I work for
    Synopsys


    • Edited by Bruce Eitman Monday, March 25, 2019 7:16 PM Added application to the options in #1
    • Marked as answer by mxz9102 Tuesday, March 26, 2019 5:17 AM
    Monday, March 25, 2019 12:52 PM
  • Hi, Bruce:

    Thank you very much for your answers.

    Michael

    Tuesday, March 26, 2019 5:17 AM