USB (Universal Serial Bus ) Standard

Version 7

 

USB based devices are divided to RAW and USBTMC (Test and Measurement Class) devices. USBTMC is a standard created by the USB organization (http://www.usb.org) and is designed to mimic the message-based IEEE 488 style of programming with which instrumentation users have become accustomed using a USB 2.0 ports. USBTMC designed to RAW access is required for low level device access for any USB class.

ATEasy Support for USB devices

ATEasy includes the following features to support controlling USV devices:

Using the Internal Library to Program USB devices

Each USB device has address specified by vendor id, product id and S/N. Users call UsbOpen to open a device, once opened a handle to a device is returned. When communication is no longer need you can call USB to release the handle created. ATEasy automatically closes all handle when the application is closed.

Each device has one or more configurations (usually 1).  Each configuration contains one or more interfaces, each interface constrains one or more endpoints (max 32 endpoints for a configuration for USB 2.0 device and 16 for USB 1.0). Pipes is the channels connected to an endpoint and used to transfer data or command.

After the handle is created UsbSetup can be called to set the default interface number within the configuration index specified and if the device interface is a USBTMC class. For USBTMC devices  (argument set to TRUE) the interface and configuration is automatically selected and the interface number/configuration index are ignored. Once the interface is selected all send and receive commands will use that interface.

To send or receive data use the UsbSend and UsbReceive functions. The functions communicate through a pipe to a device specified by the enPipeType (enumAUsbPipeTypes) or  the lEndpointAddress. For USBTMC devices aUsbPipeTypeBulkOut for UsbSend or aUsbPipeTypeBulkIn for UsbReceive are used by default. lEndpointAddress address is used for specifying the absolute address within the configuration. enPipe Type is the address that is relative within the current selected interface.

 Additional low level functions are provided mainly for RAW devices: