PLCSIM Advanced (Pro)
Connecting virtual Siemens PLCs with realvirtual.io
This Interface is only available in realvirtual.io Professional
Introduction
PLCCSIM-Advanced is a virtual PLC from Siemens. PLCCSIM-Advanced can be used to simulate S7-1500 PLCs. If you use PLCSim-Advanced no real PLC is needed.
PLCCSIM-Advanced will work in a multi-threaded mode by starting a parallel .exe command line programm. The PLCCSIM-Advanced interface will only work in Windows environments.
Please check the Siemens Website for more information about PLCCSIM-Advanced: https://w3.siemens.com/mcms/automation-software/de/tia-portal-software/step7-tia-portal/simatic-step7-options/s7-plcsim-advanced/seiten/default.aspx
Here is a short Youtube Tutorial showing you the interface in action:
Interface configuration
For using the PLCSim-Advanced Interface, you need to add an interface to your scene by selecting Tools > realvirtual> Add Component > Interface > PLCSIMAdvanced or you add the Script SharedMemoryInterface to an empty Gameobject.
For working in a Unity Build, this interface requires Allow unsafe Code to be turned on in Player Settings.

Automated Setup Process
As a prerequisite, you need to have PLCSIM-Advanced installed on your computer. Starting with version 6.0.7, the setup process has been greatly simplified with a single-click automated setup system.

The automated setup performs two steps automatically:
Auto-detect Siemens DLL: The system automatically searches for the Siemens.Simatic.Simulation.Runtime.Api.x86.dll in four common installation paths. API 3.0 is checked first and preferred over API 2.0:
C:/Program Files (x86)/Common Files/Siemens/PLCSIMADV/API/3.0/ (checked first)
C:/Program Files (x86)/Common Files/Siemens/PLCSIMADV/API/2.0/
C:/Program Files/Common Files/Siemens/PLCSIMADV/API/3.0/
C:/Program Files/Common Files/Siemens/PLCSIMADV/API/2.0/
The detected path is used as an installation check only — the DLL is no longer copied anywhere.
Download PLCSimAdvancedCoupler.exe: If not already present, the system automatically downloads the required coupler executable from the realvirtual repository.
Delete an old Siemens DLL from StreamingAssets. Earlier versions copied Siemens.Simatic.Simulation.Runtime.Api.x86.dll into the StreamingAssets folder as a third setup step. The coupler now loads the PLCSIM Advanced API that is actually installed on the machine, and a copy next to the executable shadows it — typically with the message "PLCSIMAdvanced Runtime Not available". If the file is still in your StreamingAssets folder, delete it. The interface writes a warning to the console when it finds it.
The InfoBox at the top of the inspector provides real-time feedback during setup:
⚠ Warning: Indicates setup is required or incomplete
ℹ Progress: Shows current operation in progress with detailed status
✓ Complete: Confirms setup is finished and ready to use
Simply click the "Setup PLCSim Advanced Interface" button to start the automated setup process. The system will display progress for each step, and the entire process typically completes in 40-70 seconds.
Connection Configuration
After setup is complete, configure the connection parameters:

For connecting you need to define the PLCCSIM-Advanced Instance Name as well as the synchronization cycle in Ms under Sync Cycle Ms:
If you select Pause With Unity, PLCCSIM-Advanced will pause as long as Unity is paused.
DebugMode turns on a special debug mode, where all signals are also displayed in the command line prompt. This might take quite a time during the simulation start. Please turn this off for productive use.
If HMIOnly is turned on, only variables which are marked as HMI variables in the PLC project itself are imported.
You are now able to import the Signals of PLCSim-Advanced by selecting Import Signals. All PLCSignals will be created automatically as sub-objects under the interface.
After importing the Signals you can start the simulation. The signals will be exchanged between Unity and PLCCSIM-Advanced automatically.
Signal Import Filter
Large PLC programs often contain many thousand signals, but a simulation usually needs only a small part of them. Every imported signal becomes a GameObject below the interface, so importing all of them makes entering play mode noticeably slower. With the signal import filter you decide which signals are imported at all.
Turn on Use Signal Filter to activate the filter:
Import Include Filters – A list of regular expressions. A signal is imported when its name matches at least one of the patterns. An empty list imports all signals.
Import Exclude Filters – A list of regular expressions. A signal matching any of these patterns is never imported. The exclude patterns are applied after the include patterns.
Filter Ignore Case – Matches the patterns without regarding upper and lower case.
Signals Imported / Signals Filtered – Show how many signals the last import created and how many were skipped.
Filtered signals are skipped before the GameObject is created, so they exist neither in the scene nor in the cyclic signal exchange.
Typical patterns:
^HMI_
all signals starting with HMI_
Conveyor.*Speed
Conveyor1Speed, Conveyor_12_Speed, …
^Axis[0-9]+_
Axis1_Pos, Axis12_Speed, …
^Diag_
as an exclude pattern: all diagnostic signals
If a scene was already imported without a filter, define the filter and use Delete Signals Not Matching Filter to remove the signals which are no longer needed. Signals referenced by drives, sensors or scripts lose their connection when they are deleted, so the button asks for confirmation.
Importing Data Block Tags
By default the interface exchanges the process image only — inputs and outputs. Many TIA projects keep the values a simulation needs in global data blocks instead: setpoints, recipes, status words or a dedicated HMI interface DB. Those tags are imported on demand.
Enter the exact data block names in Import Data Blocks:
Use the block name as it appears in TIA Portal, without quotation marks and without wildcards. Siemens only accepts exact names.
A name that does not exist in the PLC program is ignored silently by PLCSIM Advanced. The coupler window therefore prints how many tags each requested block contributed — a block with
0 entriesis almost always a typo or a wrong upper/lower case spelling.Data Block Tags Imported shows how many data block tags the last import created.
Names containing
;,"or\cannot be passed to the coupler and are rejected with an error message.
Leave the list empty to keep the previous behaviour: only inputs and outputs are exchanged.
Direction: the signal type decides
The PLC cannot tell whether your simulation reads a data block tag or writes it, so the signal component below the interface decides — exactly like the S7 TCP/IP interface handles DB addresses:
PLCOutput… (PLCOutputBool, PLCOutputInt, PLCOutputFloat)
The simulation reads the tag from the PLC. This is the default for newly imported tags.
PLCInput… (PLCInputBool, PLCInputInt, PLCInputFloat)
The simulation writes the tag into the PLC.
To turn a tag into one the simulation writes, remove the PLCOutput… component from its GameObject and add the matching PLCInput… component instead. Keep the GameObject name unchanged — it is the PLC tag name. The new direction takes effect with the next import, which also happens automatically every time you enter play mode.
Change the direction in edit mode only. The direction of the running exchange is frozen at import time, so swapping a component while the simulation runs has no effect until the next import.
If the data type of a tag changed in TIA Portal (for example INT to REAL), the old signal component is still on the GameObject. The import reports such a tag with an error and skips it — delete the outdated component on that GameObject and import again.
Writing and reading the same tag
A tag the simulation writes is not read back while it is written: the value from Unity wins, and PLC writes through the API take effect at the cycle control point. Do not write a tag from the PLC program and from the simulation at the same time; decide per tag which side owns it.
Limits
Tag list size: PLCSIM Advanced reserves memory for up to 500 000 tag list entries, and every array and structure element counts. Importing whole data blocks with large arrays can exceed this and makes the API report
NotEnoughMemory(-43). The coupler then falls back to HMI-visible tags only and says so in its window. Import fewer blocks, or mark the needed tags as Accessible from HMI in TIA Portal and turn on HMI Only, which applies to data block tags as well.Supported types: BOOL, BYTE, WORD, DWORD, INT, DINT and REAL. Whole structures and arrays cannot be accessed by the API, so only their primitive elements are imported. 64-bit types (LINT, LREAL, LWORD) are not transported for data block tags, because they cannot be written safely through the 4-byte exchange slot.
Failsafe data blocks: Variables in F-DBs and F-I/O DBs can only be changed while safety mode is deactivated (SIMATIC Safety — Configuring and Programming, chapter 10.7.4). Writing them from the simulation has no effect during safety operation.
Importing more than 2000 signals writes a warning to the console. Scenes with many thousand signal GameObjects take significantly longer to enter play mode — use the filter to keep the number of imported signals low.
Compatibility and Automatic Recovery
Input write permissions
The interface and PLCSimAdvancedCoupler.exe must use matching shared-memory protocol versions. The updated interface requires protocol 1 and refuses to start an older coupler. Update both files together. An incompatible download is rejected and the existing executable is retained.
The other direction is covered as well: a coupler 6.1.12 or newer also serves interfaces of realvirtual versions before 6.3.6. It notices within a few seconds that such an interface publishes no write permissions and then exchanges the inputs exactly as the earlier couplers did, so the public download link can always carry the current coupler without breaking older installations. The coupler window reports this as Legacy client detected; the per-input write permissions described below need the current interface.
Only imported inputs with Active enabled are written to the PLC. Excluded or inactive inputs are left untouched; disabling an input does not reset its value in the PLC. Writes start after the interface has transferred a complete set of values and permissions. Importing signals or rebuilding the connection does not by itself enable input writes.
Usage example
Import the required PLC tags, then assign the generated signal to your simulation component. For example, a simulated sensor can supply an input during initialization and subsequent physics updates:
Assign the signal before entering Play mode. Use Import Include Filters to select only the inputs your model supplies. Set Active to false to stop writing an individual input after the next interface update. PLC outputs remain readable.
Siemens also supplies a Visual Studio co-simulation example under Entry 109739660: S7-PLCSIM Advanced Getting Started. It demonstrates API-based sensor updates; it is not a dedicated Safety test example.
For F-inputs, explicitly identify the channel and its value-status signal from your TIA project. The interface does not identify Safety tags automatically or set them to true. Any simulated channel fault must use the appropriate channel/value-status combination. These semantics and the distinction between F-input simulation and modifying F-DBs are described in Siemens: Testing the Safety program with S7-PLCSIM/S7-PLCSIM Advanced.
The write-permission correction addresses general input handling. A project-specific Safety failure has not been reproduced.
The coupler is tolerant of the installed PLCSIM Advanced version. It automatically loads with a compatible API version, so the same build connects whether you run an older PLCSIM Advanced installation or a current V8 runtime — no manual DLL selection is required for the connection to succeed.
When you download a changed program from TIA Portal onto the running PLC, the interface no longer stops. Signal exchange is paused while the download is in progress, and the interface automatically reconnects and re-imports the (possibly changed) signals once the download has finished.
For diagnostics the coupler writes a coupler.log next to PLCSimAdvancedCoupler.exe. It records the loaded API version, the running Runtime Manager version and any communication errors — send this file if you ever need support. The previous run is preserved as coupler.prev.log.
Which interface?
realvirtual offers three ways to work with PLCSIM Advanced:
PLCSIM Advanced (this page) – the coupler interface. The Siemens API runs in the separate coupler process, so a problem in the Siemens library cannot end Unity. It stays fully supported for existing and new projects.
PLCSIM Advanced Native (Pro) – preview of an in-process interface that uses the native Siemens runtime API without a coupler process or download. The Siemens backend of its plugin is not included yet.
realvirtual CONNECT – for realvirtual WEB, without Unity.
Never connect the coupler interface and the native interface to the same PLCSIM Advanced instance at the same time.
© 2025 realvirtual GmbH https://realvirtual.io - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher.
Last updated