Based on the PCI bus, the CompactPCI standard defines a modular, mechanically rugged form factor for PCI devices. The PCI eXtensions for Instrumentation (PXI) standard extends CompactPCI by adding features such as integrated timing and triggering, a slot-to-slot communication bus, a common software structure, and more robust environmental standards – essential features for measurement and control applications. Because PXI is based on the CompactPCI standard, you can use PXI and CompactPCI devices in the same system without conflict. Both PXI and CompactPCI (cPCI) devices are widely used in automated measurement and control applications.Within the LabVIEW Real-Time Module, NI-VISA provides an application programming interface (API) for implementing device drivers for PXI and CompactPCI devices. Using the NI-VISA API, a programmer can access the device's control/status registers (CSRs) and shared memory. LabVIEW drivers based on NI-VISA run under Microsoft Windows as well as the LabVIEW Real-Time Module environment.
The PCI bus specification requires unique manufacturer and model codes to be embedded into each device. This information is used by the system to identify and communicate with each device. The specification also allows a devices to be identified as part of an integrated subsystem, such as a computer motherboard with video, sound and other peripheral devices. The PCI bus specification accommodates this type of device by providing for two sets of manufacturer and model codes, one for the device, and another for the integrated subsystem.
Under NI-VISA, the manufacturer and model code information is stored in the device .INF file. The wizard prompts you for this information using the dialog illustrated in Figure 3.Figure 3 –Basic Device Information Dialog
Here is an overview of the information requested in this window
The preceding information is available from the device manufacturer and can usually be found in the hardware reference manual. The subsystem manufacturer and model codes are optional and should be left blank if they are not defined. If the manufacturer specifies a subsystem ID, you must enter both ID codes as well as both model codes, and check Device uses subsystem.
Tip: If you are writing an instrument driver, leave Generates interrupts unchecked during the initial stage of development, even if you plan to implement interrupts. It is often helpful to get the basic driver functionality working before attempting to add interrupt support. Interrupt handling can be added to the .INF file by running the VISA Driver Development Wizard again.If you did not select Generates Interrupts, skip the Interrupt Detection and Interrupt Removal dialog descriptions and continue with the Output Files dialog.
In this example, the top four fields specify a step that reads a 32-bit value from CFG space at offset 0x48. The Compare mask value 0x00000002 specifies that bit 1 should be evaluated. After applying the bitwise-AND mask, the resulting value is compared to the Value to write or compare. The hexadecimal value that corresponds to bit 1 being high is 0x00000002. If bit 1 is high, there is a match, which will cause this step to return a logical “true” value to the interrupt detection sequence.Click OK to add the step to the interrupt detection sequence, which should look similar to Figure 5.Figure 5 – Interrupt Detection Information Window
More than one step may be required to evaluate whether an interrupt source is generating an interrupt.A PCI device may have multiple interrupt sources. If this is the case, you should click the Add Sequence button to create an interrupt detection sequence for each interrupt source.For additional information on detecting PCI interrupts, click the Help button.
This example shows a step that writes the 32-bit value 0x00000002 to CFG space at offset 0x48.Click OK to add the step to the interrupt removal sequence, which should look similar to Figure 7.
More than one step may be required to remove an interrupt.For additional information on removing PCI interrupts, click the Help button.
Note that LabVIEW Real-Time follows the 8.3 naming convention. Since the wizard appends the string “_RT” to the RT Target INF file name, the unique part of the file name is the first 5 characters.In some cases, it is useful to have more than one .INF file for using the same device with different configurations. If this is the case, make sure that you provide a distinctive name for each file within the first 5 characters. Using the above example, if you want your files to be named “sc150a.INF” and “sc150b.INF”, you will run into problems because the wizard will truncate both names to “sc150_RT.INF”.To install the .INF copy it (using anonymous FTP) it to the directory C:\ni-rt\system on the target PXI controller. If you have the LabVIEW Real-Time Module installed, the VISA Driver Development Wizard provides a check box (as shown in Figure 8) to FTP the file automatically. To copy the file to the intended controller using this feature, LabVIEW must be open and the RT system must be selected as the execution target.
The RT Target must be rebooted before the changes take effect.
Note that the PXI device is now identified as VISA PXI resource. A PXI resource is uniquely identified in the system by three characteristics:
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.