views:

414

answers:

1

Hi,

I am try to read data over serial port already open.

I have used C# and c++ library for use microsoft api (overlapped and not overlapped I/O), but not work.

I can use same windows api? or other??

Thanks in advance for your availability,

Cristiano

http://bugbusters.altervista.org/index.php

A: 

I'm taking the assumption that when you want to backwards engineer the protocol of a serial port device.

As posted above, it can be tricky if the line is already open, but can be done with a couple of extra serial ports.

In order to do this you need to 2 extra serial ports installed on your machine (or a seperate PC) and a small cable to link two of the ports together.

So you have this set up

COM 1 - connected to COM 2 via a small cable (rx to tx, etc).
COM 3 - connected to the serial port device.

The software that drives the serial port device would be configured to COM 1.

A cable physically routes all traffic from COM 1 to COM 2, your software would then route all serial traffic between COM 2 and COM 3 and logging the data inbetween.

This is a useful technique if you want to backwards engineer a serial protocol for a device.

Mattl
Thans for your answer.Yes, you have right, but I want learn how to use sw for monitor serial port. I have used this tecniques:1) com0com : free project that create virtual null modem cable (I have write a little sw for filter data).2) Y cable : hardware solution that you have described in the answer.Now I want go beyond. I need to understand how to use windows api or other for monitor serial port by sw.Thanks in advance for your availability,Crishttp://bugbusters.altervista.org/index.php
Cristiano
Other than the com0com option you mention I can't really offer any further solutions, there is a discussion here that may help:http://stackoverflow.com/questions/915904/listening-to-serial-com-ports-that-are-in-use
Mattl