Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Monitor activity of com port

Status
Not open for further replies.

Canadianweasel

IS-IT--Management
Apr 9, 2001
42
CA
I'll set the scenerio for you here...

I have some software which, among other things, is used to control gate access. What will happen is that a membership card holder will scan their card, and if it is valid, send a signal (a string of characters) to the com port where a small piece of hardware will close the circuit to open a access gate.

The hardware I have gets its power from the com port itself. When it receives a string of characters, it will close the circuit and open the gate.

If tested using something such as Hyperterminal or an echo command from a DOS prompt, the box recieves the signals and closes the circuit. Fair enough, that works perfectly well.

The software that is to be actually used doesn't do this, when it opens the com port it does so without supplying power to the port itself, thereby making the hardware fail to do its thing. If I attach a modem with its own power supply, I notice the the software will send characters to the modem, so I know the software is actually outputting to this com port.

So, herein lies the question. I need to either A> physically supply power to that com port (which I don't have the capability to accomplish), or B> set the software up so that it sends its characters to a com port, and based on that a written VB program will see these characters, open and output to another com port while supplying the power. (A regular com port open)

I attempted to open the com port before the software takes over, but it sees that as an open com port. I echo to the com port, that opens it fine, close the dos window it remains open. Start the program, it closes the com port on me.


I truly hope that explanation makes sense. Basically taking the output of one com port (without conflicting with the software that has it open) and redirecting it to another com port on the same machine.

Thanks.
 
I just want to make sure I understand your question correctly. The software that is suppose to so the communication is a third party app and you would like to develope an app that works as a sort of trap or sits between the third party app and the device? Is that correct? Anything is possible, the problem is I only have one lifetime.
[cheers]
 
That is essentially correct, yes. It doesn't have to output to the same com port designation though.
 
How complex is the third party app? Why not just write your own app to control the device? You could use the third party software maybe, but it would most likely get ugly. A couple of solutions:

1. Add 2 more Com Ports in the machine, loop the third party output into your apps added input port, read and manipulate the data, write the new data out your apps added output port.

2. Do some digging into some API calls and hope you can get control of the third partys app and try to manipulate it.

3. Try number 2 with C++

Any feed back? Anything is possible, the problem is I only have one lifetime.
[cheers]
 
I was trying to do this without adding more hardware to the system, and the only think I know about C++ is how to spell it.

I know it's possible to do this because I've actually managed to do it with something called SerialGhost. Well, at least I came close. Unfortunately, SerialGhost decides it wants to cause GPFs when using it.

They also have a product for virtual serial ports, which will direct traffic to one another.

Do the modem "light" programs operate along the same lines? Where do they get the activity indication from?

 
That is not true, apparently you also know that C++ is a programming language as well. [upsidedown] Can I ask who manufactures the device and what model it is. I will do some digging and see if I can come up with a way to trap the communication app. How in depth is the communication app? You stated that the device gets its power from the com port and that you could not do that, why not? I guess what I am driving at here is that it would be much easier to write an app than trying to trap another app if it is not overly complicated (logging, passwords etc etc). Virtual ports and the modem "light" programs use some real hardcore C/C++ to get there job done. Anything is possible, the problem is I only have one lifetime.
[cheers]
 
The story basically goes as follows.

Software we use to monitor people who have memberships to one of our facilities takes care of most everything. The computer in question is hooked up to several devices, including a card scanner. A member will scan their card, the software will then check the database and pull up their record and decide whether or not the card is valid. If the card is valid, it should activate a gate (or the device to activate the gate).

They (the software people) supplied us with a hardware solution, but no instructions on how to use it, and despite my best efforts I couldn't get it to work. I called them and was told they didn't support the hardware part of things. From there, I had someone build they devices to control the opening of the access gate based on a signal from the software. Unbeknownest to me, the software does not turn on any power to the com port from which the devices derives its power.

Due to its database interface and interface with the rest of the program, I cannot rewrite the software.

This leaves me with few solutions

1> Use an external power supply to power the device, if I knew how to connect it up...I'm waiting for word on how to do this.

2> Check to see when the software sends a signal to the com port. When a signal is sent to a com port (Since it doesn't detect a device, it doesn't care what com port it sends it to) then another piece of software should hopefully send to the actual com port which the device is on.

The signal basically consists of any character sent to the com port, any sort of activity.
 
OK, I see where you are going now. Let me do some digging and see what I can come up with. Anything is possible, the problem is I only have one lifetime.
[cheers]
 
An update :

I was able to, finally, add an external power source to the device in question. The system now works.


Although I have gone a different route, I do very much appreciate the help given. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top