Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I redirect Windows COM port output to a file?

Tags:

Is there a simple way of redirecting serial port output to a file, that I can put into place on a test Windows desktop system without changing any code?

I'm trying to debug a problem in a serial receipt printer module and I don't have the real device handy today. I don't want to start making any changes to the code if I can help it, I just want to capture what is currently being output at the moment so that I can review it in a file.

It's Windows XP, if that makes any difference.

like image 326
robsoft Avatar asked Jun 27 '09 12:06

robsoft


People also ask

How do I redirect output to a file?

To redirect the output of a command to a file, type the command, specify the > or the >> operator, and then provide the path to a file you want to the output redirected to. For example, the ls command lists the files and folders in the current directory.

How do I redirect a file in Windows?

Right-click a folder that you want to redirect (for example, Documents), and then select Properties. In the Properties dialog box, from the Setting box, select Basic - Redirect everyone's folder to the same location.

How do I output to a file in command prompt?

Right-click the top result and select the Run as administrator option. Type the following command to save the output to a text file and press Enter: YOUR-COMMAND | Out-File -FilePath C:\PATH\TO\FOLDER\OUTPUT. txt.

How do I pipe a command to a text file?

To redirect the output of a command to a text file instead of printing it to the screen in the command window, we simply need to execute the command and append it with the “>” angle bracket symbol—called, appropriately enough, a redirection.


2 Answers

Another option is through command line:

type com1: >> data.log
like image 180
FerranB Avatar answered Sep 20 '22 11:09

FerranB


Another option: Use putty and turn on logging.

like image 20
Timmmm Avatar answered Sep 18 '22 11:09

Timmmm