Solved

USB and Delphi

Posted on 2002-03-07
5
993 Views
Last Modified: 2012-06-27
Okay, I have been trying for the past few days to get a non USB compliant bar code scanner to work through a USB port. The problem is that I have no idea how to actually access the port. I have been able (thanks to Robert Marquardt's code for his HIDController class), been able to catch the plug/unplug events and pull off a GUID, although I doubt that this GUID is valid. Bottom line: does anyone have any idea how I can read and write to the USB as I would a serial port? Any pointers/codes samples are greatly appreciated. I'm willing to increase the points for a  working solution.

thanks!!
0
Comment
Question by:DrDelphi
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6847990
There is no way to connect a non-USB device to the USB port.
USB is a full serial bus with a complicated data protocol. it is not a serial line (RS232).
To connect a device to USB it needs a microcontroller which speaks the USB protocol.

There are several USB devices which act as converters like USB <-> RS232 bridges. They normally implement a virtual COM port on the Windows side and have a RS232 plug on the device side.

BTW i just agreed to write a text for the german Delphi magazine "Toolbox". I will write about my HID component. So a final version of this component is near at last.
0
 
LVL 6

Author Comment

by:DrDelphi
ID: 6848326
Robert,
  Cool beans! Listen, this virtual com port you mention, how would one access that? And could I read and write from that as I would an actual port? (createfile, etc,...).


Danke!
0
 
LVL 5

Expert Comment

by:Gwena
ID: 6848998
http://www.lvr.com/

Jan Axelson has a nice book about USB interfacing... lots of good links on her page too :-)
0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 100 total points
ID: 6849607
Best have a look at http://www.usb.org/forums/developers/webboard.html
That is the place whee USB developers meet.

Yes, a virtual COM port should work like a real one.
After all most modems are connected through such a virtual COM port.
I personally do not understand much of such drivers.
0
 
LVL 6

Author Comment

by:DrDelphi
ID: 6851437
Robert,
  I have actually solved my problem. Turns out that my "virtual" port was not configured correctly. I played around with it a little the other day and now I am good. I am giving you the points for this question because your component's source was pretty helpful (even if not exactly what I needed).


-Dave
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now