Connecting vs. Attaching (Debug On)
Note
This topic only applies to the standard (non-safety-related) controller. The steps for the Safety PLC are described in the help chapter "Safety PLC Commissioning: From Compiling to Debugging ![]() ×‣ Connecting vs. Monitoring Mode vs. Debug Mode ×‣ Safety Cockpit: Controlling the Safety Application ×‣ Safety PLC Diagnostics out of the Safety Cockpit ×‣ Monitoring/Debugging the Safety PLC ×‣ Monitoring Mode: Displaying Online Values ×‣ Debugging Safety-Related Code: Forcing/Overwriting ×‣ WATCHES: Monitoring/Debugging the Safety-Related Application ×‣ Safety PLC Simulation ×". |
Note
Poor internet connection? Performance problems due to VPN connection? You can adapt the TCP communication settings by increasing the handshake timeout value and the polling interval. See topic "TCP Communication Connection". |
Note
Ad-hoc IP address instead of project-defined address Instead of the IP address defined in the controller settings of the project, you can also connect to a controller with any other IP address (provided it can be accessed in the network). In this way, communication connections to several PLCnext devices can be established one after the other (e.g. in router scenarios) without having to change the IP address in the project settings and rebuild the project. How to do this is described under "Ad-hoc IP address instead of project-defined address". |
Also observe the section "Detaching and Disconnecting" below.
The state of the connection is indicated by the controller icon in the PLANT (see icon descriptions below). Additionally, the tooltip of the controller icon shows the current connection state.
Level 1: connected to the controller
To establish a communication connection, proceed as follows.- Right-click the controller in the PLANT and select 'Connect/Disconnect' from the context menu, or
select the command in the context menu of the controller in the ONLINE STATE window, or
click the 'Connect to controller' button on the 'Cockpit' toolbar. - If the controller involved implements a secure device concept, and if you are not yet logged on to the controller (black shield symbol beside the controller icon in the PLANT), the authentication dialog appears. Enter a user name of the desired and suitable role as well as the relating password and press <Enter> to log on. (Make sure that the user role you are entering allows writing and starting the project.)
If an authentication error occurs during connection establishment (due to a rejected or unknown controller certificate), a dialog appears where you can instruct PLCnext Engineer to establish the ("unsecured") connection nevertheless.While you are logged on to the controller, this is indicated by a green shield symbolbeside the controller icon in the PLANT.
If you have accepted an "unsecured" connection, the following shield symbol is displayed:
Refer to the topic "Network Security" for details.
While connected, the controller icon in the PLANT indicates the controller status. Examples:
= state On, no project is loaded
= Running
Note
Logging on to the controller (if a security concept is provided) by entering a user name and password into the authentication dialog automatically establishes a communication connection to the controller like the 'Connect' command described here. |
Level 2: debug mode = attached to the application process
Attaching PLCnext Engineer to the running application on the controller means establishing an online connection and starting the debug mode. This is only possible if the controller is already connected (level 1). Activate the debug mode as follows:
Note
When activating the debug mode, a comparison of the project names and the CRCs of the local project loaded in PLCnext Engineer and the project executed on the controller is performed. If the project names and/or CRCs differ, a corresponding message appears informing you about the project differences. You can either abort the process or continue. If you continue, wrong online values may be displayed. If you cancel the dialog, the process is aborted and a corresponding warning is shown in the 'Online Log' in the 'MESSAGES' window. Behavior with breakpoints set If breakpoints are set (no matter whether the breakpoint is in enabled or disabled state) or the controller is in halt mode and the CRCs differ, debug mode cannot be enabled. A corresponding message appears where you can abort the process. The 'Online Log' shows a corresponding warning after aborting. If you have entered the debug mode with different CRCs, the breakpoint will be disabled/in disabled state. When you set a breakpoint, the breakpoint will enter the disabled state. |
In debug mode, the controller icon in the PLANT indicates the controller status. Examples:
= state On, no project is loaded
= Running
- reading online values and displaying them in online worksheets.
- debugging code by forcing/overwriting variables and setting breakpoints.
- using the WATCHES window for collecting online values of variables.
- using the LOGIC ANALYZER for recording and graphical representation (as curves) of variables values read from the running controller.
Note
Both connection levels ("connected to" as well as "debug mode") are automatically established after executing one of the 'Write and Start' commands. |
Detaching and Disconnecting
Note
If the controller involved implements a secure device concept, you have to be logged on while connected to the controller (green shield symbol beside the controller icon in the PLANT). Disconnecting manually from the controller does not imply a logoff. Instead, you remain logged on with the current user role. An unexpected disconnection, however, results in an automatic logoff which is indicated by the desktop alert "Credentials withdrawn". In this case, you have to re-logon as described below. |