Read from USB port

General discussion forum about all databases other than SqlBase.
gigit
Italy
Posts: 17
Joined: 14 Jun 2017, 15:04
Location: Italy

Read from USB port

Post by gigit » 06 Oct 2017, 09:16

Hi to all.
I need to communicate with devices connected through USB ports. I can communicate through COM ports, through TCPports but USB ports seems to be unreachables with TD. I tried to use USB ports as files and open for read with SalFileOpen and so on, without success. Any hint? Even using a third party tool should be a good thing.
Many thanks.

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 400
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: Read from USB port

Post by Dave Rabelink » 06 Oct 2017, 09:36

Do you have a small sample source you are working on which shows what you already tried to make USB reading possible?
The 'usual' way to communicate with an USB device is to call 'CreateFile()' to obtain a handle to the USB driver and send commands using 'DeviceIoControl()' (see e.g. http://www.delcom-eng.com/downloads/USBPRGMNL.pdf) - the rest is specific to the device that you want to communicate with.
treat the port as file
do create file() readfile() write file() it will work....
So, if SAL functions fail, it could be that using WinAPI file functions must be used to get it working.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

gigit
Italy
Posts: 17
Joined: 14 Jun 2017, 15:04
Location: Italy

Re: Read from USB port

Post by gigit » 17 Oct 2017, 14:27

Hi Dave, thank you.
But anyone has nevere tried to use USB ports for input with Gupta (and Centura and Gupta and Unify and Gupta and OpenText and ...)?
I wonder.
:o

Return to “General Discussion”

Who is online

Users browsing this forum: Ccbot [Crawler] and 0 guests