What Is the Format for VISA Resources for PXI Devices?

Updated Jan 5, 2018

Reported In

Hardware

  • PXI-1000
  • PXI-1011
  • PXI-1010
  • PXI-2000
  • PXI-4224

Driver

  • NI-VISA

Issue Details

Some of my PXI devices are listed in Measurement & Automation Explorer (MAX) as VISA Resources with names in the form PXIx::y::INSTR. For example:

PXI1::13::INSTR
PXI2::14::INSTR

How is this VISA Resource Name determined?

Solution

When VISA supports PXI devices, the VISA Resource Name will be in the form PXIx::y::INSTR. The first number, x, is the PCIBusNumber of the specific PXI slot where the PXI card is located. The second number, y, is the PCIDeviceNumber of the specific PXI slot where the PXI card is located. The PCIBusNumber and PCIDeviceNumber are hardware specific and are described in the PXISYS.INIfile, which is in your C:\Windows directory.

For example, if you have an NI 8176 controller with a PXI-1000B chassis, the PXISYS.INI file for the NI 8171 series controllers and the PXI-1000 series chassis has the following section for Slot 4:
[Slot4]
IDSEL = 29
SecondaryBusNumber = 0
ExternalBackplaneInterface = None
PCIBusNumber = 1
PCIDeviceNumber = 13

Therefore, any PXI device in Slot 4 of the PXI-1000B chassis has the VISA Resource Name PXI1::13::INSTR.

Notice that PXISYS.INI files are specific and unique to both the chassis and controller in the system. Use the links below to download the appropriate PXISYS.INI file for your controller and chassis combination. In MAX 3.1 and above, the PXISYS.INI is automatically configured. For more information about this, see the related links for White Paper: Configuring Your PXI System in Legacy Versions of MAX.

Also be aware that because these VISA Resource Names are a function of both the hardware and slot number of the PXI card, changing the chassis, controller, or installed slot of a card in the system might change the VISA Resource Name for a PXI device. Therefore, any pre-existing code that references the old VISA Resource Name might no longer function. As a developer, you can prevent this problem in the following ways:

Solution 1: Configure VISA Aliases in MAX
Consider using the VISA Alias Editor to create descriptive aliases of your PXI devices. In MAX, select Tools»NI-VISA»Alias Editor to access the VISA Alias Editor. When you create a VISA alias, you can map a descriptive name, such as PXI_2503, to a VISA Resource Name in the form PXIx::y::INSTR. In your code, you can hard-code the alias (in this case, PXI_2503) instead of the PXIx::y::INSTR resource name. If your hardware configuration were to change, you would enter MAX and edit the aliases to reflect the new hardware configuration. In this manner, the application software never needs to be changed if the hardware configuration changes. However, the disadvantage of this approach is that you have hard-coded VISA aliases in your application software code. Therefore, you should document this in your code. 

Solution 2: Programmatically Detect the PXI Card Type
A more rigorous solution is to avoid hard-coding VISA Resource Names or VISA Aliases in your application entirely. Instead, your application software can call the VISA Find Resources function. You can use the Model Name VISA property to identify the board type of each PXI VISA Resource. This allows you to detect and identify every PXI card in your system programmatically. While this is slightly more difficult to implement than VISA Aliases, this solution makes any changes in PXI hardware, such as changing a card's slot in the chassis, changing the controller type, or changing the chassis, transparent to the application software end user.
 

Additional Information

Refer to the section about PXI in Chapter 9, Interface Specific Information, of the NI-VISA User Manual (linked below) for more information.

WAS THIS ARTICLE HELPFUL?

Not Helpful