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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read & Write to USB Port - anyone done it?

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
0
0
GB
I need to find information on how to read and write to a USB port, can anyone point me in a direction as I haven't a clue where to start. Found info on serial port comms but not USB yet.

Using D7 btw.

Many thanks in advance
Lou.
 
Hi Lucie, OK pin back your ears..

Two ways that I know of :- First thing though is that USB is not really an external serial port as such so you cannot just hook up to it you need some sort of Driver.

The method I have used success fully (so far) involves installation of a Virtual Com port. This will show up in device manager as a serial coms port, you can then Read and write to it using a Com port component like TCommportdriver (there are several of these)

We needed to connect to external devices with USB interface chips made by a company called FTDI. Their website has a lot of stuff on general USB com ports. They supply a driver that creates the virtual comport.


They also supply what they call a 'direct driver', this is a Delphi module that hooks into the USB at low level so you don't need the Virtual comm port, but as with the Virtual comports it only works with their devices.

I have also used a USB to serial converter dongle thing again the user must install the driver supplied.

The reason for this is because all USB things have a pair of ID codes (and a load of other protocol related stuff) that the puter must know before communication can start.

Now you might say when I plug in a Flash dongle it just works (you will see a driver installation message).
This is because all USB things are divided into groups depending on their functionality, some can get away with generic windows USB driver, but the firmware must be able to kick it off so to speak.

So it also depends (a lot) on what it is you want to communicate with). Have a look at FTDI's web site lots of clues and they are Delphi compliant.







Steve: N.M.N.F.
If something is popular, it must be wrong: Mark Twain
 
Wow, thanks Steve! We're looking to communicate with a modem, send Pager messages and ring people up when servers etc go pear shaped.

It sounds pretty hefty to get something working but it's something juicy to get my teeth in to. So, where do I start? Do we need to get a modem in place first so I know the make etc and find out a USB driver or Dll for it?

Excuse me if I'm asking stupid questions.

Thanks again,
Lou
 
If its a Modular thing (rather than a Box) then it almost certainly does come with some sort of Communications drivers. Or the company that makes it can supply them.

At least I hope so because I have a project coming up that needs to do almost exactly the same thing! (No servers though) Is it anything to do with Taxis?

A lot of more complex stuff (like modems) will almost certainly have a FTDI chip in it, might be worthwhile finding out if it does.

Steve: N.M.N.F.
If something is popular, it must be wrong: Mark Twain
 
Will do, thanks again, Steve. Watch this space as I will no doubt need a bit more guidance with this stuff! :O)
 
No offense but it seems archaic that someone would choose dialing a pager with a modem in this decade when there are already ways to send an IM to a cell phone.

Roo
Delphi Rules!
 
Archaic or not thats two of us being asked to do it.
I suspect the reason has a lot to do with licensing and learning curves, i.e costs.

My application will use a proprietary module at the receiving end (that somone else is developing), not a phone or a pager, but all I need to know is the Modem codes.


Steve: N.M.N.F.
If something is popular, it must be wrong: Mark Twain
 
I was afraid of offending... My comment was not directed to the two of you, but more to the person(s) requesting it.

I did a lot of development for modem/serial/device communications (and even IEEE-388) back in the late 80's to early 90's, hence my interest in this thread. I quite appreciated your reply regarding USB.

Back then, modems came supplied with thick manuals which included the command set. You should have no problem finding them on the net.

Roo
Delphi Rules!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top