Working with an unknown serial port device

I have a telephone switch that is plugged into a serial port. This switch is very simple: it has 3 telephone plugs, one for the phone line, one for phone 1 and one for phone 2. It also has a serial port and a power cable. By sending info on this serial port, the switch changes from phone 1 to phone 2. It only allows one phone to use the line at a time.

The problem is that I dont know what info I must send into the serial port to make it switch the phone lines. There are only 2 wires connected to the serial cable:

x  x  o  o  o
 o  o  o  o

The x's are the connected wires (pins 4 and 5 I guess).

Any ideas on how to make this device work? I work with delphi on windows xp.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

which telephone..???
provide info regarding model/make of the device and we can try to find info about it...
no points in shooting in dark...
give whatever information u can find on the switch...any numbers, name, fine prints...
acerolaAuthor Commented:
As stated in the title, it is an UNKNOWN serial port device. No model, brand or anything. I really must guess how it works.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

If this is indeed a port for serial communication, you seem to have only the TX and RX lines in it. Common lead will be in the cable shield, probably.

Any communication with this device will have to be using XOn/XOff (control character flow control).

It is also possible, that the device will only accept incoming info, and doesn't send any, one of the pins will be signal ground. Or the other way around... The pins you mention to be in use are not what would be standard signal pins for either a DTE or a DCE device.

Sometimes, DB9 connectors were used for other purposes than serial communication; this may just be a rather clumsy headset connector or something.

Can you open it and find any kind of info on whatever circui board is inside?

If this device is Plug'n'Play try to identify it by Vendor / product numbers. But your device is external(not P'n'P), so try to search by chip names used on the board of device.

If the pins you identified are truly pins 4 and 5, then all it is doing is reacting to a logic level. The Data Terminal Ready line is a discrete line that is either logic hi (5 vdc) or logic lo (<1.8 vdc). All it takes to command the device is to raise pin 4 to +5 Vdc and leave pin 5 grounded (the return) to switch it to phone 2. Apply 5 vdc to pin 4 and the phone device will switch to line 2. This has to be a simple device. I presume phone 1 is the default line and thus if you did not connect anything up to the phone line mux device, it would default to line 1.

acerolaAuthor Commented:

You got it right. It is a logical device and I also guess it is responding to DTR state. The device is supposed to be connected to the serial port of a computer, so how do I send the +5 and 1.8 vdc through the serial port, to make it work? What I need is a piece of software to work the serial port in that way.

I forgot to tell how it is inside: it has a very small chip, with only 3 connectors on each side, a capacitor, a resistor and something that looks like a transistor. It also has a big thing that I guess it is a relay where the phone lines are connected. The device looks home-made. It was assembled by my client's former software company, so I must make my software compatible with this device, or loose the client :(

I presume you are a programmer and are programming in Delphi. When you want to send a command to access line 2, you would issue the command from you application to send a Data Ready command for the RS-232 port the device is connected to.

Are you familiar with RS-232 ports and how to command them? I am sure that there are applications/code for you to glean that information from on any of the Delphi support sites.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
acerolaAuthor Commented:
Oops, my bad. After all the problem was a defective power cable. I tried making a simple program just to open the port and set the DTR state. It didn't work yesterday, when I posted this question, but it worked today after I replaced the power cable. ;)

Points for you George, sice you guessed how the device works. Thanks all.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.