Virtual Comm Port

P

Thread Starter

Prashant Deshpande

Hello List Members

I need your help -

The problem
On Windows 95 we have an application App-A which communicates on Serial COM Port to another application App-B on the same machine. A null modem cable connects the two com ports of the machine.

Requirement
Now I want to free one COM port for some other purpose. Can I modify/redevelop App-B such that it will trap the data sent by App-A on COM port, process it & send back to App-A without using another COM port as well as without interfering the working of App-A. App-A can not be modified & it will continue to send & receive data on COM port. It is expected from App-B to provide a Virtual Com port.

Has anyone worked on such application/driver ?
Any suggestions, references would be appreciated.
What would be differences if Win NT is to be used.

Thanks in advance

Prashant Deshpande
Systems Manager
KPIT Systems Ltd.
6, Mayur Colony
Kothrud
Pune - 411 029 ( INDIA )
email : [email protected]
 
P

Phil Covington

This is possible if you were to create a VxD for Win 9x that creates two virtual COM ports (ie COM5, COM6). Data written to COM5 port would be sent to COM6 and vise versa... Numega's VtoolsD (http://www.numega.com/) makes it a lot easier to write device drivers - you might want to check them out. They also have various examples of serial drivers there too. I have had good luck with them.

Regards,

Phil Covington
 
J

Johan Bengtsson

Ok, this is not a full developed idea for an answer, but maybe something someone can develop to something useful.

Why use any COM port? A pipe, or some other logical connection would be enough. I really think it is a two or none answer anyway.

Can you use any COM port? I have heard of drivers letting you use com-ports located on other computers over the network (for modem sharing), if they can make a driver apperaring as a local comport and send it to another computer over network, they could make a driver apperaring as two local comports, virtually connected to
each other.

If the COM port is accesed directly it would be hard, but if it is accesed using the OS some kind of redirection should be possible.

I know, this doesn't help by itself, but it may give someone something to continue on.


/Johan Bengtsson

----------------------------------------
P&L, the Academy of Automation
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------
 
T

(TECO) David Bergeron

Unless someone has a very simple solution that you can implement successfully in less than an hour, I would just buy a COMM Card to get the extra com ports you need. It's not worth the trouble. You should easily be able to get a COMM card for less than $100.

David Bergeron, P.E.
TECO
504-833-6381
www.thompson-equipment.com
 
H

Hanoi Santos Hung

Prashant :
It is relatively easy to do what you want if you have the necessary tools. I suggest you Vireo's VtoolsD that comes with an example of serial port driver.I have developed with this tool a driver for a serial port that emulates a Modbus device. For WinNT is the same thing but you have to use another tool or the DDK that is great but not easy.

Ing Hanoi Santos Hung
Dpto Sistemas Digitales 3
Instituto Central de Investigacion Digital
FAX : (537) 336387
Phone : (537) 218769 ext 43
email : [email protected]
 
R
> I need your help -
>
> The problem
> On Windows 95 we have an application App-A which communicates on
> Serial COM Port to another application App-B on the same machine.
> A null modem cable connects the two com ports of the machine.
>

Connect Rx to Tx on the same port? (and DSR to DTR etc etc).

Why not use TCP/IP? That way you can send messages from one app to another very quickly (If the IP adress is the same it will be looped back at the kernel level). If you then want to switch to a remote machine, you just establish a PPP link without having to change the software.

Once a TCP/IP link is established (and it is easier than establishing a serial link), there is little difference between data streams over TCP/IP and serial comms, except that error checking and buffering is done automatically for you on TCP/IP streams.

I use TCP/IP for interprocess communications, so that they can be local or remote. It also allows me to develop modules discretely and test via telnet, and avoid multithreading headaches.

Bit like automation objects/DCOM made simple (and more portable).

> Requirement
> Now I want to free one COM port for some other purpose.
> Can I modify/redevelop App-B such that it will trap the data sent by App-A
> on COM port, process it & send back to App-A without using another COM
> port as well as without interfering the working of App-A. App-A can not be
> modified & it will continue to send &
> receive data on COM port.
> It is expected from App-B to provide a Virtual Com port.
>
> Has anyone worked on such application/driver ?
> Any suggestions, references would be appreciated.
> What would be differences if Win NT is to be used.


Drivers that rely on low level access to the ports (common under W9x, especially for multi drop protocolls etc.) will not work on NT, it does not allow low level access. It is also (almost) impossible to write drivers for NT, that is why it is so difficult to find drivers for non mainstream stuff.
 
W

Warren Postma

I have often thought of writing exactly this driver, for in-office-testing. An alternate use would be for "Modem simulation". Software which expects a modem could be tested without a modem actually being present. Ie, the two machines
could have virtual modems, and the one could dial into the other, all through simulation.

I would even like to introduce "virtual noise" ... ;-) For testing of course, not for production systems.

Warren
 
Top