For the complete documentation index, see llms.txt. This page is also available as Markdown.

PLCSIM Advanced Native (Pro)

Connecting Siemens PLCSIM Advanced in-process through the native Siemens runtime API (preview)

Overview

The PLCSIM Advanced Native interface connects your realvirtual simulation to a running Siemens PLCSIM Advanced instance inside the Unity process. It uses the official native Siemens runtime API through the realvirtual plugin rv_plcsim.dll — there is no external coupler process, no shared memory and no coupler download. The Siemens API DLL is loaded from your PLCSIM Advanced installation at runtime and is never shipped with realvirtual.

The interface is built on the realvirtual FastInterface standard: it reconnects automatically, shows the connection state in the Inspector and exchanges all signals once per communication cycle as one batch. It works in the Unity Editor and in Windows x64 builds (Mono and IL2CPP).

It exists next to the PLCSIM Advanced coupler interface, which stays fully supported for existing projects. See Which interface? below.

Requirements

  • Windows x64, Unity Editor or Windows Standalone build

  • Siemens PLCSIM Advanced installed on the same computer, including the API folder matching the plugin (API\6.0; PLCSIM Advanced V6, V7 and V8 install it). The Siemens API interfaces are not compatible between major versions, so the plugin only uses the API version it was built for. If only other versions are installed, the Inspector names the required and the found versions.

  • A running PLCSIM Advanced instance (started from the PLCSIM Advanced Control Panel or by a TIA Portal download)

Quick Start

  1. Select Tools > realvirtual > Add Interface > PLCSIM Advanced Native (Pro), or add the component realvirtual > Interfaces > PLCSIM Advanced (Native) to an empty GameObject.

  2. Check the setup box. The interface detects the Siemens API automatically; click Detect Siemens API to search again or Select DLL... to pick Siemens.Simatic.Simulation.Runtime.Api.x64.dll manually.

  3. Enter the Instance Name exactly as shown in the PLCSIM Advanced Control Panel.

  4. Click ⬇️ Import Signals. One signal GameObject is created per supported PLC tag.

  5. Connect the signals to your Drives, Sensors and Behaviors and press Play.

Key Properties

Instance Name (string) The name of the PLCSIM Advanced instance the interface attaches to.

Siemens API DLL (string) Path to the Siemens runtime API DLL (x64). It is filled automatically from the PLCSIM Advanced installation. Before loading, the plugin checks that the file is a 64-bit DLL with the expected Siemens entry points and a valid digital signature by Siemens AG.

Detected API Version (string, read-only) The API version folder that matches the native plugin.

Import Hmi Tags Only (boolean) Imports only tags marked as HMI-visible in TIA Portal. Keep this on for large programs to limit the number of signals.

Import Data Blocks (boolean) Also imports tags from data blocks. Data blocks can contain very many tags, so enable this only when you need them.

Start Stop With Unity (boolean) Sets the PLC instance to RUN when play mode starts and to STOP when it ends.

Pause With Unity (boolean) Freezes the virtual time of the PLC while Unity is paused (Editor pause button or application pause). The PLC stays in RUN and continues exactly where it stopped when you resume. The interface stays connected during the pause. When the interface disconnects, the PLC returns to its normal operating mode and keeps running on its own.

Update Cycle Ms (integer) The communication cycle in milliseconds (default 10).

Setup Status, PLC Status, Disabled Signals, Tag Errors, Resync Count (read-only) Show the plugin and Siemens API status, the connection and PLC operating state, signals whose binding was disabled after a TIA change, tags that currently report an error, and how often the interface re-synchronized after a PLC change.

Test Connection (button) Attaches to the instance once in Edit Mode, reports the operating state and detaches again.

Signals

Tags are addressed by name, never by absolute address, so recompiling the TIA project does not break the connection. The direction is decided by the memory area of the tag:

PLC tag
realvirtual signal
Direction

Input (I)

PLCInputBool / PLCInputInt / PLCInputFloat

Scene → PLC

Output (Q), marker (M), data block

PLCOutputBool / PLCOutputInt / PLCOutputFloat

PLC → scene

Supported data types are Bool, Byte, Word, Int, DWord, DInt and Real. Tags of other types are skipped with a warning. Values that do not fit the tag type (for example 70000 for an Int) are not written and produce one warning instead of a wrapped value.

Downloads from TIA Portal

When you download a changed program while the simulation runs, the interface re-synchronizes automatically without reconnecting:

  • New tags get new signals.

  • Unchanged tags keep running, and all inputs are written once completely so the PLC has the current scene values after the download.

  • Tags that changed type or direction are disabled: the signal keeps its component and its last value, is listed under Disabled Signals and produces a warning. Components that reference the signal stay valid. Run Import Signals in Edit Mode to update such signals.

  • Removed tags are disabled the same way and marked as tag missing.

In Edit Mode, Import Signals replaces a signal whose type or direction changed. If other components reference that signal, the import lists these references and asks before replacing it, because the references become invalid.

If a single tag reports an error, only that signal is marked under Tag Errors and a warning is logged; all other signals keep running.

Common Use Cases

  • Virtual commissioning without the coupler – Connect S7-1500 programs in PLCSIM Advanced where the external coupler process is blocked by virus scanner or firewall policies.

  • Pause and step through a scenario – Pause Unity to freeze the PLC time together with the scene and resume without a RUN/STOP change.

  • Iterative TIA development – Download program changes while the simulation runs; new tags appear automatically.

Which interface?

PLCSIM Advanced (coupler)

PLCSIM Advanced Native (preview)

Runs in

Unity, via the external coupler process

Unity process

CONNECT gateway

Setup

Siemens DLL detection + coupler download

Siemens API detection only

CONNECT configuration

Crash isolation

Siemens API isolated in the coupler

a crash in the Siemens library ends Unity

separate process

Status

supported

preview

supported

Never connect the coupler interface and the native interface to the same PLCSIM Advanced instance at the same time.

See Also

Last updated