Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How can I monitor data on a serial port opened by another application?

How can I monitor data on a serial port opened by another application?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IamJimW
    wrote on last edited by
    #1

    Using visual C++, can I monitor data on a serial port opened by another application? I have an application that recieves data from a comm port. I want to write a program to idependently monitor the data that is recieved on this port, and (depending on the data) write it to a file. I don't have source to the application. Is it possible to transparently view the data on a comm port like this? I've tried using CreateFile() to get access to the port, but I get a "port in use" error. Any help appreciated. Thanks Jim

    G R 2 Replies Last reply
    0
    • I IamJimW

      Using visual C++, can I monitor data on a serial port opened by another application? I have an application that recieves data from a comm port. I want to write a program to idependently monitor the data that is recieved on this port, and (depending on the data) write it to a file. I don't have source to the application. Is it possible to transparently view the data on a comm port like this? I've tried using CreateFile() to get access to the port, but I get a "port in use" error. Any help appreciated. Thanks Jim

      G Offline
      G Offline
      Gary R Wheeler
      wrote on last edited by
      #2

      IamJimW wrote: I've tried using CreateFile() to get access to the port, but I get a "port in use" error As far as I know, there's no way to do this. It's possible a replacement serial port driver could support something like this. It's probably easier to use a 'breakout' program on another PC, listening to the RS-232 traffic via a 'Y' cable. Take a look at this[^], for example.


      Software Zen: delete this;

      1 Reply Last reply
      0
      • I IamJimW

        Using visual C++, can I monitor data on a serial port opened by another application? I have an application that recieves data from a comm port. I want to write a program to idependently monitor the data that is recieved on this port, and (depending on the data) write it to a file. I don't have source to the application. Is it possible to transparently view the data on a comm port like this? I've tried using CreateFile() to get access to the port, but I get a "port in use" error. Any help appreciated. Thanks Jim

        R Offline
        R Offline
        rmnowick
        wrote on last edited by
        #3

        Jim, I don't know how to do this from Visual C++, but I believe that it can be done. A product that I purchased not too long ago does just that. It is called "Advanced Serial Port Monitor" and is available from here: http://www.aggsoft.com/products/supercom/ I believe they also offer a software development kit that might be just what you need. The product is great too. Robert

        H 1 Reply Last reply
        0
        • R rmnowick

          Jim, I don't know how to do this from Visual C++, but I believe that it can be done. A product that I purchased not too long ago does just that. It is called "Advanced Serial Port Monitor" and is available from here: http://www.aggsoft.com/products/supercom/ I believe they also offer a software development kit that might be just what you need. The product is great too. Robert

          H Offline
          H Offline
          Harold Bamford
          wrote on last edited by
          #4

          Check out PortMon at sysinternals.com I don't think they give away the source, but they do talk in detail about inserting a driver to intercept such stuff. That is probably what you need. Or you could brute-force it by reading the window displayed by PortMon. But that sure would be ugly! Good luck!

          I 1 Reply Last reply
          0
          • H Harold Bamford

            Check out PortMon at sysinternals.com I don't think they give away the source, but they do talk in detail about inserting a driver to intercept such stuff. That is probably what you need. Or you could brute-force it by reading the window displayed by PortMon. But that sure would be ugly! Good luck!

            I Offline
            I Offline
            IamJimW
            wrote on last edited by
            #5

            Thanks everyone for your help. It looks like a too-hard in VC++. The solution looks to be one of the programs around that redirect the com port to an IP address, or use a cable splitter. Jim

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups