Controller Simulation
This topic contains the following sections:
- General information on the Controller Simulation
- When working with the controller simulation ...
- Setting the controller simulation as target system
- Simulation credentials
- Possible operations with the simulation
Note
|
Further Info
Information on how to install the simulation application and install/select different simulation images (i.e. versions) is available online in the PLCnext Community. |
Note
This topic only applies to the standard (non-safety-related) controller. The steps for simulating 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 ×". |
General information on the Controller Simulation
PLCnext Engineer includes a controller simulation which you can use to simulate the execution of the application logic. This is useful,- if no hardware is available, or
- if a simulated function test is recommended prior to starting up the "real" network.
Note
The simulation of the application may not replace the proper function test using I/O devices/sensors/actuators under any circumstances. The simulated test may only be performed in addition to the standard function test, as a preliminary test, for example. |
The PLCnext controller simulation is a separate application which actually emulates the CPU of the controller set as target your project.
It is able to simulate the entire controller behavior and it processes the identical machine code as generated for the controller involved. Therefore, no rebuild is necessary when switching between real hardware and simulation in the Cockpit (see below).
Starting with PLCnext Technology firmware versions 2024.0, communication between PLCnext Engineer and the simulation is handled via TLS and secured with a self-signed certificate. For firmware versions up to 2023.9 this is not the case.
When working with the controller simulation ...
- The PLANT shows the controller node as simulation node. The shield icon beside the node is different from the shield icon which indicates a controller connection:
- The process data are available as ports on the simulation and can therefore be read or written by the controller application. However, if the network is connected, these process data is never updated by the field bus devices. This means, physical device inputs will not be read and device outputs will not be written while simulating.
- Online editors and all debug tools are identical in simulation mode and are to be used in the same way. Even the controller status LEDs and information are available in the Cockpit ('Overview' category).
- You perform the same steps in PLCnext Engineer as you would if you were working with the physical network, although you must ensure that the 'Simulation' entry is selected in the 'Cockpit' editor of the controller node in the PLANT. While simulating the application, you can force variables or display online values in the editors as usual.
Setting the controller simulation as target system
- In the PLANT, double-click the controller node and open the Cockpit.
- On the 'Cockpit' toolbar, select 'Simulation' from the drop-down list.
If the 'Simulation' entry cannot be selected, no simulation is available for the controller type used.
The simulation is started automatically when establishing a communication connection from PLCnext Engineer (see section below). This can be done, for example by selecting the 'Connect...' command in the Cockpit or by writing and starting the project:
While the simulation is started and connected, a dialog with a progress bar is visible. (For firmware versions as of 2024.0, some additional information of the simulation boot process may be shown in the startup dialog.) Clicking 'Cancel' in this dialog, terminates the simulation and the connection establishment.
The simulation may request a user name and password when starting up.
After having connected the simulation, the PLANT shows the controller node as simulation node. The shield icon beside the node is different from the shield icon which indicates a controller connection:
All commands and debug operations now relate to the simulation. This includes the commands in the context menu of the controller in the PLANT and in the ONLINE STATE window (which is located in the Cross Functions Area at the screen bottom).
Once the simulation has been started it stays active until...- PLCnext Engineer is terminated.
- the project is closed. (This applies only to firmware versions as of 2024.0. When using a FW up to 2023.9, the simulation process is not terminated when projects are loaded or closed.)
- the process is terminated manually (for example, via the Windows Task Manager or by closing the window of the VM).
- another simulation target is selected (that is to say, a different controller type which provides a different simulation type or version).
A simulation for a FW version as of 2024.0 is able to save its current state before shutting down. When exiting the simulation, a dialog appears where you can decide to save or discard the current state. The state is saved with the project data and the next start up of the simulation will be accelerated.
Simulation credentials
The logon data for the simulation is as follows:- User name: admin
- Password: plcnext
Possible operations with the simulation
- Performing a simulated function test.
- Displaying online values in debug mode which are read cyclically from the controller and shown in the editors.
- Using debug commands, such as forcing/overwriting of variables and breakpoints in debug mode.
- Using the WATCHES window for collecting variables from different worksheets, displaying their online values and execute debug commands.
- Running the HMI application on the web server of the simulation.