Configuration of OPC-Simulations
The OPC-Server offers to simulate process-values. In this case no communication to the ADS-device (like PLC) is done instead simulated values are send to OPC-client.
Different simulation templates like sinus, ramp, random etc. are available to be configured with detailed behaviour (amplitude, start /stop values).
The OPC-Server offers:
- simulation of all process values
- simulation of some specific process values
![]() | It is not possible to combine both simulated and real-process values. |
The usage of OPC-Conversions needs the configuration of a TPY-File (AutoCfgSymFile) for the corresponding device and AutoCfg 8.
Step 1: Configuration of OPC-Simulation in OPC-Server
In the first step you need to configure TwinCAT OPC-Server for conversions. This is a one-time configuration and does not need to be repeated when changes to the PLC project occur.
Start TwinCAT-OPC-Configurator "Start - All Programs - TwinCAT System - TwinCAT - TwinCAT OPC Configurator"
Navigate to "Simulations", right click and select menue "New".
For "Name" please enter a name for this simulation template. This name has to be OPC conform, no special characters allowed. With "OK" you get into the dialog to configure in details your new "Simulations Signal".
The following table gives an overview about all possible configuration settings.
Signal Type |
Beschreibung |
---|---|
0 : ReadCount |
|
1 : WriteCount |
|
2 : Random |
Random-Function |
3 : Ramp |
Ramp-Function |
4 : Sine |
Sinus-Function |
5 : Square |
Square-Function |
6 : Triangle |
Triangle-Function |
7 : Stepp |
Step-Function |
Disable |
Deactivates the simulation |
Save the configuration via "File" --> "Save As". After the configuration has been saved, you will be asked if this configuration should be set as the startup-configuration.
The configuration will be automatically activated on next restart of the OPC-Server.
Step 2: Configuration of PLC-Variables for OPC-Simulation
With previous steps we defined a "simulation-template" with detailed information about simulation handling. Now we define, which PLC variable should be handled with simulation. Similar to the Data Access feature, this configuration also occurs by adding comments to the PLC-project.
Beispiel:
![]() | Today just global PLC-variables can be linked to simulation-templates. Elements of structures or arrays can not be configured as an OPC-Simulation. |