How to Route a PXI Trigger Programmatically

Updated Sep 21, 2023

Environment

Software

  • LabVIEW

Operating System

  • Windows

Programming Language

  • LabVIEW G
  • Python
  • C# .NET
  • Visual Basic .NET

NI MAX available in the Windows operating system enables the user to route triggers for the chassis interactively. However, it cannot be denied that in some scenario, the developer would like to perform trigger routing programmatically.

This article will share the working principle on how to route PXI trigger programmatically and what are the useful references.

Below are the sequences needed to route a PXI trigger:
  1. Open VISA Resource Manager
  2. Open PXI Backplane Resource
  3. Set the source and destination bus PXI VISA attributes
  4. Route the trigger
  5. Unroute the trigger - only do this if we succeeded in Routing
  6. Close your VISA Sessions

LabVIEW example for PXI trigger routing could be found at:
For 32-bit LabVIEW:
C:\Program Files (x86)\National Instruments\<LabVIEW Version>\examples\Instrument IO\VISA\PXI\PXI - Route Trigger.vi
For 64-bit LabVIEW:
C:\Program Files\National Instruments\<LabVIEW Version>\examples\Instrument IO\VISA\PXI\PXI - Route Trigger.vi
or
Using the NI Example Finder as below:
image.png

.NET example for PXI trigger routing:
There is no out-of-the-box example for PXI trigger routing for .NET, but the developer can use the SimpleReadWrite example located at C:\Users\Public\Documents\National Instruments\NI-VISA\Examples\.NET as a getting started.

Python example for PXI trigger routing:
As of now, NI does not provided Python example for PXI trigger routing, but an external example can be found in the related links section below.
Note: PyVISA is a third-party wrapper and is not directly supported by NI.