Skip to main content

Using the Automation Server as a Gateway for Remote Debugging

The remote debugging feature provides the option to debug from CODESYS an application on a PLC, which is not available in the local network, but connected to the CODESYS Automation Server. Moreover, from CODESYS you can scan all available devices that are connected to the CODESYS Automation Server.

Establishing a connection from CODESYS to a PLC of the Automation Server via the Edge Gateway of the Automation Server

. Requirements
  • An Edge Gateway is configured on the Automation Server, and this Edge Gateway is running.

  • A PLC of the PLC network is registered on the Automation Server, and this PLC is running.

  • The CODESYS Automation Server Connector package is installed in the CODESYS Development System on your computer.

  • A CODESYS project is open and connected to the Automation Server.

  1. In the device tree, double-click the PLC of your open project.

  2. On the Communication Settings tab, in the list box for the gateway, select that gateway which is added on the Automation Server as an Edge Gateway. (CAS) has to be displayed after the gateway name.

    If the desired gateway is not available in the list box, then click Tools → Edge Gateway → Synchronize Remote Gateways. Now the list box is refreshed and you can select the gateway.

    The following information is displayed below the selected gateway:

    • Automation Server Tenant

    • Automation Server Cluster

    • Gateway ID

    • Name on server

    The Automation Server – Sign In dialog opens.

  3. In the Automation Server – Sign In dialog, specify your User name and Password for the Automation Server.

    In the case that multi-factor authentication (MFA) is activated for your user account, you also have to enter the currently valid token when you sign in. For more information, see: Using Multi-Factor Authentication (MFA) to Sign In to the Server

  4. Click Scan Network.

    The Select Device dialog opens.

  5. In the dialog, select the corresponding gateway and click Scan for Devices.

    All of the PLCs, which connected to the Edge Gateway and currently running, are displayed below the Edge Gateway

  6. Select the desired PLC and click OK.

    On the Communication Settings tab, the selected PLC is displayed and marked with the solid green circle.

    Now you are connected from CODESYS to the PLC via the Edge Gateway of the Automation Server.

Remotely debugging from CODESYS an application on a PLC of the Automation Server

. Requirements
  • You have performed Steps 1 – 5 in the guide above. Now you are connected to a PLC of the Automation Server via the Edge Gateway.

  • In CODESYS, a project is open, which has already been committed to the Automation Server.

  • In CODESYS, the Assign Server Applications on Download command is enabled in the Online menu.

If the application is already downloaded to the PLC and synchronized with the current project, then you can log in to the PLC via the Edge Gateway. Then no additional steps are necessary.

  1. In CODESYS, click Online → Login.

    The Commit to Server dialog opens.

  2. In the dialog, the current commit and the PLC on the Automation Server to which the application is downloaded are selected. Check this information and click OK.

    On the Automation Server, in the PLC Details view, on the Status Information tab, it is displayed that the connection has been established successfully. Information about the committed application is also displayed.

  3. In CODESYS, click Online → Logout and make a small change in a POU of the project.

  4. Click Online → Login again.

    The dialog opens with login options.

  5. Select the Login with online change and Update boot application options. Then click OK.

    The Commit to Server dialog opens.

  6. Specify a commit message and clear the End debug mode and start the applications option. Then click OK.

    You have logged in with an online change on the PLC of the Automation Server.

  7. Now from CODESYS you can use the commands in the Debug menu to debug the application on the PLC of the Automation Server (for example, set breakpoints or write and force values).