LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Raw Bulk communication

Hi All
 
I am new to usb communication. seeing the tutorials installed the USB Raw device and every thing is fine with the hardware.
 
But when i tried to write some command to device(USB Raw Bulk communication). It shows Timeout expired before operation completed errorin VISA Write( that too, i am surprised not every time i run the vi but frequently) .
 
If say, time out error does not occur it shows Couldnot perform operation because of I/O error error in VISA Read. I didn't really understand where the problem is? How to solve it.
 
To my surprise i found the same thing happening in the VISAIC
Also How to select th Reqest typr and request in USB Raw Control  communication?
Plz suggest a solution for this.
 
Thanks
Kiran
0 Kudos
Message 1 of 19
(6,313 Views)

Is there a chance you could link in some screenshots of the errors you get, also are you trying to talk to a particular device or another machine over USB, or just write to a USB port with nothing on the other end?

Thanks,

 

Rob W

National Instruments

Application Engineer

Applications Engineer
0 Kudos
Message 2 of 19
(6,300 Views)

Hi Rob

I am trying to communicate with the pen drive(mass storage device.I tried with the pen drive connected to the  USB port. Also notice that timeout  error is in visa write.(Frequently but not every time. the same is observed in the VISAIC)

Now i am attaching the screenshot only for the timeout error because i am not able to proceed till I/O error in VISa read.

Thanks

Kiran

0 Kudos
Message 3 of 19
(6,296 Views)
I don't think you can use this sort of command with a mass storage device in RAW mode.

In order to use this type of command, your device would need to have USBTMC functionality and you would NOT use RAW mode...

Refer to the Knowledgebase: How Can I Communicate With a Device Using NI-VISA USB RAW Mode?
USB RAW mode gives you access to the low level communication mechanisms of the USB specification. Since NI-VISA just exposes the mechanisms already defined in the specification, it is assumed that the user is familiar with the USB specification and programming USB devices. NI-VISA USB RAW mode supports Interrupt, Bulk and Control data transfers. Isochronous transfers are not supported.

Additionally, communicating with a USB device using NI-VISA USB RAW support is very device specific, which requires from the user detailed knowledge of how the device operates. In this sense it is similar to register-level programming using the NI-VISA PXI support. NI-VISA provides the communication channel to the device, but the meaning of the data is device-specific.
0 Kudos
Message 4 of 19
(6,285 Views)
Thats correct, if you wish to send GPIB-type information over USB your best using USBTMC as shown on this link:
 
 
 
Regards,
 
Rob W
National Instruments
Application Engineer
Applications Engineer
0 Kudos
Message 5 of 19
(6,280 Views)
What I don't really understand is why, since this is a pen drive, you are not using the regular file copy commands. A pen drive appears to the OS as just another storage device (i.e. c:). I believe pen drive use the Mass Storage Class that is built into the OS and you would have to disable the recognition of the device as a member of this class before you can do anything else.
0 Kudos
Message 6 of 19
(6,273 Views)
Hi All
 
But i have seen the example program similar to this as USB Raw Bulk communication
 
Also In USB RawControl communication what is request type, request? how to get the values?
 
VISAIC is also showing the same errors that i have mentioned in the above message(timeout, I/O error). Why is it?
If you observe in VISAIC there are
Template i/o, basic i/o, interface i/o
In Basic I/O , there are VISA Write and VISA Read  vi's for communication and
in Interface I/O ,there are USB control in/out vis.
 
How are they different?
Can u explain the difference so that it will be helpful to me.
 
Thanks
Kiran
0 Kudos
Message 7 of 19
(6,270 Views)
The VISA examples don't mean a thing unless you know the exact details of the USB interface from the vendor and unless the device does not have an existing class and driver in the OS. Why exactly are you trying to use VISA? You don't hve to do any of that to save data to a pen drive.
0 Kudos
Message 8 of 19
(6,268 Views)
You can download the specification to the USB protocol here.

If you have no idea of the device's commands or protocol, you'll have to study this document to get things working.  Request type and Value, Index and Request are ALL device-specific.  There's no single set of commands unless your device fits a given Class (i.e. Mass Storage).  In this case there is an extended set of commands the device is guaranteed to support.

Having just gone trhough a learning process with USB RAW, I'll just say this....  It's a lot harder than Serial or GPIB.

The Bulk transfer commands are only for the Test and Measurement class of devices, which your pen drive does NOT belong to.

Why do you want to communicate on this level with the drive?  Why not use the OS driver to do a simple file write / Read?

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 9 of 19
(6,264 Views)
Double post, sorry


Message Edited by shoneill on 11-16-2007 04:01 PM
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 10 of 19
(6,262 Views)