Configuring NI-VISA to Recognize a PXI Device

NI-VISA

Configuring NI-VISA to Recognize a PXI Device

Each PCI 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 PXI instrument. This includes the following:

  • Instrument Prefix—The VXIplug&play or IVI instrument driver prefix for the device.
  • PXI Manufacturer ID—This 16-bit value is vendor specific and is unique among PCI-based device providers. The vendor ID number for National Instruments, for example, is 0x1093. If the product vendor uses a commercial PCI core, this value would be the vendor ID of the PCI core component.
  • PXI Model Code—The 16-bit device ID value is device specific, defined by the instrument provider, and required for PCI-based devices. If the product vendor uses a commercial PCI core, this value would be the device ID of the PCI core component.
  • Subsystem Manufacturer ID—This 16-bit value is vendor specific and is unique among PCI-based device providers. If this value exists, it specifies the vendor ID of the actual product. This value may be the same as the primary PXI Manufacturer ID.
  • Subsystem Model Code—The 16-bit device ID value is device specific, defined by the instrument provider, and required for PCI-based devices.
  • Generates interrupts—Checking this box indicates that you want to use the VISA event-handling model in response to hardware interrupts your PXI instrument generates.

If the device vendor has provided you with a Module Description File (also called a module.ini file), you can import the information from that file into the wizard instead of entering these settings yourself. Module Description Files provide a mechanism for informing the operating system and the PXI Resource Manager about key attributes of a PXI module. The specification for these files is at http://www.pxisa.org/Specifications.html.

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.

If you need to handle hardware interrupts, check Generates interrupts and the wizard guides you through a two-step process. In Step 1, you specify how your device detects a pending interrupt. This is done via one or more register accesses, where each access is a single register read or write of a specified width to a given offset relative to a given address space. In the wizard, you specify each access as a Read, Write, or Compare.

The Compare operation is essential for determining whether a PCI/PXI device is interrupting. A Compare operation performs a Read, then applies a user-specified mask to the result and compares the masked result with another user-specified value (you specify both of these values in the wizard). In order to determine whether your device is interrupting, the Compare operation has an associated result of True or False. NI-VISA decides that the device is interrupting if and only if the result of all Compare operations is True. Because NI-VISA relies on the result of the Compare operation in making this determination, at least one Compare operation must be present in an interrupt detection sequence for the sequence to be valid.

If your device has multiple potential interrupt sources, you can specify multiple interrupt detection sequences. At least one sequence must be considered valid for NI-VISA to deem that your device is interrupting.

In addition to the interrupt detection sequence, NI-VISA also needs the sequence of register operations required to acknowledge an interrupt condition for your device; this is Step 2. At interrupt time, if NI-VISA determines that your device is interrupting (as discussed above), this second sequence should do whatever is necessary to squelch the interrupt condition. This sequence is constructed using the same Read, Write, and Compare operations discussed in Step 1, and individual operations are entered in an identical manner. Because this sequence should consist of the minimum operations necessary to turn off an interrupt condition for your device, the result of any Compare operations, while still valid, are irrelevant to interrupt acknowledgment. If your device uses ROAK (Release on Interrupt Acknowledge) interrupts, and the ROAK register was accessed in the sequence specified by Step 1, this sequence can be left blank.

The wizard will also allow 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 PXI 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 PXI 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.