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
file, which is in your
For example, if you have an NI 8176 controller with a PXI-1000B chassis, the
file for the NI 8171 series controllers and the PXI-1000 series chassis has the following section for Slot 4:
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.
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.
When the PXI system first boots, the BIOS on the controller enumerates all of the PXI hardware in the system which NI-VISA uses to determine the VISA Resource Names. Therefore, these names cannot be manually changed by the user. Be aware that changing the chassis, controller, or installed slot of a card in the system might change the VISA Resource Name for a PXI device. As a developer, you can prevent code from breaking due to referencing old resource names 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, on the newest versions of NI MAX, select Tools»NI-VISA»VISA Options to access the VISA options menu and under General Settings you will find the Aliases settings. 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 the VISA supported PXI cards 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.