Controller Simulation
Note
|
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
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 ×‣ Controlling the Safety Application from the Safety Cockpit ×‣ 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).
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 may request a user name and password 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 simulation is started and connected, a dialog with a progress bar is visible. Clicking 'Cancel' in this dialog, terminates the simulation and the connection establishment.
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).
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.