Accessing Sinumerik 840D sl NC Variables from IOT2050 over S7

David Krause17 min read
OPC / OPC UASiemensTechnical Reference
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

Problem Definition: Reading Sinumerik 840D sl Variables from an IOT2050 on Legacy Firmware

Many retrofit projects require bringing a SIMATIC IOT2050 edge gateway into an existing Sinumerik 840D sl installation to expose machine data to higher-level MES, SCADA, or cloud systems. When the controller is running a pre-4.5 firmware such as 2.6 SP1 HF5 or 2.7 SP3 HF4, the integrated OPC UA server is not present, and the common drop-in OPC UA pattern used for newer controllers does not apply. The IOT2050 must instead reach the data through the embedded S7-300 PLC that ships inside every Sinumerik Solution Line and act as an S7 client plus OPC UA broker.

This article documents the engineering path for that scenario. It covers the OPC UA availability matrix for legacy 840D sl firmware, the network topology, the S7-300 / NC Varselector / PLC function block chain, the node-red flows pre-installed on the IOT2050, and the third-party gateways (Softing uaGate 840D, IBH Link UA) used when the PLC route is not available. The objective is to deliver deterministic access to NC variables, tool data, drive parameters, and HMI tags from the IOT2050 over both S7 and OPC UA.

Cut-off line. The OPC UA server embedded in Sinumerik 840D sl was introduced with Solution Line firmware 4.5. Power Line controllers and all 840D sl systems on firmware below 4.5 (including 2.6 SP1 HF5 and 2.7 SP3 HF4) do not expose an integrated OPC UA endpoint. Plan any OPC UA architecture around this cut-off.

Sinumerik 840D sl Firmware and OPC UA Availability Matrix

The integrated OPC UA server availability is tied to the Sinumerik Solution Line firmware train. The matrix below summarizes the supported paths for the firmware versions that typically appear in retrofit projects.

Firmware Train Example Version Integrated OPC UA Server Recommended Access Path from IOT2050
Solution Line < 4.5 2.6 SP1 HF5, 2.7 SP1 HF1, 2.7 SP3 HF4 No S7 client → integrated S7-300 → NC Varselector FBs / external OPC UA gateway
Solution Line = 4.5 4.5 SP2 / 4.5 SP4 Yes (limited node set) IOT2050 OPC UA client (node-red) directly against NCK and PLC namespaces
Solution Line >= 4.7 4.7 SP1, 4.8 Yes (full node set) IOT2050 OPC UA client; PLC and NCK addressable by NodeID
Power Line all No External OPC UA gateway only (Softing uaGate 840D, IBH Link UA, or S7 route via IOT2050 if S7-300 is present)

Service Packs (SP) and Hotfixes (HF) do not change OPC UA availability; they patch and stabilize the existing train. The 2.6.x and 2.7.x trains therefore remain OPC UA-less even after applying HF5 or HF4 respectively.

SIMATIC IOT2050 Edge Gateway Capabilities

The SIMATIC IOT2050 is a 35 mm DIN-rail edge device based on the TI AM6548 SoC. It runs the SIMATIC Industrial OS, a Yocto-based Linux that ships with a curated set of node-red flows, drivers, and protocols.

From the perspective of a legacy Sinumerik 840D sl installation, the relevant on-board capabilities are:

Capability IOT2050 / IOT2050 Advanced Used For
Ethernet ports 2 × 1 Gbit/s (Basic) or 2 × 1 Gbit/s + 1 × 1 Gbit/s (Advanced) Plant LAN, Sinumerik X120 / X130, separate management network
Protocol stack TCP/IP, ISO-on-TCP (port 102), S7 communication, Modbus TCP, OPC UA client, MQTT, AMQP, HTTPS S7-300 access, legacy SCADA, cloud brokers
Node-RED pre-installed Yes, with contrib nodes for S7 (node-red-contrib-s7comm), OPC UA (node-red-contrib-opcua), Modbus, MQTT Drag-and-drop flow engineering
Image variants Industrial OS (default) and Industrial Edge Management variants Container app management on Advanced
Time sync NTP client, IEEE 1588 optional on Advanced Aligned timestamps for OPC UA data

The reference deployment for a Sinumerik 840D sl retrofit uses two physical networks on the IOT2050: one port (X1 P1) attached to the machine network containing the Sinumerik X120 (operator panel) and the X130 (NC/PLC) interfaces, and the second port (X1 P2) on the plant LAN that carries OPC UA, MQTT, or HTTPS traffic to the SCADA / cloud broker. This dual-homed pattern is documented in the SIMATIC IOT2050 Industrial Edge Device commissioning manual.

System Architecture: From NC Kernel to IOT2050

The architecture is unidirectional for read traffic and bidirectional for write traffic. The IOT2050 acts as the S7 client (passive role 3) talking to the integrated S7-300 (server role 1) inside the Sinumerik 840D sl, which in turn executes the Siemens NC variable function blocks to read or write data on the NC kernel.

IOT2050 to Sinumerik 840D sl (FW 2.6 / 2.7) Data Path SCADA / Cloud OPC UA / MQTT SIMATIC IOT2050 node-red S7 + OPC UA + MQTT publisher Sinumerik 840D sl FW 2.6 SP1 / 2.7 SP3 Integrated S7-300 rack 0, slot 2 FB7 / FB9 NC var read / write DB9910 + DB9913 NC Varselector area NC Kernel (NCK) Solution Line < 4.5 = no OPC UA OPC UA / MQTT S7 / ISO-on-TCP NCK read / write

For the firmware versions in scope, the data path is:

  1. IOT2050 sends an S7 read request over ISO-on-TCP (port 102) to the integrated S7-300.
  2. The S7-300 executes a Siemens NC variable function block (FB7 for read, FB9 for write; FB2 / FB3 for PI services on older Solution Line basic programs).
  3. The function block reads from / writes to the NC kernel at the address generated by the NC Varselector.
  4. The S7-300 returns the data to the IOT2050.
  5. The IOT2050 publishes the data to OPC UA, MQTT, or HTTPS endpoints in the plant network.

The IOT2050 never talks to the NC kernel directly. All NC variable traffic is mediated by the integrated S7-300. The NC Varselector is the offline tool that defines which NC variables are exposed and at which S7 data-block addresses the runtime values are mirrored.

Option A — S7 Communication to the Integrated S7-300

On every Sinumerik 840D sl (Solution Line and Power Line), the S7-300 inside the NCU is reachable on the X130 / X120 interfaces. The integrated PLC acts as an S7 server on TCP port 102 (ISO-on-TCP / TPKT). The IOT2050, running node-red-contrib-s7comm, can connect as an S7 client and read data blocks, inputs, outputs, and merkers.

Network Topology and Port Allocation

Endpoint Address / Port Role
Sinumerik 840D sl X130 192.168.214.1 (default) / TCP 102 S7 server, NC/PLC service
Sinumerik 840D sl X120 192.168.215.1 (default) / TCP 102 S7 server, HMI / operator panel
IOT2050 X1 P1 192.168.214.10 / TCP 102 (client) S7 client, plant machine network
IOT2050 X1 P2 10.0.0.50 (example) / TCP 4840 (OPC UA), 1883 (MQTT) OPC UA server / MQTT publisher
Interface selection. X130 carries the NC/PLC service and is the only interface that reliably serves the integrated S7-300 with NC variable access enabled. X120 is intended for the OP / TP / HT panels and is not the correct choice for IOT2050 access in retrofit projects.

S7 Connection Parameters

Parameter Value Note
Transport ISO-on-TCP (RFC 1006) Required for S7-300, S7-400; also used by S7-1200/1500 with TSAP
IP address 192.168.214.1 Default Sinumerik X130
Port 102 TPKT / ISO-on-TCP well-known port
Rack 0 Integrated S7-300 always sits in rack 0
Slot 2 Default CPU slot of the integrated S7-300
TSAP (local) 01.00 IOT2050 local TSAP for ISO-on-TCP
TSAP (remote) 01.02 Sinumerik integrated CPU slot 2
PDU size 240 bytes S7-300 default; raise to 480 if both sides negotiate it

Configuring ISO-on-TCP on the IOT2050

In node-red, install node-red-contrib-s7comm if not already present (the SIMATIC Industrial OS image ships it pre-installed). Drag an s7 in node onto the canvas, open its configuration, and enter the values from the table above. The node uses the libnodave / Snap7 library to drive ISO-on-TCP and S7 communication.

For a single read of a 32-bit real value at DB1000.DBD200 (an arbitrary example), the node configuration looks like:

Mode:       Single Variable
Address:    DB1000.DBD0
Data type:  REAL
Cycle:      1000 ms

For batch reads (recommended for high tag counts), use the Read mode with a list of addresses; this minimizes connection setup overhead and reduces ISO-on-TCP keep-alive traffic on the machine network.

Option B — NC Variable Access via NC Varselector and PLC Function Blocks

NC variables (axis positions, spindle speed, tool data, G-code state, drive parameters) are not directly visible in the S7 data blocks. The Sinumerik NC Varselector tool generates an address file that maps each NC variable to an S7 memory location. The integrated S7-300 then continuously mirrors the values using Siemens function blocks (FBs).

Generating the Address File with NC Varselector

  1. Open NC Varselector on the engineering station (part of the Sinumerik Operate commissioning toolkit).
  2. Select the target NCK version matching the controller (e.g., 2.6 SP1 or 2.7 SP3).
  3. Add the NC variables of interest (e.g., /Channel/State/actBlockNo, /Axis/actPos, /Tool/Compensation/cuttingEdge[1].dWear).
  4. Export the address list. The output is typically a text file containing lines of the form DB9910.DBX0.0 BYTE 1 /Channel/State/actBlockNo.
  5. Import the generated address list into the S7-300 project (Step 7 V5.5 + SINUMERIK add-on for 840D sl FW 2.6 / 2.7) and compile.
Engineering environment. Sinumerik 840D sl 2.6 SP1 HF5 and 2.7 SP3 HF4 predate TIA Portal integration. The PLC program is typically developed in Step 7 V5.5 with the SINUMERIK add-on package. Do not attempt to load a TIA-only project into a 2.6 / 2.7 controller.

Loading the Address File into the S7-300 Project

The generated list maps each NC variable to a location inside one of the pre-defined NCVAR data blocks (commonly DB9910, DB9911, DB9912 for the axis / channel data, and DB9913 / DB9914 for the tool / magazine data). The PLC programmer instantiates the corresponding Siemens function block to read or write the data at those addresses.

Standard Function Blocks for NC Variable Read/Write

Function Block Function Use
FB2 (PUT) PI service "PUT" Trigger PI services on the NCK (e.g., part program start, reset)
FB3 (GET) PI service "GET" Trigger PI services on the NCK
FB7 (RD_NCK) Read NC variable Single read of an NC variable at a configured address
FB9 (WR_NCK) Write NC variable Single write of an NC variable at a configured address
FB21 (PI_SERVICE) Generic PI service call Variant of FB2 / FB3 used in newer basic programs
FB100 / FB101 Batch read / write multiple NC variables in one call Used in HMI-Pro and OEM tool projects
Basic program version. The exact FB set depends on the installed SINUMERIK PLC basic program (e.g., 840D sl 2.6 SP1 ships with basic program 06.04.xx, 2.7 SP3 ships with 06.05.xx). Verify the FB set in the customer project's library before writing integration code; an FB that is present in 06.05 may not exist in 06.04.

Once the address file is loaded and the FBs are instantiated in the S7-300 project, the IOT2050 sees the NC variable values as ordinary data-block content and reads them with the S7 node in node-red. The cycle time of the FB (typically 100–500 ms) becomes the effective publish rate of the NC variables.

Node-RED Flows on the IOT2050

The SIMATIC IOT2050 image bundles a curated node-red palette that covers the three protocols a Sinumerik retrofit typically needs: S7, OPC UA, and Modbus. The flows live in /home/admin/node-red and survive reboots.

Pre-installed Node Catalog (Industrial OS default image)

Node Package Purpose
s7 in / s7 out node-red-contrib-s7comm Read / write data blocks on the integrated S7-300
opcua client / opcua server node-red-contrib-opcua Expose mirrored tags as an OPC UA server to plant SCADA
modbus read / modbus write node-red-contrib-modbus Reach Modbus TCP / RTU devices on the plant network
mqtt in / mqtt out node-red-contrib-mqtt-broker Bridge S7 data to an MQTT broker for cloud and analytics
function / change / delay core nodes Data transformation, unit conversion, deadbanding
debug / ui_button / ui_gauge core + dashboard On-box diagnostics

Example Flow 1: Periodic S7 Read with OPC UA Server Exposure

This flow reads a batch of four NC variables from the integrated S7-300 and exposes them through an OPC UA server that plant SCADA can browse.

[{"id":"s7in","type":"s7 in","endpoint":"192.168.214.1:102","mode":"all",
      "split":"60s","name":"NCVAR batch read",
      "addresses":[
        {"db":9900,"byte":0,"type":"REAL","name":"actBlockNo"},
        {"db":9900,"byte":4,"type":"REAL","name":"actFeedrate"},
        {"db":9910,"byte":0,"type":"REAL","name":"spindleActSpeed"},
        {"db":9913,"byte":0,"type":"DINT","name":"tNumber"}]},
 {"id":"func","type":"function","name":"Tag remap",
      "func":"msg.payload = msg.payload.map(v => ({tag:v.address, value:v.value, ts:Date.now()})); return msg;"},
 {"id":"opcsrv","type":"OpcUa-Server","port":4840,
      "endpoint":"opc.tcp://0.0.0.0:4840",
      "name":"Sinumerik840D_S7_Shadow"},
 {"id":"dbg","type":"debug","name":"raw","active":true}]

Example Flow 2: S7 Read to MQTT for Cloud Pipeline

[{"id":"s7in2","type":"s7 in","endpoint":"192.168.214.1:102","mode":"single",
      "variable":"DB9910.DBD0","name":"Axis X actual position"},
 {"id":"deadb","type":"function","name":"0.001 mm deadband",
      "func":"const last=context.get('last')||0;\\nif (Math.abs(msg.payload-last) < 0.001) return null;\\ncontext.set('last',msg.payload); return msg;"},
 {"id":"mqtt","type":"mqtt out","broker":"plant-broker",
      "topic":"sin840d/axis/x/actPos","qos":1}]

The deadband function prevents the IOT2050 from publishing identical values to MQTT on every cycle and reduces cloud ingress costs. The OPC UA server flow on the same box is the more deterministic choice when the consumer is a plant SCADA such as WinCC Unified or a third-party MES.

Option C — Third-Party OPC UA Gateways

When the customer cannot modify the integrated S7-300 program (no access to Step 7 V5.5, no downtime for PLC reload), the IOT2050 S7 path is not available and an external OPC UA gateway is required. Two products dominate this space.

Gateway Vendor Sinumerik Compatibility Behavior on 840D sl FW 2.6 SP1 HF5 Behavior on 840D sl FW 2.7 SP3 HF4
uaGate 840D Softing Industrial Solution Line, including 2.6.x and 2.7.x with restrictions Documented as excluded in some releases; PI service calls may fail on early basic program variants Supported; reads PLC and NC variables via S7 communication
IBH Link UA IBHsoftec (now part of Ingeteam) Solution Line 2.7 onward typically listed Limited; some NC variables inaccessible Supported
SINUMERIK Integrate Access MyMachine Siemens Solution Line 4.4+ Not supported Not supported

Both Softing and IBH gateways connect to the integrated S7-300 over S7 communication, run the same NC Varselector → FB7 / FB9 chain internally, and re-publish the values as OPC UA nodes. They can be chained with the IOT2050: the gateway becomes the OPC UA server, the IOT2050 becomes an OPC UA client, and the IOT2050 forwards the data via MQTT or to a higher-level cloud broker.

Vendor compatibility tables are firmware-train specific. An HF that introduces a basic program change can break previously working configurations. Re-qualify the gateway after any controller upgrade, and validate against the exact SP / HF pair of the customer system, not just the major version.

Commissioning Procedure (Step-by-Step)

Use this procedure for first-time integration of an IOT2050 with a 840D sl on firmware 2.6 SP1 HF5 or 2.7 SP3 HF4.

  1. Inventory and validate. Confirm controller part number, Sinumerik Operate version, integrated S7-300 firmware, and the basic program version (e.g., 06.05.04.00 for 2.7 SP3 HF4). Capture the controller's serial number for vendor support.
  2. Network segment. Connect IOT2050 X1 P1 to the machine network. Verify reachability of 192.168.214.1 on port 102 with nc -vz 192.168.214.1 102 from the IOT2050 shell.
  3. Enable S7 communication. On the Sinumerik, set the X130 IP and confirm that S7 communication is enabled in the controller's network settings. The default state allows S7 on X130; verify, do not assume.
  4. Build the NC variable list. Run NC Varselector on the engineering PC, generate the address list for the chosen variables, and load it into the S7-300 project.
  5. PLC adaptation. Add the appropriate read / write FBs (FB7 / FB9 for read / write, FB2 / FB3 for PI service) to the S7-300 program with NC variable addresses pointing at the generated DB offsets. Compile and load to the controller with Step 7 V5.5 as appropriate.
  6. Test S7 connectivity from IOT2050. Open node-red, drop an s7 in node pointed at DB9910.DBD0, deploy, and confirm values change in the debug pane when the controller transitions through reset, JOG, and AUTO with a running part program.
  7. Publish OPC UA. Add an OpcUa-Server node, bind the S7 read output to OPC UA variables, and connect with UA Expert on the engineering PC to verify NodeID resolution.
  8. Bridge to plant / cloud. Add MQTT or HTTPS nodes if the plant stack requires them. Add a deadband function to throttle NC variable traffic when the controller is idle.
  9. Document. Record the S7 addresses, OPC UA NodeIDs, MQTT topics, the IOT2050 firmware version, the basic program version, and the NC Varselector export file. This is the information the customer will need to support the system later.

Verification and Diagnostics

After commissioning, the IOT2050 should be exercised with deterministic traffic and observed both locally and remotely. The checks below cover the most common regressions.

Check Method Expected Result
S7 connection state Node-red s7 in node status badge Green, "connected"
NC variable freshness UA Expert subscription with MinPublishingInterval=200 ms Values update within 2× cycle time
OPC UA endpoint UA Expert discovery on opc.tcp://iot2050:4840 Endpoint present, signed certificate, namespaces ns=1 (default) and ns=2 (Sinumerik shadow)
S7 PDU errors IOT2050 journalctl -u nodered -f No "connection reset" or "PI not allowed in current state" entries
Load top on the IOT2050 shell node-red CPU < 25 % with 100 tags at 1 Hz
Cycle adherence Counter in node-red debug Read cycle within ±5 % of configured 1 s

Troubleshooting Matrix

Symptom Likely Cause Resolution
S7 connection refused from IOT2050 to 192.168.214.1:102 Wrong interface (X120 used instead of X130) or S7 communication disabled on the controller Reconnect to X130; check TCP/IP settings and S7 enable flag on the Sinumerik
S7 connects, values are all zero NC Varselector address file not loaded into the S7-300 project; FBs not instantiated Re-run NC Varselector, import the address list, add FB7 / FB9 calls, reload PLC
Values update for axis 1, freeze for axis 2 FB cycle time too high or wrong basic program version Reduce cycle time, verify the basic program supports the configured NC variable group
OPC UA server on IOT2050 not visible to plant SCADA Plant LAN not routed to IOT2050 X1 P2 or firewall blocks TCP 4840 Open port 4840 on the plant firewall, verify X1 P2 IP from a plant workstation
Node-red restarts every few minutes Out-of-memory condition under high tag count Reduce tag count per read, raise PDU size, use batch reads, switch to IOT2050 Advanced (2 GB RAM)
PI service "start part program" returns error Channel not in reset, or wrong channel number in FB2 / FB3 call Verify channel state, check PI service name spelling, ensure correct DB number in PUT / GET
uaGate 840D / IBH Link UA does not connect to FW 2.6 SP1 HF5 Vendor's compatibility table excludes the 2.6 train Use the IOT2050 S7 route, or upgrade the controller to a 2.7 or 4.x line supported by the gateway
MQTT broker rejects connections TLS not configured, or wrong client ID / topic ACL Configure TLS in the mqtt out node, verify the broker allows the IOT2050 client certificate and topic
Firmware upgrade does not unlock OPC UA. A controller upgrade from 2.6 SP1 HF5 to 2.7 SP3 HF4 does not enable the integrated OPC UA server. The OPC UA server is gated on the Solution Line 4.5 train. Plan OPC UA architectures on the OPC UA availability, not on a 2.x-to-2.x upgrade.

Frequently Asked Questions

Does Sinumerik 840D sl firmware 2.6 SP1 HF5 or 2.7 SP3 HF4 have an integrated OPC UA server?

No. The integrated OPC UA server was introduced with Sinumerik Solution Line firmware 4.5. All 2.x trains, including 2.6 SP1 HF5 and 2.7 SP3 HF4, and all Power Line controllers, must be reached through the integrated S7-300 or via an external OPC UA gateway such as Softing uaGate 840D or IBH Link UA.

Can the SIMATIC IOT2050 communicate directly with the integrated S7-300 inside a 840D sl over S7?

Yes. The IOT2050 runs node-red-contrib-s7comm out of the box and acts as an S7 client. Connect to the controller's X130 interface on IP 192.168.214.1, port 102, rack 0 / slot 2 with ISO-on-TCP and a remote TSAP of 01.02. No additional hardware is required.

How do I read NC variables from the IOT2050 if the controller has no OPC UA server?

Use the NC Varselector tool to generate an address list of the NC variables, import that list into the S7-300 project, and add FB7 (read) or FB9 (write) calls. The mirrored values are then visible in the S7 data blocks (typically DB9910 and DB9913) and the IOT2050 reads them with the S7 node, republishing as OPC UA or MQTT as required.

Is the Softing uaGate 840D compatible with Sinumerik firmware 2.6 SP1 HF5?

Softing's documentation lists 2.6 as excluded in some releases, while 2.7 is supported. The exact exclusion is firmware-basic-program dependent. For 2.6 environments where uaGate 840D is not supported, use the IOT2050's native S7 path or the IBH Link UA gateway on a 2.7 controller.

Which node-red nodes are pre-installed on the IOT2050 for Sinumerik integration?

The SIMATIC Industrial OS image ships with node-red-contrib-s7comm (S7 read / write), node-red-contrib-opcua (OPC UA client and server), node-red-contrib-modbus (Modbus TCP / RTU), and node-red-contrib-mqtt-broker. These cover the three integration paths typically used for Sinumerik 840D sl retrofits: S7, OPC UA, and Modbus.

Back to blog