Skip to end of metadata
Go to start of metadata

Being able to debug your code on the fly using your IDE is crucial to effectively developing modules. Since your module is running inside of Ignition, a few extra steps need to be taken to set things up.

Gateway Scope

To debug your gateway based code, you'll use Java remote debugging to connect Eclipse to the running Ignition instance. Ignition will be running your module, so you must have the most recent code deployed, but you will then be able to set breakpoints, examine variable values, etc.

Step 1 - Enable Remote Debugging in Ignition

The parameters to enable remote debugging are found in ignition.conf, under "{InstallDir}/data". The parameters are already present, but commented out. To enable:

  1. Stop the Ignition service
  2. Edit <InstallDir>/data/ignition.conf Remove the comment for the lines:,server=y,suspend=n, address=8000  
  3. Restart the Ignition service.

Settings Notes: In the remote debug settings, "address" is the port. Depending on the applications running on your machine, you may need to change this to find an unused port. "suspend", when set to "y", causes Ignition to block on startup until the remote debug session is established. This can be useful for debugging module startup. However, remember to unset it when done, or you'll wonder why the Ignition service is blocked on startup.

Step 2 - Create a Remote Debug Profile in Eclipse

Under Run>Debug Configurations, create a new "Remote Java Application" profile. This profile will debug the project select under the "Project" setting, so make sure that the current selection is correct. Also, if you changed the port in the config file, make sure to set it here as well.

To debug, simply run this configuration. Note that you may need to allow the applications (both Ignition and Eclipse) to access the network/bypass the firewall, depending on your operating system setup.

Client Scope

To debug client based code, such as components, you'll need to create an Eclipse launch profile that launches an Ignition client, bypassing Java Web Start.
Note: You can debug either the designer or a client. If using a client, you'll need to first create a project that uses your component, so that you can specify the project name later in the config.

Step 1 - Create a new Java Application Launch Profile

Under Run>Debug Configurations, create a new Java Application profile for your project. Set Main Class to: com.inductiveautomation.ignition.client.launch.BootstrapSwing

Step 2 - Add the Ignition launch jar

  1. Click on the debug profile's Classpath tab
  2. Select Bootstrap Entries and click Add External JARs Locate launchclient.jar under {InstallDir}\lib\core\launch

Step 3 - Set up VM arguments

Click on the "Arguments" tab. In the "VM arguments" section:

For Debugging in the Designer:

For Debugging in the Client: ClientLaunchHook

Remember: Set the last parameter, "project", to your correct project name. This parameter is case-sensitive.

When you run this config profile, the client or designer will be launched, and the project you specified under the "Main" tab will be debuggable.

  • No labels