views:

71

answers:

4

I have written a program in C# that sends text to COMx.

I wish to test it using HyperTerminal, meaning I want to read the text that I send with my program. When I set the WAIT FOR CALL in HyperTerminal, my program is refused access to the given port.

How can I test my program? Is it possible?

A: 

Your best bet would probably be to put a null-modem DB9 cable from COM1 to COM2 and use COM2 to talk to COM1.

EricLaw -MSFT-
He would need a null-modem cable, not a pass-through cable.
Gabe
+1  A: 

The best answer I can give is that the serial port is locked by your program and hence HyperTerminal cannot access the port as it is in use by your program. The best thing is to use a null modem cable loopback device in which you can send data and it will get looped back, like what EricLaw suggests.

Hope this helps, Best regards, Tom.

tommieb75
+1  A: 

tommieb75 and EricLaw's answers are both right. When an application opens a serial port, the port is opened exclusively and no other app can work with it.

In order to test my serial applications I always use com0com. You can create a pair of virtual linked serial ports and setup your app to write to one of them and the HyperTerminal to listen to the other one.

This tool has helped me countless times. I strongly recommend it.

JAG
A: 

Take your serial cable and solder in on your RX or TX side of the COM port. Now, connect this to another COM port on your PC. Tada - now you can monitor what you are sending or receiving on this port by listening in on the other. Don't terminate TX on this other COM port so you don't disturb this connection. I have a couple of these cables in the office for this very purpose. I don't trust Serial Port monitoring software.

0A0D
this instruction sounds like it's missing a couple words?
Tetsujin no Oni