05-15-2008 09:55 AM
05-15-2008 10:19 AM
There is, imho, no such thing as a simple USB device. For example, the USB mouse will automatically install itself using the windows HID driver so that it can be used as a mouse and creating a VISA driver for it will be be fairly futile unless you get rid of the windows driver and that would not be a good thing. I don't know what you mean by a USB Key.
When a USB device is used that does not use one of the existing classes, you could create a VISA driver and use that instead of the driver that the vendor provides. You would however, need to get from the vendor a lot of details on the USB RAW communication protocol that they are using. This is difficult at times and every vendor is free to choose a slightly different protocol. The only time I've used USB RAW is when the USB device was something developed in house and I had all of the info I needed.
To get really experienced, you might want to see about getting a USB development kit where you have full control of the firmware at the USB side.
05-15-2008 10:45 AM
Thanks for your quick answer.
1. When I write "usb key", I mean a USB storage device (sorry for my english !).
2. Could you give me some examples of informations I have to get from vendor (I can ask him) :
Protocol ? Packets (block, interrupt, control...) ?
Is there any international standard to ask and get data from usb device ?
In other words, what does look like a request to a vendor to develop an application with his USB device ?
3. Once again, my application is quite complex and I will have to get a detailled document on the device (it is a sensor) I want to integrate in Labview. But for the time being, I was looking for a quite simple example where I could plug a device and ask him for serial number, vendor ID, and so on... Just to have a practical view of the USB coding. Looking at the forum and internet, I am afraid it is utopic !
Thanks a lot anyway.
Regards.
Jérémy
05-15-2008 11:34 AM
No, there is no international standard in order to get/receive data from a USB device. That's exactly the problem. How the vendor implements a USB serial adapter could be completely different than implementing a USB storage device.
You would need to ask the vendor about the data transfer mechanism - i.e. bulk or control pipe. Bulk is probably the simplest since you can just use a VISA Write or VISA Read so you would need a list of the commands to send and how the received data is formatted. This is what I used and since we wrote the firmware for the USB device, it was fairly simple. Look at the shipping example called USB - RAW Control to see how much information you need to read/write with this mechanism. If you got this to work, you would still need information on how to translate the control buffer data. I've never had to formally request this but you misght want to search the forum for posts regarding USB RAW to see if you can find more information.
If you are getting a commercial sensor, then it is very likely that they have a dll available that can be integrated into multiple programming environments. In most cases, this is a much better solution than trying to develop your own VISA driver.