Controller Commissioning: From Compiling to Debugging
Note
Both the Safety PLC and the standard (non-safety-related) controller have their own, separate Cockpit and both can be connected and commissioned independently of each other. It is, for example, possible to write the standard application to the standard controller and start its execution while simulating the safety-related application at the same time. Commissioning the Safety PLC is described in the help chapter "Controlling the Safety Application from the Safety Cockpit". |
WARNING
|
Unintended machine operation
|
- Verify the following:
- Controller and all configured devices are available in the network.
- Application structure modeled in the PLANT represents the physical network.
- IP address settings in the 'Settings' editor of each device involved are correct (controller node and PROFINET device nodes). If required, adjust the IP settings as described in the topic "Device Configuration/Parameterization".
- No errors are pending in the Error List (MESSAGES window).
- Programming mode is active and
debug mode is inactive, i.e., the controller node icon does not indicate a controller status and the controller name is not shown bold in the PLANT. Reason: the project cannot be written to the controller while online and debug data is exchanged in debug mode.
If on, switch the debug mode off by selecting 'Debug On/Off' from the context menu of the controller in the PLANT or in the ONLINE STATE window, or deactivate the corresponding icon on the 'Cockpit' toolbar:
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". - Set the controller (not the controller simulation) as target system.
- Double-click the controller node in the PLANT to open its properties in the editors area.
- In the editors area, open the 'Cockpit' editor.
- In the 'Cockpit' editor, select 'TCP/IP' from the drop-down list.
Note
If you have configured a redundant control system built up with, for example, two RFC 4072R controllers, the drop-down list provides all TCP/IP LAN ports of the controllers for selection. This allows you to access both controllers in the redundant system in order to gather, for example, status information for the purpose of diagnostics of the redundant control system.
For detailed information, see the topic "Configuring a Redundant Control System".
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". - Create the project image (build the project), send it to the controller, and start the program execution. Building the project, sending, and starting the project execution is possible with only one command.The project image contains the application logic as machine-readable code and all relevant configuration/parameterization data of the project. If an HMI application has been developed in the project, the HMI data are also sent to the controller.
Note
When writing the project to the controller and starting up the application, observe the safety warning message noted at the beginning of this topic.Refer to the topic "Controlling the application / Toolbar icons in the Cockpit" for detailed information on the 'Write and Start' command.
Note
- Menu item/icon not active? If the command is not available although the controller is reachable in the network, PLCnext Engineer may run in debug mode. Detach PLCnext Engineer from the running application process. See preconditions in step 1.
- 'Write and Start' aborted due to compiler errors? The project build process is aborted in case of any detected errors. When correcting errors, you can use the 'Rebuild' command to prove the error-free project before calling the 'Write and Start' command again.
Also observe the other 'Write and start' commands if provided and supported by your controller type:- 'Write project changes...' writes only modifications to the target and switches the project execution without stopping the controller. If the menu items are not provided, writing changes is not supported by the controller type involved. See topic "Writing project changes" for details.
- The 'Write ... (with sources)' commands include project sources and store them on the target:
and
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. When hovering the mouse on the controller icon, a tooltip appears showing logon information. If you have accepted an "unsecured" connection, the following shield symbol is displayed:
. Refer to the topic "Network Security" for details.On the controller, the project is automatically stored as Boot Project in the Flash Memory. As a result, the controller will automatically execute this project after each start-up.PLCnext Engineer automatically attaches to the process and switches to Debug mode when the project execution has been started after a 'Write and Start' command.
- Perform a function test after the successful controller startup. To support you in this, PLCnext Engineer provides the following features:
- Debug mode in which online values are read cyclically from the controller and displayed in the editors.
- Debug commands, such as forcing/overwriting of variables and breakpoints.
After activating an extended debug option in the Cockpit, debugging of functions, methods, inline transitions and actions is possible. This option, however, increases the execution time and memory consumption on the controller. - For SFC worksheets, additional SFC-specific debug commands are available.
- WATCHES window for collecting variables from different worksheets, displaying their online values and execute debug commands.
- LOGIC ANALYZER for recording and graphical representation (as curves) of variables values read from the running controller.
Note
The test of the application in debug mode using debug commands, the WATCHES window and LOGIC ANALYZER may not replace the proper function test using I/O devices/sensors/actuators under any circumstances. The test in debug mode may only be performed in addition to the standard function test, as a preliminary test, for example.
Note
After the modification of safety-related parameters: If you have changed safety-related parameters (such as F-parameters or channel-related parameters), you have to write additionally the safety-related project to the Safety PLC. If only the standard controller is updated, Profinet cannot become operational. Refer to the topic "Safety Parameters Editor", section "After a safety parameter modification" for details. |
Controller simulation: optional addition to the function test
PLCnext Engineer additionally provides a function for simulating the application, which you can use to test the behavior of the application logic (including HMI and code from PLCnext Engineer libraries) fully independently of the real hardware. Simulation mode offers an option to force variables and set breakpoints, too.