?
Solved

USB and Delphi

Posted on 2002-03-07
5
Medium Priority
?
1,004 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 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