Connecting Siemens NX MCD to S7-1200 OPC UA, PLCSIM, SIMIT HIL

David Krause13 min read
Other TopicSiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview: Why Couple NX MCD with a SIMATIC S7-1200

Siemens NX Mechatronics Concept Designer (MCD) is a digital-twin environment inside the NX CAD/CAE platform that lets engineers design, simulate, and validate mechanical behavior, kinematics, sensors, and actuators before any physical hardware exists. Coupling NX MCD to a real SIMATIC S7-1200 controller closes the loop with the actual PLC logic, turning a kinematic model into a true Hardware-in-the-Loop (HIL) commissioning platform.

The S7-1200 family (including the new SIMATIC S7-1200 G2 generation) exposes the control logic in TIA Portal, while NX MCD consumes or produces the I/O signals that drive the virtual machine. Three integration paths are field-proven and documented by Siemens:

  • Native OPC UA using the S7-1200's built-in OPC UA server (firmware V14 SP1 and later) and NX MCD's built-in OPC UA client.
  • OPC DA using PLCSIM Advanced and a third-party OPC bridge (KEPServerEX or MatrikonOPC) when only a simulation instance of the PLC is available.
  • SIMIT + NX MCD co-simulation, the official Siemens virtual-commissioning framework documented in the SIMIT/NX MCD guideline.

The choice depends on whether you have real PLC hardware, the firmware version, license availability for PLCSIM Advanced, and whether the project requires a 21-day trial-only PLCSIM instance or a permanent development environment.

Prerequisites

Component Minimum Version / Specification
Siemens NX NX 1980 / 2000 series with Mechatronics Concept Designer license
S7-1200 CPU Firmware V4.2 (S7-1200) or V1.0+ (S7-1200 G2) for native OPC UA; V4.0+ for S7 communication
TIA Portal V15.1 or newer (V17 / V18 recommended); V20 for S7-1200 G2
PLCSIM Advanced V3.0 or V4.0 (separate license, 21-day trial available)
SIMIT V11 with NX MCD coupling library (SIMIT Component for NX MCD)
KEPServerEX V6.x with Siemens TCP/IP Ethernet driver (only for legacy OPC DA path)
OPC UA server on S7-1200 Activated in TIA Portal under "Device configuration > OPC UA > Server"
KTP700 HMI Firmware V14 or later; TIA Portal V15.1+ project integration
License note: PLCSIM Advanced runs in a 21-day trial if unlicensed. For continuous MCD development, prefer either a licensed PLCSIM Advanced instance, an OPC UA direct link to a real S7-1200, or SIMIT. The 21-day limit applies only to PLCSIM Advanced, not to OPC UA on a physical CPU or to the NX MCD side.

Communication Architecture Options

Method PLC Side Bridge / Middleware NX MCD Side Use Case
OPC UA Direct Real S7-1200 with OPC UA server enabled None (TCP port 4840) Built-in OPC UA client in NX MCD (MCD acts as subscriber/publisher) Permanent HIL, no extra licenses, modern firmware
OPC DA via PLCSIM Advanced PLCSIM Advanced instance (no real hardware) KEPServerEX (Siemens TCP/IP driver) or MatrikonOPC OPC DA client in NX MCD No real PLC, PLCSIM Advanced licensed or in trial
NetToPLCsim + KEPServer PLCSIM (V5.x, free) instance NetToPLCsim (open source) + KEPServerEX OPC DA client in NX MCD Budget setups without PLCSIM Advanced
SIMIT Co-Simulation PLCSIM Advanced OR real S7-1500/1200 (SIMIT supports S7-1200 via SIMIT Unit) SIMIT (Siemens), optional NX MCD coupling NX MCD via SIMIT's NX connector (SHM or TCP) Reference architecture; complex plant simulation with model-sharing

When to choose which path

  • Use OPC UA Direct when the S7-1200 is real, firmware is V14 SP1+, and you want a clean IP-based connection with no third-party software. NX MCD can subscribe to tags and read/write them in real time.
  • Use OPC DA via PLCSIM Advanced when you have no real PLC and a licensed (or trial) PLCSIM Advanced instance is available. This is the path Siemens Community contributors confirm for S7-1500 and is fully applicable to the S7-1200.
  • Use SIMIT for production-grade virtual commissioning where you need a SIMIT Unit to expose the S7-1200 to a virtual plant; SIMIT also provides libraries for NX MCD co-simulation as documented in the official Siemens guideline.

Method 1: Direct OPC UA Connection (Recommended)

The S7-1200 OPC UA server has been available since firmware V4.2 (TIA Portal V14 SP1). The S7-1200 G2 extends this with discovery and security profiles described on the SIMATIC S7-1200 G2 product page.

Step-by-step: Enable OPC UA on the S7-1200

  1. Open the TIA Portal project containing the S7-1200.
  2. Right-click the CPU in the project tree and select Properties > OPC UA > Server.
  3. Check Activate OPC UA Server.
  4. Set the server port to 4840 (default) or any free TCP port above 1024.
  5. Under Security policies, choose at least None for lab use, or Basic128Rsa15 / Basic256Sha256 for production. The S7-1200 G2 supports up to Aes128Sha256RsaOaep.
  6. Under User authentication, enable Enable guest authentication only for development; create individual users for production.
  7. Compile and download the configuration to the PLC.
  8. Verify the server is reachable: from a Windows PowerShell on the same subnet run Test-NetConnection -ComputerName <PLC_IP> -Port 4840. The result should be TcpTestSucceeded : True.

Step-by-step: Connect NX MCD as OPC UA Client

  1. In NX MCD, open the Signals node of the mechatronics model.
  2. Right-click External Signals and choose New OPC UA Connection.
  3. Enter the discovery URL: opc.tcp://<PLC_IP>:4840.
  4. Browse the server namespace and select the PLC tags to expose to the kinematic model. Each tag is mapped to a Signal in MCD's signal table.
  5. Map signals to NX MCD objects: for example, a boolean "Conveyor_Run" PLC tag drives a MCD Signal Adapter connected to a Rigid Body's velocity source; a real "Axis_Position" (REAL, MD) is published back to the PLC from a MCD Sensor or runtime value.
  6. Set the Publishing Interval in NX MCD's connection settings to 50–100 ms for motion control loops; 200 ms is acceptable for visualization-only coupling.
  7. Start the simulation. NX MCD reads/writes signals over OPC UA; the S7-1200 logic reacts in real time on its cycle (typically 1–10 ms OB1).
Cycle mismatch warning: The S7-1200 OB1 is typically 1–10 ms; NX MCD simulation steps are usually 1–4 ms. Always expose the position feedback as the leading signal and let the PLC close the loop on it, not the inverse. Use the S7-1200's MC_Power, MC_MoveAbsolute, and MC_MoveVelocity motion control blocks from the PLC Open library for tight axis control.

Method 2: PLCSIM Advanced + OPC DA Bridge

This path is widely documented for the S7-1500 and works identically for the S7-1200 once the program is loaded into a PLCSIM Advanced instance. KEPServerEX acts as the OPC DA server that NX MCD subscribes to.

Step-by-step

  1. Install PLCSIM Advanced (V3.0+). Launch the management console and start a new instance. Note the instance's IP (e.g., 192.168.1.10) and the S7 communication port 102.
  2. From TIA Portal, perform an Online > Extended Download to Target Device; choose PLCSIM Advanced as the target interface.
  3. Install KEPServerEX (or MatrikonOPC). Add a channel of type Siemens TCP/IP Ethernet.
  4. Add a device, set the IP to the PLCSIM Advanced instance address, and set the rack/slot to 0/1 for S7-1200.
  5. Auto-discover tags or manually add them; ensure the OPC DA server is running on the default port 49320.
  6. In NX MCD, create an OPC DA Connection, point it to localhost (or the KEPServerEX host), and browse the tags.
  7. Run the simulation: TIA Portal's PLCSIM Advanced should be in RUN mode, NX MCD's OPC client should show green "Connected" status, and signal values should change in both directions.
Tip: If you do not have a PLCSIM Advanced license, the same architecture works with the free PLCSIM V5.x + NetToPLCsim (open source) which bridges a real network interface to the simulated PLC. The community has confirmed this combination for both S7-1500 and S7-1200, but you still need KEPServerEX (or an alternative OPC DA server) to expose tags to NX MCD.

Method 3: SIMIT-Based Virtual Commissioning (Siemens Reference)

Siemens publishes a detailed reference architecture for coupling NX MCD, SIMIT, and a SIMATIC controller. The PDF "Guideline – Virtual Commissioning with SIMIT, NX MCD and S7" (entry ID 109963864 in the Siemens Industry Online Support) describes the full flow:

  1. Model the mechatronic system in NX MCD, exposing inputs (e.g., sensors, switches) and outputs (e.g., motor torque, conveyor speed) as MCD signals.
  2. In SIMIT, build a virtual plant using SIMIT libraries. SIMIT reads MCD signals over the NX MCD coupling (Shared Memory SHM on a local machine, or TCP via the NX MCD external connection).
  3. Add a SIMIT Unit for S7-1200/1500 that exposes the PLC program to the virtual plant via PLCSIM Advanced or a real S7 controller.
  4. Download the TIA Portal project to the SIMIT Unit. SIMIT then exchanges I/O with NX MCD, and the controller logic — running in PLCSIM Advanced or on a real S7-1200 — reacts as if it were wired to real sensors and actuators.
  5. Use SIMIT's Control Desk for operator override (start/stop, fault injection) without breaking the HIL link.

This is the architecture most academic and industrial virtual-commissioning teams adopt. Reference implementations appear in the IEEE paper "PLC Inverse Kinematics Model-Driven Digital Twin Focused on HIL" (2024), which implements the inverse kinematics in an S7-1200 controlled by TIA Portal and validated through NX MCD.

NX MCD Signal Mapping and Tag Configuration

Tags in the S7-1200 are referenced by data-block and offset. NX MCD does not natively understand S7 symbolic addressing, so the OPC server must expose each tag by its fully qualified name. Typical tag-naming convention in TIA Portal:

DB_Conveyor".Conveyor_Run" : BOOL
DB_Axis".Axis_ActualPosition" : REAL
DB_Axis".Axis_SetpointVelocity" : REAL
DB_Safety".E_Stop_OK" : BOOL

Recommended signal categories in NX MCD:

NX MCD Object Source / Sink S7-1200 Tag (Example) Data Type
Signal Adapter → Rigid Body velocity Sink (PLC → MCD) DB_Axis.Axis_SetpointVelocity REAL (mm/s or rad/s)
Sensor (Position, Collision) output Source (MCD → PLC) DB_Axis.Axis_ActualPosition REAL
Boolean Sensor (e.g., limit switch hit) Source (MCD → PLC) DB_Conveyor.LimitSwitch_1 BOOL
Signal Adapter → Runtime Kinematics enable Sink (PLC → MCD) DB_Conveyor.Conveyor_Run BOOL
Collision Sensor Source (MCD → PLC) DB_Safety.Collision_Detected BOOL

For motion control, expose the S7-1200's TO (Technology Object) axis data blocks (e.g., DB_Axis_1) so that the axis actual position and actual velocity are visible to NX MCD in real time. Use the MC_Servo and MC_Power blocks; the actual position in the TO data block is updated every position-control cycle (typically 1 ms on the S7-1200, 250 µs on the S7-1200 G2 with the new fast PTO).

KTP700 HMI Integration Considerations

The KTP700 Basic Panel is fully supported on the S7-1200 with TIA Portal V15.1+. When the PLC is being driven by NX MCD, the HMI displays real values because the HMI reads from the same data blocks the OPC UA / OPC DA server is exposing. There is no conflict between HMI polling and NX MCD polling — both are read-only consumers.

  • HMI connection: PROFINET to the S7-1200 CPU. Standard update cycle on the KTP700: 100 ms (set in the HMI connection properties).
  • Avoid putting NX MCD and the HMI on the same PROFINET interface if you want to isolate the HIL traffic; use a second Ethernet port on the engineering PC.
  • For operator override from the HMI (e.g., jog buttons), those write to the same tags that NX MCD reads, so the MCD virtual machine reacts. Be careful: a jog command and a MCD-driven setpoint on the same axis will fight unless prioritized in the PLC logic.

Verification and Commissioning Procedure

  1. OPC UA reachability: Test-NetConnection -ComputerName <PLC_IP> -Port 4840 returns True.
  2. Tag visibility: Use Siemens' free OPC Scout V10 (in TIA Portal installation media, Siemens\Automation\OPC\OPC_ScoutV10) to browse the S7-1200 server and confirm each tag is listed with the correct data type.
  3. NX MCD connection status: In the Signals panel, the OPC UA connection shows a green check and a non-zero publishing rate.
  4. Round-trip latency: Toggle a digital output from the PLC, observe the corresponding NX MCD signal; latency on a Gigabit LAN should be < 20 ms. If higher, increase the OPC UA publishing interval or check the PC's CPU load.
  5. Motion test: Command the S7-1200 to move an axis using MC_MoveAbsolute and verify in NX MCD that the rigid body position tracks the actual position tag from the TO data block.
  6. Fault injection: In SIMIT Control Desk, force a sensor to FALSE and confirm the PLC's safety logic trips as expected.

Troubleshooting Matrix

Symptom Likely Cause Resolution
NX MCD cannot find any tags on the OPC UA server S7-1200 OPC UA server not activated, or server port blocked by Windows Firewall Verify in TIA Portal > Device configuration > OPC UA > Server. Allow inbound TCP 4840 in the firewall. Test with OPC Scout V10 first.
Tags visible but values are 0 / stale PLC is in STOP, or the tag's DB has not been downloaded Switch the CPU to RUN; recompile and download the entire TIA project; check the DB instance in PLCSIM/PLCSIM Advanced.
OPC DA path: KEPServerEX cannot connect to PLCSIM Advanced PLCSIM Advanced not started, or wrong IP/port, or PG/PC interface set to S7ONLINE instead of PLCSIM Start the PLCSIM Advanced instance; set the device IP in KEPServerEX to the PLCSIM instance address; in TIA Portal set the PG/PC interface to PLCSIM Advanced for download.
SIMIT + NX MCD: simulation runs but signals do not change Shared Memory (SHM) not enabled, or SIMIT is reading from the wrong NX MCD instance Enable SHM in the NX MCD project; in SIMIT, set the NX coupling to the same SHM name; restart both.
PLC trips SF (System Fault) shortly after NX MCD start Tag types mismatch (e.g., MCD sends INT, PLC expects REAL) Verify each tag's data type in the OPC namespace against the PLC data block; align types.
Position in NX MCD drifts relative to PLC axis Loop closed on the wrong signal (e.g., MCD setpoint instead of PLC actual position) Always have the PLC close the motion loop on the TO actual position; NX MCD should be a passive observer or a setpoint source only.
High latency / jitter on HIL link Wi-Fi between PC and PLC, or PC has anti-virus scanning OPC traffic Use wired Ethernet; add the OPC UA port and KEPServerEX process to AV exclusions; cap NX MCD's publishing rate to 50 ms.

Field-Commissioning Notes and Best Practices

  • S7-1200 vs S7-1200 G2: the G2 doubles the OPC UA throughput and adds discovery, but the configuration flow in TIA Portal V20 is identical. Use the G2 for any new HIL project that needs 250 µs position control.
  • License choice: For an evaluation period of 21 days, use OPC UA direct (free) with a real CPU you already own. If you have only simulation, use the PLCSIM Advanced trial and KEPServerEX. After the trial, move to a licensed PLCSIM Advanced, or invest in SIMIT for permanent use.
  • Cycle-time budget: The S7-1200 OB1 typically runs 1–10 ms. Do not push more than 100 signals at the 1 ms OPC UA publishing interval; 50 ms is the safe default for plant-scale models.
  • Safety: Never connect a live safety circuit to NX MCD signals. Use SIMIT or a hard-wired E-stop that bypasses the HIL loop for real plant commissioning.
  • Versioning: Pin the TIA Portal project, NX MCD model, and SIMIT library versions in a single engineering change document. OPC UA namespace is stable across firmware updates, but tag names change when DBs are refactored.

Can I use a real S7-1200 directly with NX MCD without PLCSIM Advanced?

Yes. Enable the OPC UA server on the S7-1200 (firmware V4.2+, TIA Portal V14 SP1+) and connect NX MCD's built-in OPC UA client to opc.tcp://<PLC_IP>:4840. No third-party software or PLCSIM Advanced is required.

What is the minimum firmware version on the S7-1200 for OPC UA server?

Firmware V4.2 (TIA Portal V14 SP1) introduced the OPC UA server. The S7-1200 G2 (firmware V1.0+) extends it with discovery and stronger security profiles. Earlier firmware versions must use S7 communication via KEPServerEX or NetToPLCsim.

Is KEPServerEX mandatory?

No. KEPServerEX is only required for the legacy OPC DA path. With the S7-1200's native OPC UA server and NX MCD's OPC UA client, KEPServerEX is unnecessary. SIMIT also removes the need for KEPServerEX because it has its own S7 and NX MCD couplings.

Can I keep using PLCSIM (V5.x, free) instead of PLCSIM Advanced?

Yes, by adding NetToPLCsim (open source) to bridge the local S7ONLINE-only PLCSIM onto a real network interface, and KEPServerEX to expose tags as OPC DA. This is the lowest-cost path but requires more configuration than the OPC UA direct path.

Does the KTP700 HMI interfere with the NX MCD link?

No. The HMI is a read-only consumer of the same data blocks that the OPC server exposes. Both can poll the PLC simultaneously. Avoid driving the same axis with a jog button on the HMI and a MCD setpoint in the PLC at the same time, as the two commands will compete.

Back to blog