Remotely Debugging Executables in LabVIEW

Updated Oct 25, 2018

Reported In

Software

  • LabVIEW Application Builder Module
  • LabVIEW

Operating System

  • Windows

Issue Details

  • I am using the LabVIEW Application Builder to create an executable, and I am deploying it to a target machine. Can I remotely debug the executable running on the target from my development machine? How can I do this?
  • My executable is acting differently than when I run my VI on the development system. What can I do to troubleshoot this? 

Solution

In LabVIEW 8.0 and later, it is possible to remotely debug built executables that are running on a target machine by connecting to them over network from the development machine. The following are instructions for creating debuggable executables and debugging them from the development machine:


On the Development Machine

  1. Check the Enable debugging option in the Advanced menu when creating the executable in the LabVIEW Application Builder.
  • The Enable debugging option builds the block diagram into the executable so that you can follow its execution.
  • The Wait for debugger on launch option means your executable will not run on launch and will wait for the debugger to connect. This option overrides the Run when opened property that you can set for every individual VI.
 
 
  1. Build the executable.
  2. Move the executable to the target machine along with all the associated files (application name.ini and application name.aliases in LabVIEW 2009).


On the Target Machine

If you do not have a firewall on the target machine, skip to step 2.

  1. Create an exception for the NI Service Locator in your firewall and open port 3580. 
  2. Launch the executable on the target machine
  • If you had checked the Wait for debugger on launch option, the executable will launch but not run.
 

On the Development Machine

  1. In the Project Explorer toolbar, navigate to Operate»Debug Application or Shared Library... to launch the debugger.
 
 
  1. Enter either the Machine Name or the IP Address and click the Refresh button.
  • The Application or Shared Library drop down box gets populated with all open debuggable applications on the selected target.
  1. Click the Connect button.
  • This connects the debugger to the executable on the target and open a window for the top-level VI in it.

 
  1. To access the block diagram, you can:
  • Right-click in the front panel to see the Remote Debugging menu that allows access to the block diagram. 
  • Select Window » Show Block Diagram. Now you have tools such as Highlight Execution, breakpoints, and probes available to you for debugging. 
You can use the Quit Debug Session to stop debugging but leave the VI running on the target.

 

Additional Information

Checking the Enable debugging option will automatically add DebugServerEnabled=TRUE to the .ini (configuration) file that is built with the application, regardless of whether you choose to use LabVIEW's default configuration file or your own custom .ini file (selectable with the Use the default LabVIEW Configuration file (LabVIEW.ini) checkbox on the Advanced menu). If you decide to use a custom .ini file in your project, LabVIEW will create a copy of the specified file with the  DebugServerEnabled=TRUE token.

In order to enable debugging for an application built in LabVIEW 8.0.x when specifying a custom ini file, DebugServerEnabled=TRUE had to be manually added to the created ini file in addition to selecting Enable debugging on the Advanced page of the Application Properties dialog in Application Builder. The same thing is true for the Wait for debugger on launch option and the corresponding ini string, DebugServerWaitOnLaunch=TRUE. This was fixed in LabVIEW 8.2.

Note: For instructions on creating an executable using the LabVIEW Application Builder, refer to the Distributing Applications with the LabVIEW Application Builder.

If there is a firewall on the target machine, it can prevent the debugger from connecting to the executable. 
 

WAS THIS ARTICLE HELPFUL?

Not Helpful