COM port emulation

Associate
Joined
1 Aug 2003
Posts
1,053
I am working with a piece of software which connects to a serial

Rather than using a RS232 device I want to use a piece of USB hardware. So that the software plays ball I want to create a virtual COM port and provide automatic responses to certain calls and possibly play around or pass on other commands.

Currently the software makes sure that there is a COM port to talk to thusly (data retrieved by sniffing the port)

Port opened by process "A2Dsoft.exe" (PID: 2100)

24 0D $.

Port closed


Simple enough, there just needs to be something to receive the command, no response necessary, then the software starts. When switching to capture mode the following happens

Port opened by process "A2Dsoft.exe" (PID: 2100)

24 01 $.

Answer: 20/02/2008 17:57:52.71164 (+0.6406 seconds)

24 02 $.


Fine - it asks a question (presumably, 'hey, you there?) and wants a response. I'd just need my virtual COM port to respond in that way. Next the software says a few things (as far as I can tell just interogatory commands making sure it's okay/online etc). Then at some point sends data, there seems to be a few second 'window' in which it will accept data before it reissues a data request and another 'window' of opportunity to recieve data occurs - there are reasons for this which I wont go into.

My question boils down to... I have a USB device that sends and receives data but not (as far as I know) via the COM port route. I want to write something that will act as a COM port then talk to the USB device's driver or simply issue a standard response depending on the message received - possibly doing a bit of translation too if the response from the USB device differs hugely from the serial device. Does this sound very complicated or merely mildly difficult? Where would I look for literature on how to do this or am I in way over my head and should just ask Linus Torvalds for his help??
 
Last edited:
Um what about using a USB to rs232 converter?

The original device for the software was RS232 but I want to use a new and different device that is USB native. I'm trying to create a virtual COM port that will pass information between the software (which expects to find an RS232 device) and the USB device which will have its own drivers/interface.

I'm not sure what to write it in yet as I've never tried to create anything quite like this before. I understand the theory of creating a virtual COM port but have not done so before.

It is possible to buy off the shelf software that will create a virtual RS232 COM port and pass it through to a USB device but I think I need to write it myself as I need to put in some translation and command interfacing for the software that the hardware just simply wont understand.
 
Last edited:
Back
Top Bottom