Redirect COM port output to a file?

Discussion in 'NZ Computing' started by JohnO, Feb 16, 2010.

  1. JohnO

    JohnO Guest

    Hi All,

    Under windows (XP Pro) is it possible to link the COM1 port to a file
    to capture output set to the port? A customer site has an ancient
    label printer attached to COM1 and I want to capture the label markup
    language being sent to it. If I can redirect the port to a file I
    could just print a label, have the data go to a file and then examine
    it with a text editor.


    JohnO, Feb 16, 2010
    1. Advertisements

  2. JohnO

    JohnO Guest

    BTW: the application is not accessing the port as a printer; it is
    simply opening the serial port and sending ascii data. I cannot simply
    change the printer port from COM1 to FILE.
    JohnO, Feb 16, 2010
    1. Advertisements

  3. If you have a crossover RS-232 cable and a second COM port, just
    connect them and use some software like Putty to capture the data.
    Stephen Worthington, Feb 17, 2010
  4. JohnO

    JohnO Guest


    The top few hits all seem to allow COMx - COMy type mapping, but none
    seem to allow CCOMx - FILE mapping.

    I'm starting to think serial crossover cable and a second PC running

    COPY COM1: c:\com_capture.txt

    JohnO, Feb 17, 2010
  5. In message <b7c288fc-060a-499a-
    Is it opening it as a file name? If so, you could patch in a different file
    Lawrence D'Oliveiro, Feb 17, 2010
  6. JohnO

    JohnO Guest

    JohnO, Feb 17, 2010
  7. JohnO

    JohnO Guest

    Good idea. I could only guess so - that it is opening it as "COM1:".
    We are talking a DOS console application here.

    Administratively awkward to mess with it though - the company is
    Japanese owned and managed, the PC is in a timber mill in Gisborne and
    in production use, and "supported" by the Japs, and I don't think they
    have a backup one to play with.

    The good news is they are replacing this hokey setup - I just have to
    print identical bar-code labels from the new application and wanted to
    reverse engineer them rather than re-draft them from scratch.
    JohnO, Feb 17, 2010
  8. JohnO

    JohnO Guest

    Hi Frank.

    It would be possible to file the data if the OS provided a facility to
    do so.

    No handshake necessarily - that's configurable for hardware, x-on/x-
    off etc.
    JohnO, Feb 17, 2010
  9. Frank Williams, Feb 17, 2010
  10. JohnO

    JohnO Guest

    JohnO, Feb 17, 2010
  11. JohnO

    Brocker Guest

    Why not feed it into another PC/Laptop that has a serial port?
    Brocker, Feb 17, 2010
  12. JohnO

    Richard Guest

    What type of printer? When I had a look the dymo and brother protocols
    were well documented from reverse engeneering and there was some GPL
    code for the dymo to turn a PBM file into what the printer wanted.
    Richard, Feb 17, 2010
  13. They are bidirectional.
    Lawrence D'Oliveiro, Feb 17, 2010
  14. JohnO

    JohnO Guest

    It's a Sato and their markup language is fugly.
    JohnO, Feb 17, 2010
  15. JohnO

    JohnO Guest

    Yeah maybe. I'll have to get down to Gisborne to do this which is a
    PITA though.
    JohnO, Feb 17, 2010
  16. JohnO

    EMB Guest

    It's not that bad - I've written a lot of apps to drive them over the years.
    EMB, Feb 17, 2010

  17. Just remembered that I've used Hyperterminal to print to a file, when the
    person did not have a RS323 Printer.
    You can down load a updated version in what is installed in Windows
    Frank Williams, Feb 18, 2010
  18. JohnO

    asdjf Guest

    asdjf, Mar 1, 2010
  19. JohnO


    Dec 1, 2010
    Likes Received:
    If you need constantly capture data from the serial port, then here's a pretty good option: AGG Software's RS232 logger, because allows to start data capturing automatically and can work as a Windows service.

    helleng, Dec 1, 2010
    Alexx Green likes this.
  20. JohnO


    Feb 23, 2017
    Likes Received:
    Here is the same question on stackoverflow

    Also you can try software which allows to sniff and catch serial port data like Serial Port Monitor. It works perfect with windows
    ElenRey, May 30, 2017
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.