robsoft
robsoft

Reputation: 5585

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

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.

Upvotes: 22

Views: 61347

Answers (8)

Nick Dandoulakis
Nick Dandoulakis

Reputation: 43110

I don't know if you can redirect COM ports but you can use com0com for that kind of job.

For example, you can pair (COM1, COM2), so you can write to COM1 and read from COM2.

Upvotes: -2

Timmmm
Timmmm

Reputation: 96546

Another option: Use putty and turn on logging.

Upvotes: 8

FerranB
FerranB

Reputation: 36777

Another option is through command line:

type com1: >> data.log

Upvotes: 43

Scott
Scott

Reputation: 4163

Similar to VMWare, Virtual PC (& Virtual Server) can also redirect a COM port to a text file and setup is very simple.

Upvotes: 1

Niki
Niki

Reputation: 15867

You could run the printer module in a VM. VMWare allows you to redirect serial ports to files and named pipes.

Upvotes: 2

pedrofernandes
pedrofernandes

Reputation: 16854

If you are developer use Serial Port component from .NET or if you don't are a developer and only want get information to file use windows HyperTerminal

Upvotes: -1

Dan F
Dan F

Reputation: 12052

A quick google led me to RS232 Data Logger - I haven't tried it, but if it does what it says on the tin it should be OK for you. Edit: it appears to be incoming, not outgoing. Might be worth a try though :-)

Upvotes: 6

Ahmed
Ahmed

Reputation: 7238

I think in the control pandel, printers, you can add manual printer and install dummay one So you can printing to a file for example

Upvotes: 0

Related Questions