This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Remotely Debugging Executables in LabVIEW

Updated May 10, 2019

Reported In

Software

  • LabVIEW Application Builder Module
  • LabVIEW

Issue Details

  • I am using 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?
  • 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

  1. Grant an exception for the NI Service Locator in your firewall and open port 3580. If you do not have a firewall, skip this step.
  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.If you do not have a firewall, skip this step.
 

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. This populates the Application or shared library drop-down box with all open debuggable applications on the selected target.
  2. 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. You can access the block diagram from the Remote Debugging window:
  • Right-click on 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. 
  • Hover over the Front Panel and use the Ctrl + E shortcut to open the block diagram.
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.

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

WAS THIS ARTICLE HELPFUL?

Not Helpful