PDA

View Full Version : Using 2 modems same task


djfeldman
Oct 9, 2007, 02:43 PM
I need to connect 2 modems at the same time to the same task.

For those who are going to ask, I need to debug the communication between two other computers. To do this I need to eavesdrop on their communication: routing each byte from one modem to the other while logging all bytes from both modems to a file. Additionally, I can't add more than 100-200ms to the communications in either direction.

Ideally, I'd like to answer one modem and then dial the other, but it might not matter which modem is connected first.

I'm using a windows XP pro machine with one modem straight into a serial port and the other on the serial port of a usb to serial converter. I've had a problem with the usb port on COM6, it seems to conflict with something, so I moved it to a different usb port and it's now on COM7. That's the hardware I have.

I've tried using the MSCOMM control from VB6 in both c# in .net and, when that didn't work, also on VB6.

In .net I couldn't get either modem to respond at all.

In VB6 I could get only the first modem to respond. Whichever was second didn't. If I dialed first I couldn't answer. If I answered first I couldn't dial. It doesn't matter which modem I used for which purpose.

I'm wondering if the problem is that MSCOMM control isn't reentrant. If so I can't use MSCOMM.

Is there some way to do this? A different language (hopefully, one I can download for free)? A different hardware configuration, I have other computers available, would 2 computers work?

Any ideas would be appreciated.

KISS
Oct 9, 2007, 09:20 PM
There are programs that can eavesdrop at the operating system level. One such program is here: Serial Port Monitor - Port Monitor Software, RS232 analyzer captures and monitors COM Ports (http://www.eltima.com/products/serial-port-monitor/)

If you want to do it another way, just use a null modem connector and connect to rx and gnd of the Tx portion of each of the serial links.

djfeldman
Oct 10, 2007, 06:45 AM
Unfortunately, I don't have access to one of the computers and the other doesn't have a conventional OS (it's an automotive diagnostic tool without a real OS, just one program, one thread,. ).

Even if I had OS access, that wouldn't help. One of the symptoms we have is that some of the bytes seem delayed in the communications stream. We need to see if the delays are in the sending modem, the receiving modem or some other place.

KISS
Oct 10, 2007, 07:11 AM
Then the second suggestion should work.

Remember there is:
Hardware flow control (CTS/RTS)
Hardware flow control (DTR/DSR) - not the way it should be done
And messed up versions of the two.

Software flow control
and
Hardware flow control that causes a software flow control to occur (^S/^Q)

In order to see the control characters, you need a "terminal" that has a "show all mode"

Some systems use resume on ^Q only, others resume on any character

Modems can implement all the required signals: DTR/DSR, CTS/RTS, TX/RX, Gnd, Protective ground and RI correctly and allow the full range of signal input -25 to -3 to +3 to +25.

The original standard was not followed by many manufacturers. Some only use +-5 volt signals and these can be very troublesome. Check out bb-elec.com for many options. Something like this can prove very useful at times. 232 Repeaters (http://www.bb-elec.com/product_family.asp?FamilyId=13&Trail=2&TrailType=Top)

djfeldman
Oct 10, 2007, 07:40 AM
I don't know how to use this information to write or find a program that talks to the modems. I am an experienced programmer, but this simple task seems beyond my ability.

If I rewrite MSCOMM I should be able to make it reentrant. What does MSCOMM do? Why is it required for VB6 and .net modem communication?