Error 0xBFFA1190 Invalid Session Handle When Debugging With NI Digital Pattern Editor

Updated Mar 25, 2026

Reported In

Driver

  • NI-Digital Pattern Driver
  • NI-DCPower

Programming Language

  • C
  • C++
  • C# .NET

Issue Details

When I attempt to debug my test program with the NI Digital Pattern Editor™ (DPE), the following error appears:

Unable to connect to an existing session for instrument resource.
IVI: (Hex 0xBFFA1190) The session handle is not valid.
 
 
The error occurs only when the test program is written in C, C++, or .NET. The issue does not occur with LabVIEW™ test programs. The debug operation fails when the DPE tries to attach to the running instrument session created by the test program.

Solution

This behavior is expected when debugging C, C++, or .NET applications with NI-Digital Pattern Driver. The NI driver requires additional debugging configuration when attaching to an existing session from the DPE.
Perform the following steps to resolve the error:
 
  1. Enable debugging settings in DPE.
    • Open Instruments>>Configure Debugging.
       

 

    • Enable all available debugging checkboxes for each instrument.
       

    • Reconnect to the instrument.
      These settings slow down debugging but allow the driver to use the Thrift-based debug/attach mechanism required for C, C++, and .NET applications.

  1. Suspend the test program before DPE attaches.
    • Configure a breakpoint in TestStand (if TestStand is used) or directly in the C/C++/.NET source code.
    • Place the breakpoint after all NI-Digital sessions are created but before the connection attempt from Digital Pattern Editor.
      Suspending execution ensures the session is fully initialized and available for DPE to attach.

  2. Disable debugging and breakpoints after use.
    • Clear the debugging checkboxes in Instruments>>Configure Debugging after resolving the issue.
    • Remove or disable breakpoints to restore normal performance.
      Leaving these settings enabled may slow down future test executions.