Solved

USB and Delphi

Posted on 2002-03-07
5
999 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

732 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