Debug Server

The Workers Debug Server plays an integral roll in developing applications efficiently with the framework. No matter how useful a framework is, if you are unable to easily access, view and navigate through your code at runtime, then the overall benefits that a framework brings will be greatly reduced. It is for this reason that the Workers Debug Server was created.

Through the Debug Server, you can see what is happening within your Workers applications at runtime, whether they be running in the LabVIEW development environment, as an executable application, or as code running on a real-time cRIO over a network.

Basic Principles

The Debug Server communicates to Workers applications via TCP data streams. Usually the Debug Server acts as a TCP server and a Workers application acts as a TCP Client, through the loading of a Debug Client background task by use of the Debug Client Loader.vi contained in a Worker's Launcher VI.

The Debug Server can accept multiple connections to Debug Clients, or you can load multiple instances of a Debug Server, which can connect to Debug Clients over a user defined TCP Port. This makes debugging your Workers applications a flexible process, and it is up to you how many Debug Servers you use and how many Debug Clients connect to which Debug Sever. An example of this is show below.

IP Addresses and Ports

Once you start the Debug Server application, it will immediately start listening for incoming Debug Client connections on all IP addresses that are available on the platform that the Debug Server is running on (E.g. localhost and a network card, etc.). The port that the Debug Server will listen on is set by default to port 6891. You can change this port by pressing the Change Port button in the connection section at the top of the Debug Server window. See the image below.

Debug Clients

A Debug Client is a background task that is loaded by the use of the Debug Client Loader.vi within a Worker's Launcher VI. See the example below.

Important

Never fork a Worker's main data wire at the output of Debug Client Loader.vi. Use a single Debug Client Loader.vi for every Workers application instance you load.

A Debug Client must be loaded before a Worker's head Worker is launched. The Debug Client will then try to connect to a Debug Server periodically (every few seconds) until a successfully connection has been made. Debug Clients terminate automatically whenever the calling application shuts down cleanly or loses its reference. If connection to a Debug Server has been lost and the Workers application is still running, then the application's Debug Client will continue trying to connect periodically (every few seconds) to the Debug Server.

The Debug Client is a lightweight and resource friendly application, and can be included with your applications if you wish so that you can see what is happening within your applications when they are executing, regardless of what target the Workers application is running on or in what format you have packaged your application.

Good to know

It doesn't matter if a Workers application is launched before or after the Debug Server. An application's debug data is stored within a Debug Client and remains persistent. This data will then be downloaded to the Debug Server upon a successful connection between a Debug Client and the Debug Server.

Last updated