Reading serial port from command line.


  1. Posts : 3
    Windows 7 Professional 64 bit
       #1

    Reading serial port from command line.


    Is there a way to read a line of data from the serial port from DOS/NT COMMAND. The only method I've found mentioned in my web searches is the "TYPE" command. But I've not been able to make it work. If I enter "type com1", it seems to begin reading the port, but no matter what control characters I send along with the data, nothing prints to the screen until the buffer is completely full, (I'm guessing...in any case, I have to send a bunch of data before it prints to the screen). And even when it does return data to the screen, it never exits back to the command prompt...just keeps reading the port. Am I missing some parameters or switches? Or is there a better command to use for this?
      My Computer


  2. Posts : 7,380
    Windows 7 ultimate x64
       #2

    Hi,

    Welcome to SF. Read this article..Might be of some help.

    https://batchloaf.wordpress.com/2013...rt-in-windows/
      My Computer


  3. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #3

    Hi 777subob,

    With little searching I have come across this Stackoverflow question and in the question the person uses the copy command to capture output from a serial port. So there is another method, though I don't think using copy will be any better of an option.

    Note: COPY COM1 CON is the same as TYPE COM1

    When done capturing data, to stop the copy/type command from endlessly attempting to receive further output from the serial port, the device on the over end should send a Ctrl Z control character. (It's Unicode codepoint integer value being 26.) This stops either command from running and returns to the interactive prompt. You can manually press Ctrl Z.


    No parameter or switch is missing. There are no built-in/'better' commands readily available that address this task; there is no easy way to read data from a serial port via the command prompt.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 21:04.
Find Us