|Note NI-VISA will detect USB Test & Measurement Class (USBTMC) devices automatically. The information below applies only to setting up your USB device for low-level RAW access.|
Each USB device must have a kernel-level driver associated with it; this is done in Windows via a .inf file. For NI-VISA to recognize your device, you must run the NI-VISA Driver Wizard, available via the Start menu under National Instruments»VISA.
The wizard first prompts you for basic information NI-VISA needs to properly locate your USB instrument. This includes the following:
In text boxes where numerical information is required, preceding the number with 0x designates a hexadecimal value. The wizard assumes all other numeric entries are decimal values.
The wizard also allows you to enter certain Windows Device Manager settings; these are cosmetic and do not affect the ability of NI-VISA to recognize and control your USB instrument. They are provided as a convenience, allowing you to more fully customize your instrument driver package.
When you are done, the NI-VISA Driver Wizard generates a Windows Setup Information (.inf) file for each supported operating system. Before a USB device will be visible to NI-VISA, you must use the .inf files to update the Windows system registry. The procedure for using a .inf file to update the registry is Windows-version dependent. To manually install a .inf file on any machine, including the one on which it was generated, open the appropriate .inf file in a text editor and follow the instructions on the first few lines at the top. Alternately, you can let the wizard install the .inf file appropriate for your machine before the wizard exits.
NI-VISA relies on a Linux kernel feature for its USB support. This feature is called usbfs, and on older Linux kernels was referred to as usbdevfs. For NI-VISA to support USB devices, this feature must be present and mounted (like a virtual filesystem). This is supported in most major Linux distributions such as Red Hat, SuSE, and Mandrake. You may use the mount command to display what filesystems are currently mounted to see if your system currently supports this feature.
Also, the VISA user must have write access to the file that represents the USB device, which is typically somewhere in a subdirectory within /proc/bus/usb. If this is not the case, the USB device is not accessible by VISA (it will not be found using viFindRsrc, and viOpen will fail). The default configuration on most systems is that the root user has write access; however, no other user has this access.
There are several options for providing a nonroot user access to a USB device.
As long as no other driver on the system claims the USB device, you can use NI-VISA to access it. No special setup is required.