What is the Difference Between USB Raw Control and USB Raw Bulk?
Primary Software: Driver Software>>NI-VISA
Primary Software Version: 1.1
Primary Software Fixed Version: N/A
Secondary Software: N/A
Problem: I have a third party USB Raw device that has been configured to use VISA commands through the Driver Development Wizard. I've looked for example codes in working with the device, and found one that mentions USB Raw Control and the other USB Raw Bulk. What is the difference between the two and which one should I use for my application?
Solution: USB has four defined types of communication with its attached device, Control, Bulk, Isochronous and Interrupt. Each with a specific purpose and application:
- Control Transfer is mainly used for sending commands or receiving status with your device. It is normally used with setting up the device, and the typical packet length is 8 for low speed and 8,16, 32 or 64 for high speed. The data that is passed in this type is separated into three packets.
- Packet 1-Setup, this is were the request is sent out to the target device in the form of address and endpoint number.
- Packet 2 - Data, will send the device specific data.
- Packet 3 - Status, will acknowledge the receipt of the data by sending out either success or failure receipt.
- Bulk Transfer is used for sending large packets of data to your target device. Printers and Scanners primarily follow this type of transfer. The information sent through this pipe goes through a couple forms of error detection, such as CRC, and is usually noncritical as latency can be a big factor. The process is considered complete when the amount of data obtained is equal to the amount of data requested.
- Interrupt Transfer is primarily used for time critical applications. When the device has information that needs to be passed, it will send an "interrupt" to get the host controllers attention. The host will put this request in a queue and acknowledge it when polling the individual devices connected. Some of the advantages of this transfer method are error detection communication with a guaranteed latency.
- Isochronous Transfers is used in audio and video streaming devices. The data is sent out both continuously and periodically with access to USB bandwidth and bounded latency on the line. It also contains error detection similar to that of Bulk transfer. If data failed to be sent, the transfer will not re-try to send the data.
Currently National Instruments only supports Control, Bulk and Interrupt transfer. The mode that should be used to communicate with your device is application specific and is ultimately up to the
user. Linked below are some resources that may help you in working with these transfer methods.
Related Links: KnowledgeBase 325APJ2Y: How Can I Communicate With a Device Using NI-VISA USB RAW Mode?KnowledgeBase 3BEHDLV4: How Do I Use VISA To Do An Interrupt Out Transfer For My USB RAW Device?Developer Zone Example: USB RAW Control Communication in Visual C#.NETDeveloper Zone Example: USB RAW Bulk Communication with Visual C#.NETDeveloper Zone Tutorial: Using the VISA Driver Development Wizard and NI-VISA to Register-Level Program a PXI/PCI Device under Windows
Attachments:
Report Date: 11/16/2007
Last Updated: 02/04/2008
Document ID: 4FFAGQL3