Interrupt Detection Information
If the Generates interrupts box is checked, the next window is the Interrupt Detection Information window. Because PXI/PCI devices share one of four physical interrupt lines, more than one PXI/PCI device can be interrupting at any given time. In the Interrupt Detection Information window, you specify the sequence of register operations so that NI-VISA can determine whether your device is interrupting. PXI/PCI hardware typically indicates a pending interrupt condition using an Interrupt Status/Control register. The following figure shows the Interrupt Detection Information window.
Interrupt Detection Information
You can use a Read/Compare operation to determine whether your device is asserting a hardware interrupt. This operation performs a register read, applying a user-defined mask (logical-AND) to the register contents. The resulting value is then compared with a user-specified constant (using another logical-AND). If the masked-result and the user-defined constant are the same, the comparison operation is True. If the values are different, the result is False. If the result of all Read/Compare operations in a sequence of register transactions is True, NI-VISA concludes that your device is interrupting and proceeds to execute the Interrupt Acknowledge sequence. Because NI-VISA relies on the comparison operations result in making this conclusion, at least one Read/Compare operation must be present in this transaction sequence. You can add steps to the sequence using the Add a step before and Add a step after buttons. The following figure shows the window that appears if you click one of the Add a step buttons.
When determining whether your device is asserting a hardware interrupt, you can use more than one transaction sequence. All comparisons within any given detection transaction sequence must have a result of True for that detection transaction sequence to have a result of True. If multiple detection transaction sequences are present, the results from every sequence are compared using a logical-OR. If any sequence has a result of True, NI-VISA concludes that this interrupt belongs to this device. The steps and sequences required to detect if your PXI/PCI device is generating an interrupt should be in the device register documentation. You can add and remove sequences using the Add Sequence and Remove Sequence buttons, respectively.
Interrupt Information Window
The above example specifies that to make this determination, you must read a 32-bit value from BAR0 at offset 0x14. NI-VISA must then check this value to determine the status of bit 31 (highest order bit in the register). If bit 31 is high, NI-VISA knows the device is generating an interrupt. Using the Compare mask, you can mask in the particular bits you need to compare, in this case bit 31. The hexadecimal value that corresponds to bit 31 being high is 0x80000000. The Value to write or compare is the value that you expect the 32-bit register to be equal to after applying the mask. If you were doing a Write instead of a Read/Compare, you would use this value to specify what should be written back to the register. Again, this information is provided for example purposes only; it is not useful if attempting to handle interrupts for the PXI-6070E. Click OK when you finish entering a particular interrupt detection step. When you have added all steps for your device, click Next to continue with the wizard.