TwinCAT Simulation Manager

The 'TwinCAT Simulation Manager' is a powerful tool for simulating machines or machine systems.
There is a requirement in various scenarios for the partial or complete simulation of a production machine or plant:
- Development
Hardware and software are developed in parallel, usually by different people, or often become available at different times. A simulation environment is indispensable for testing the plant/machine in sections. The 'TwinCAT Simulation Manager' supports the creation of a "virtual machine", which corresponds to the real machine in its performance characteristics. Due to the integration of the simulation in the real-time system, even real-time-critical requirements can be realised (real-time simulation).
--> The dependency of the software on the hardware is reduced. It is even possible to complete the software ahead of actual commissioning. The quality of the machine software is increased by developer tests. - Acceptance of software/machine before commissioning
The 'TwinCAT Simulation Manager' enables the implementation of acceptance rules in the simulation. This may be the normal operating performance of the machine / plant, or the testing of compliance with interface specifications or the simulation of faults. Those responsible for quality assurance are now armed with a powerful tool.
--> Assurance of quality levels - Commissioning the machine / plant
The commissioning of individual machine sections is enabled. Through advance tests (see Acceptance of machine/software before commissioning), more attention can be devoted to the parameterisation and optimisation of the machine.
--> The time required for commissioning is considerably reduced. - In productions
Machines / plant sections break down; material bottlenecks may arise. The 'TwinCAT Simulation Manager' is able to maintain the partial operation of the machine / plant through various profiles.
--> The machine / plant can be used more flexibly. - Education and Demonstration
The simulation of the hardware allows to execute the machine software purely virtual on a demo system which can be used to train the machine operator or service technician. Additionally suits the simulation system for demo purposes in different scenarios.
--> Supports the education of machine / plant users and service staff.
All these scenarios are supported by the TwinCAT Simulation Manager, which places an extensive range of tools for the creation and administration of simulation environments at the fingertips or the developer / plant operator:
- Administration and configuration of simulation environments / profiles
- Simulation of I/O devices and axes
- Simple and secure switchover into simulation mode
- "Virtual device" and "virtual function" libraries
- Automatic creation of a real-time capable simulation PLC project framework with symbols and commentaries taken over from the original project
- Use of all the options of the PLC programming environment, also in simulation code:
e.g. graphic programming, tracing, debugging etc.
Principle of operation
I/O devices and axes are initially connected to the PLC. If parts of the machine are to be simulated, then the devices in question must be deactivated. The performance of the relevant inputs and outputs must be replicated as exact as possible so that the machine PLC – henceforth referred to as the original PLC – can continue to perform its functions. This is carried out by the simulation PLC, which connects itself to the system in place of the inactive I/O devices.
For coupling, the mapping from the original PLC to the inactive device must be broken and rerouted to the simulation PLC. Deactivated axes are replicated by a simulation axis; any latch functionalities in the simulation PLC are implemented. Simulated axes are switched over to 'free running' in the 'TwinCAT Simulation Manager'.

The replication of the I/O functionality in the simulation PLC is simplified by a set of simulation blocks. Complex performance can be easily replicated by the mapping of these blocks and encapsulated in the POUs or reused.
TwinCAT realizes the data transfer between PLC and I/O typically via IO-Mappings. The TwinCAT System Manager creates these mappings and initializes the adequate memory copy instructions within the TwinCAT Runtime system (task-synchronized memory copy between process-images). This sort of mapping is only useable within a local scenario, which means within one single Resource / TwinCAT System or CPU where in-resource memory access to the process images is available.
In a distributed system environment - where several resources / CPUs are involved a different technology for the data exchange must be used. This could be realized via discrete wireing, a fieldbus or common network technology.
To support distributed as well as local scenarios the TwinCAT Simulation Manager uses internally an abstract mapping model that transparently hides the data-exchange protocol. The TwinCAT Simulation Manager chooses the appropriate protocol dependent on the location of the communication start- and endpoint.
Actually, the following protocols are supported:
- TwinCAT IO-Mappings for local in-ressource links / mappings (highest data throughput, limited by the cycle of the used task-master)
- Network Publisher-Subscriber Variables for remote links (EtherCAT Master-Master protocol, data througput limited by EtherCAT protocol and RT-Ethernet cycle)
By the transparent usage of remote devices, it is possible to deploy and execute the machine software (original software) and the simulation software freely on the available resources/CPUs. The system smoothly scales from local to highly distributed scenarios.