in reply to USB module

I'm not sure there is really a simple Perl answer. However so that you appreciate what's going on, a little background may help.

USB devices use device drivers which are accessed either by using CreateFile to open file handles - if you know the nasty "filename" for the device (enumerating USB devices to get their "file names" is a bit exciting BTW), or hook themselves into various parts of the system depending on the sort of device that they are (mice, sound devices, disk drives ...).

So if the device you wish to access looks like a disk drive, treat it just like a disk drive. If it is something "special" then you will need a special answer. If you wish to post a little more information about the type of device and how you want to use it, I may be able to help further.


Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^2: USB module
by boblikeperl (Novice) on Sep 22, 2005 at 16:20 UTC
    The device I need to talk to from a WinXp is not any of the usual devices. It is a special piece of equipment that uses a USB interface. I was wondering how to use PERL to open a connection to a USB device. This device connects to a USB HUB that connects to my PC. Think of this device as a piece of TEST EQUIPMENT with a USB interface. In TelNet I would do use Net::Telnet(); $t = new Net::Telnet (Host = "XXX.XXX.XXX", port = "yyyy"); $t->open(HOST); $t=cmd(String => "This is a test");

      USB just does not work like that. When the usb device is connected a device driver is loaded for the device. If the device is a HID (Human Interface Device) like a mouse, the operating system provides the driver. If the device is vendor specific the manufacturer of the device provides the device driver. The device driver presents some sort of software interface to applications. The interface presented depends very much on the nature of the device.

      The device that you describe sounds like it has an ethernet port on it and acts as an IP device. That has nothing at all to do with it possibly having a USB port, except that it may present itself as a class of USB device that looks to the system as an IP device. If that is the case the your Telnet technique would still work. If not, then you have to find out a lot more about the vendor specific interface that is provided, and then have some serious work to do to access that from Perl.


      Perl is Huffman encoded by design.
        Let me try it this way: I have a winxp computer (usb) connected to a usb hub. Several of the same type of USB devices are connected to the hub. I want to send/receive messages from the device on port 2 of the hub. How do I open that port for read/write? Is it with the IO module/methods?