Sinumerik 840Dsl OPC UA Alarm Subscription Troubleshooting

David Krause11 min read
OPC / OPC UASiemensTroubleshooting
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 Overview

The Sinumerik 840Dsl NCU (Numeric Control Unit) exposes its alarms and events through a dedicated OPC UA endpoint distinct from the standard tag namespace. A common field failure pattern is the following: the OPC UA license has been loaded onto the controller, browsing of the tag (data) address space succeeds, but alarm/event subscription either returns an empty list, hangs the client at the Create Subscription call, or causes the server-side handler to crash when the monitored items return no items. The third-party quick-start Alarm & Condition clients (UA Expert, Ignition OPC UA Client, Prosys OPC UA Browser) report Connected in the session status but never display the SINUMERIK server node under the alarm view, because the client has not navigated to the event-notification node ns=0;i=2253 (Server) or the Sinumerik-specific SinumerikEventServer object that publishes condition instances.

This article documents the root cause, the firmware/license preconditions, the correct client-side configuration of the OPC Classic A&E tool AEClient.exe, the OPC UA event subscription model used by Sinumerik, the severity/condition mapping, and the known connection-break issue observed when the event buffer is empty.

Prerequisites and Licensing

Before any alarm can be retrieved from a 840Dsl controller over OPC UA, the following hardware and software preconditions must be satisfied:

  • NCU software version: Sinumerik Operate for PC/PCU base software V4.5 SP2 or higher; the OPC UA server functionality is integrated from V4.5 onward but the full alarm/event model requires the V2.2 generation of the embedded OPC UA server stack (delivered with Sinumerik Operate V4.7+ or with the Access MyMachine / OPC UA add-on V2.2).
  • License key: The option bit for OPC UA server (6FC5800-0AP76-0YB0) and the alarm option bit (6FC5800-0AP76-0YB1). The license is keyed against the CF card serial number; verify with sc start /S ShowLic in the SINUMERIK service shell or via Commissioning > Licenses in the HMI.
  • Network reachability: TCP port 4840 (OPC UA TCP binary) must be reachable from the client. Confirm with:
    telnet <NCU_IP> 4840
  • User accounts: The SINUMERIK-side account auduser (audit user) with read access on alarms and the standard operator or service account for tag read.
  • Firewall/host firewall on PCU50 / TCU: The Windows firewall rule Siemens OPC UA Server must be enabled.
Critical: Loading the OPC UA tag license alone is not sufficient for alarms. The alarm/event delivery requires the extended event stack, which is part of the OPC UA server version 2.2 release. Loading only the OPC UA base license yields a server that returns the data address space correctly but never publishes condition instances. Verify the running server stack with the GetEndpoints call: the ServerArray, ApplicationUri and ProductUri must show the ApplicationDescription Siemens.Sinumerik.840Dsl.OpcUaServer with version 2.2.x.x or higher.

Root Cause Analysis

The symptom of “tags visible but no alarms” can be traced to one of four underlying causes, in order of frequency observed in the field:

  1. OPC UA server version too old. The alarm/event support was extended in OPC UA server V2.2. Older stacks (1.0.x, 1.4.x) only expose tags; subscriptions to Server for EventType notifications return Bad_ServiceUnsupported or no events.
  2. Alarm license bit not loaded. The OPC UA option without alarm subscription right returns Bad_UserAccessDenied when the client invokes CreateSubscription on the event notifier.
  3. Client not calling the correct event notifier node. A naive Browse of the address space reveals only the tag folder. Event notifications are not anchored to a tag node; they are emitted by the Server object (NodeId ns=0;i=2253) and by a Sinumerik-specific EventManager object. Clients that only subscribe to a tag folder receive no events.
  4. Empty subscription buffer crash. A documented defect in the V2.2/V2.3 server stack causes the server process to terminate when an event subscription is opened against the controller, the alarm queue is momentarily empty, and the client does not pre-populate any monitored item. The workaround is to keep at least one monitored item alive in parallel to the event subscription.

OPC UA Server Stack Versions

The embedded OPC UA server on Sinumerik 840Dsl evolves through these major generations:

Server Stack Sinumerik Operate Tag Read Alarm/Event Alarms & Conditions
1.0.x V4.5 / V4.7 base Yes No No
1.4.x V4.8 Yes Legacy A&E only No
2.2.x V5.20 / Access MyMachine OPC UA V2.2 Yes Yes (full) Yes
2.3.x V5.20 SP1 Yes Yes (improved buffering) Yes

Identify the running version with opc.tcp://<NCU_IP>:4840 and the GetEndpoints service. The endpoint description contains Server.ApplicationUri and the ServerCertificate that includes the build timestamp. A typical V2.2 banner returned via Discovery is:

Server: Siemens.Sinumerik.840Dsl.OpcUaServer, v2.2.0.42, Build 2018-08-15

Configuring AEClient.exe for OPC Classic A&E

Siemens ships the standalone test client AEClient.exe with the Access MyMachine / OPC UA toolkit. It speaks OPC Classic Alarms & Events against the Sinumerik server and is the fastest way to verify that the controller-side event delivery is alive before introducing a UA-only client. It is located in C:\Program Files\Siemens\Automation\AccessMyMachine\AEClient\ on the development host.

Step-by-Step: Launch AEClient.exe

  1. Hold Shift and right-click AEClient.exe, then choose Run as different user.
  2. Enter the credentials in the form .\auduser (dot + backslash + username) followed by the password. The leading dot forces the local SAM database; the auduser account is the audit account created during the Sinumerik installation and is the only account authorized to subscribe to alarms.
  3. In the dialog, enter the DNS hostname or IP address of the NCU in the textbox to the right of [Connect].
  4. Click [Connect]. A successful connection is shown by the server name SINUMERIK appearing in the Server tab.
  5. If the server tab stays empty, jump to the Troubleshooting Matrix below. The most common cause at this stage is the AEClient.exe process running as the wrong user; kill the process and retry.

Interpreting the Event List

Once connected, AEClient.exe displays active alarms in the upper pane. Each row contains the fields defined by the OPC A&E 1.0 specification, mapped to Sinumerik-specific values:

OPC UA Event Subscription Model

Modern OPC UA clients must subscribe to the Alarms & Conditions model defined in OPC UA Part 9, not to the legacy Events (Part 5) model. On the Sinumerik 840Dsl the event notifier nodes are:

  • ns=0;i=2253 — Server object; receives all condition instances system-wide.
  • ns=4;s=Sinumerik.EventManager — Sinumerik-specific event manager; can be filtered by Source (PLC / NCK / DRIVES).
  • ns=4;s=Sinumerik.EventManager.PLC — narrowed event manager for PLC alarms only.
  • ns=4;s=Sinumerik.EventManager.NCK — narrowed event manager for NCK alarms only.

The client must call CreateSubscription with the event notifier set to one of the above node IDs, then call CreateMonitoredItems with the Event filter. The event filter selects the fields that will appear in the EventNotificationList. A minimal filter is:

SelectClause[0]: /EventId
SelectClause[1]: /EventType
SelectClause[2]: /SourceName
SelectClause[3]: /Time
SelectClause[4]: /Severity
SelectClause[5]: /Message
SelectClause[6]: /ConditionId

WhereClause for Filtering

Add a WhereClause to limit the notification flood. Examples:

// Only alarms with severity >= 500
ofType(Severity) >= 500

// Only NCK alarms
SourceName == 'NCK'

// Only unacknowledged alarms
ofType(Retain) == true

Event Filter and Severity Settings

In AEClient.exe the menu Subscription → Filter Settings defines which event types are acquired and the minimum/maximum severity bounds:

  1. Open Subscription → Filter Settings.
  2. Enable Simple Event, Tracking Event, and Condition Event (the three event categories used by Sinumerik).
  3. Set Minimum Severity to 1 (include everything) during commissioning, then raise it later for production.
  4. Set Maximum Severity to 1000 (the OPC A&E ceiling).
  5. Click OK. The subscription is updated with ModifySubscription on the running session.

Connection Break After Subscribing to Events

A documented defect in OPC UA servers based on certain pre-V2.3 stacks causes the server to drop the TCP connection when a client subscribes to events on the Server object and the controller's alarm queue is empty at the moment of subscription. The client receives Bad_ConnectionClosed and must reconnect. The defect originates from a null-pointer dereference inside the alarm handler when no condition instance is present in the snapshot.

Workaround

  1. Before opening the event subscription, write a benign write to a tag the operator is guaranteed to monitor, e.g. ns=4;s=Channel/MachineAxis/ee_actualPos[0]. This forces at least one monitored item to be present.
  2. Create the tag monitored items first, then the event subscription, both inside the same session.
  3. On the client side, implement automatic reconnection with exponential backoff (1 s, 2 s, 4 s, max 30 s) and resubscribe on reconnect.
  4. Alternatively, upgrade to OPC UA server stack V2.3 or higher, where the null check is fixed.
The issue was first publicly tracked against the open-source node-opcua client library, where a test against a Sinumerik 840D controller reproduced the crash. The vendor workaround of seeding a non-empty monitored item set is universally applicable across OPC UA client libraries, not only node-opcua.

Verification Procedure

  1. Discovery. From the client, call opc.tcp://<NCU_IP>:4840 via Discovery URL and confirm Server.ApplicationUri = Siemens.Sinumerik.840Dsl.OpcUaServer with version >= 2.2.
  2. Session. Open a session with auduser. Verify the server returns ServiceResult = Good for ActivateSession.
  3. Browse event notifier. Browse ns=0;i=2253 and confirm that EventNotifier bitmask has SubscribeToEvents (0x01) set.
  4. Subscribe. Create a subscription with publishing interval 500 ms, keep-alive count 10.
  5. Monitor. Create a monitored item on the event notifier with the filter shown above. Trigger a known alarm, e.g. by issuing NCK stop via DB31..DBX0.2 = 1; confirm a RefreshStartEventType followed by the alarm condition appears within 2 s.
  6. Acknowledge. Send the Acknowledge service call against the ConditionId and confirm the Severity stays at the configured value while Retain = false.

Troubleshooting Matrix

Column OPC A&E Field Sinumerik Meaning
Event Time EVENT_TIME UTC timestamp from the NCK clock since when the condition has been active.
Severity SEVERITY Integer 1-1000. Sinumerik uses 1-200 for info, 201-500 for warnings, 501-1000 for alarms/errors.
Source SOURCE Logical source name. Typical values: PLC, NCK, HMI, PARTPROGRAM, DRIVES.
Condition CONDITION_NAME The Sinumerik alarm number, e.g. NCK_ALARM_21612 or PLC_ALARM_700010.
State EVENT_STATE Color-coded: red icon for Enabled, Active, Not Acknowledged; green icon for Enabled, Acknowledged; grey for Enabled, Cleared.
Message MESSAGE The localized text string associated with the alarm number, fetched from the controller's text database.
Symptom Likely Cause Corrective Action
Client connects, no SINUMERIK server under alarm tab Client browsing only tag folder, not Server object Subscribe to ns=0;i=2253 explicitly
Connected but no events delivered OPC UA server version < 2.2 Update firmware / Access MyMachine OPC UA V2.2+
Bad_UserAccessDenied on CreateSubscription Wrong user, missing auduser rights Log in as auduser, not operator
Session drops immediately after first event subscription Empty alarm buffer crash (V2.2/V2.3 defect) Pre-create at least one tag monitored item; upgrade to V2.3+
Events delivered but condition text is empty Text database not loaded on NCU Reload alarm texts via HMI Commissioning
Events delivered but Severity always 0 Wrong filter SelectClause Add /Severity to SelectClauses
AEClient.exe server tab empty after connect AEClient.exe not running as auduser Shift-right-click, run as different user, .\auduser
High event latency (> 5 s) Publishing interval too long, server CPU saturated Lower publishing interval to 200 ms; check NCU load

Known Limitations and Field Notes

  • The Alarms & Conditions support in Sinumerik 840Dsl does not include exclusive alarms; a single condition can be active on multiple physical axes without instance differentiation.
  • The EventId returned by the server is a 16-byte binary blob that includes the NCK alarm number plus a sequence counter; persist it in the historian for de-duplication.
  • Acknowledgement from a remote OPC UA client is supported from V2.2 onward. Prior versions expose read-only conditions and reject the Acknowledge call with Bad_NotSupported.
  • When multiple OPC UA clients (e.g. Ignition prod/test/dev) connect concurrently, the server allocates a subscription per session; the default maximum is 32. Exceeding it returns Bad_ResourceUnavailable. Increase the MaxSubscriptionsPerSession via the server configuration file opcua_server.conf on the NCU.
  • The localization of the alarm Message field follows the active HMI language at the time of subscription. Switch the HMI language before opening the subscription if a fixed locale is required for the historian.

Commissioning Checklist

  1. Confirm NCU software build >= Sinumerik Operate V4.7 with OPC UA server stack V2.2.
  2. Load both license options: OPC UA base + alarm subscription.
  3. Create local Windows user auduser with the password configured in the NCU.
  4. Open Windows Firewall rule for TCP 4840 inbound.
  5. Run AEClient.exe as .\auduser, connect, verify SINUMERIK server tab populates.
  6. From the OPC UA client of choice, call Discovery on opc.tcp://<NCU_IP>:4840 and read the endpoint description.
  7. Open session, browse ns=0;i=2253, confirm SubscribeToEvents bit is set.
  8. Create subscription with publishing interval 500 ms.
  9. Create a single tag monitored item before the event monitored item.
  10. Trigger a test alarm (e.g. NCK 21612 by forcing an axis drive fault), confirm receipt within 2 s.
  11. Acknowledge the alarm from the client and confirm the state transition.
Safety: Alarm acknowledgement through OPC UA is intended for HMI/SCADA visualization. Do not rely on remote acknowledgement to release safety-relevant interlocks. Safety chains must remain hardwired per IEC 60204-1 and EN ISO 13849-1, independent of any OPC UA path.

FAQ

Which OPC UA server stack version first supports Sinumerik 840Dsl alarms?

Alarms & Conditions support was added in OPC UA server stack V2.2, delivered with Sinumerik Operate V5.20 / Access MyMachine OPC UA V2.2. Earlier stacks (1.0.x, 1.4.x) expose tags only.

Why does my OPC UA client connect but show no SINUMERIK server under the alarm tab?

The client is browsing the tag folder instead of the Server object. Subscribe to NodeId ns=0;i=2253 (Server) or the Sinumerik-specific Sinumerik.EventManager node, with an Event filter that includes /EventId, /SourceName, /Severity, and /Message.

How do I run AEClient.exe with the correct credentials?

Shift-right-click AEClient.exe, choose Run as different user, and enter the credentials as .\auduser (dot, backslash, username) followed by the password. The auduser account is the only one with event subscription rights.

Why does the OPC UA server crash when I subscribe to events on an idle controller?

It is a known null-pointer defect in the V2.2/V2.3 server stack when the alarm queue is empty at subscription time. The workaround is to create at least one tag monitored item before the event subscription, or to upgrade to V2.3+ where the null check is fixed.

What are the OPC A&E severity ranges used by Sinumerik?

Sinumerik uses severity 1-200 for information messages, 201-500 for warnings, and 501-1000 for alarms/errors. The Severity column in AEClient.exe is an integer in the range 1-1000 and can be filtered via Subscription → Filter Settings.

Back to blog