First steps

Prerequisites:

see also Requirements for Simulation configurations.

Creation of new TwinCAT Simulation Manager project

Select "File --> New" in the main menu (see Picture 1)

First steps 1:
Picture 1: Open a new project

An "Open new Project" dialog appears and a valid Project name and Location path must be inserted. Press "OK" (see Picture 2).

First steps 2:
Picture 2: "Open new project" Dialog

After selecting "OK" the TwinCAT Simulation Manager creates an project folder and project file.

To create a simulation environment the next necessary step will be to select the target systems where the original (to be simulated) projects and configurations exist. For that please activate "Edit --> Select target Systems ..." in the main menu (see Picture 3). As reaction the "Add original Systems" Dialog opens (Picture 4). The dialog shows all TwinCAT target systems that are found within the connected subnetworks.

First steps 3:
Picture 3: Open the select target systems dialog

Within this dialog select all systems that are intended to be simulated and add it to the right-hand-side List (Push-Button ">>"). With pressing "OK", the TwinCAT Simulation Manager adds these systems to its own simulation project configuration. If any target system is not assigned to the actual routes of the local system, the TwinCAT simulation manager asks to add this route. If the access to the target systems is possible the actual configuration will be downloaded and cached locally. The same happens for all PLC symbol information (*.tsm files) that are active on the targets.

First steps 4:
Picture 4: Selection of the target systems

If all necessary information is found and the data is downloaded successfully the TwinCAT Simulation Manager shows all selected systems within its configuration navigation tree (Picture 5).

Creating a new simulation PLC

Up to now, the TwinCAT Simulation Manager only contains the original systems - the ones that must be simulated. Creating and adding a new simulation PLC is done as follows:

  1. Select the PLC runtime that is intended to be simulated within the Configuration navigation tree (see Picture 5)
  2. Activate "Create Simulation PLC-Project" from the context menu.
  3. Within the now appearing Dialog, the Simulation PLC runtime must be selected (Picture 6). This dialog shows the currently available target systems. If the designated simulation system is not in the tree, it can be added via the "Search" button.
  4. With leaving the dialog over "OK" the TwinCAT Simulation Manager generates a simulation framework for the selected PLC, assigns it to the specified target system and runtime and adds it to the TwinCAT Simulation Manager configuration project.
    The PLC framework project will contain all located IO-Symbols (see Picture 7) of the original PLC project in reversed/mirrored allocation (inputs --> outputs and outputs --> inputs) and is ready to fill with simulation code. The next step is to fill the empty shell of the simulation project with simulation code. This is specific to the application. For this task PLC Control Application can be opened via context menu "Open PlcControl ...".
First steps 5:
Picture 5: Create the simulation PLC project
First steps 6:
Picture 6: Selection of the PLC runtime for the simulation
First steps 7:
Picture 7: Created symbol framework for the simulation project

As the Picture 7 shows, the TwinCAT Simulation Manager code generator generates synonymous symbols with the same name originating from the original project within the simulation project. The TwinCAT Simulation Manager will take advantage of this during computing the default mappings (connecting Original to Simulation symbols) later on.

Inserting an existing Simulation PLC Project

Inserting an existing simulation project can be done as follows.

  1. Adding the target system to the list of project systems with calling "Edit -> Select target systems" within the main menu (Picture 3 and Picture 4).
  2. Calling "Edit->PLC project mappings" within the main menu (Picture 8)
  3. Assignment of the Simulation project to it's appropriate original PLC project (Picture 9).
First steps 8:
Picture 8: Activating the "Plc Project Mappings" Dialog
First steps 9:
Picture 9: Mapping the Original PlC to the Simulation PLC

Configuration of the simulation mode

The project state is now as follows:

The original and simulation target systems are designated and at least the interfaces of the simulation functionality generated. For supporting not existing hardware, the simulation settings must be adjusted. That means:

The devices will be disabled like shown in Picture 10 and Picture 11. The red 'S' marks the hardware that is deactivated in simulation mode.

First steps 10:
Picture 10: Deactivation of the nonexistent hardware
First steps 11:
Picture 11: Disabled hardware

The simulation of Axes will be configured via the Context Menu within the Axis list view (Picture 12).

First steps 12:
Picture 12: Simulation of Axes and Drives

Finally, the created or added simulation PLC projects must be bound to the orginal PLCs. There are two options to do this task:

  1. Manually adjustment Symbol by Symbol or
  2. Using a default mapping algorithm
First steps 13:
Picture 13: Simlation Symbols without mapping to the original PLC

The manual configuration works simply be clicking the checkboxes (or context menu) on the appropriate symbols (see Picture 13) within the mapping targets view (upper right-hand-side list box). Dependent of the selection of the symbol in the left-hand-side "Configuration" navigation tree the mapping targets view collects all "Original" or "Simulation" symbols with the same datatype within its list. Potentially every single symbol of these target symbols can be bound to the source symbol.

The automatic configuration happens if "Create Default Mappings" is activated from the "Edit" main menu of the TwinCAT Simulation Manager (Picture 14). This functionality iterates over all Symbols within the original PLC projects and binds it to simulation symbols of the same symbolic name / access path, same datatype but reversed location (see Picture 15). This should be the default option because it ends up with a good standard configuration that can be fine tuned manually afterwards.

First steps 14:
Picture 14: Automatic creation of default mappings
First steps 15:
Picture 15: Simulation mappings set to the original Symbols

Switching the Simlation-Machine-Modes (Original <--> SImulation)

If the configuration of the Simulation project is complete, the the mode of the system can be switched to Simulation Mode and back by simple Activation over the Main Menue "Edit --> SimulationMode" or the Simulation Symbol within the TwinCAT Simulation Manager ControlBar.

Because the switchover process includes several steps that usually need (safety) confirmation(s), the TwinCAT Simulation Manager volunteers the User by an intelligent Machine configuration wizard step by step.

The descriptions of this wizard and the specifics of the machine reconfiguration and restarting can be found here:

Resetting the simulation settings

The Simulation settings can be removed from the main menu "Edit--> Reset Simulation Settings ..."