Solved

USB and Delphi

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi with SQL Natvie Client 15 87
Delphi XE2 application frozen on Windows 10 10 278
How to call a form that is in a DLL  from an application? 13 65
Printing problem 2 81
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
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…

863 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