IMDHMIControls LibraryShop main store

Troubleshooting

Why S7-1500 Program_Alarm events miss the OPC UA server

SCADA and data logging Published 6 min read By IMDHMI controls team

Short answer

Program_Alarm raises a controller-side alarm, but OPC UA delivers it only as an event: the CPU's OPC UA server needs Alarms and Conditions activated and downloaded, and the client needs an event subscription with a filter on the server's event source. A client that only reads tags never receives it. Confirm the alarm in the CPU first, then fix the subscription, not the tag browse.

On this page
  1. Two capabilities, not one
  2. Confirm the alarm fires controller-side
  3. Activate the alarms function and download
  4. Create the event subscription
  5. Prove the path with a timed test
  6. Where the alarm drops out
  7. Questions asked

A Program_Alarm that fires correctly in the CPU can still be invisible to an OPC UA client, because OPC UA carries values and alarms on separate paths. Reading tags proves only data access. Alarms travel as events, defined in OPC UA Part 9 (Alarms and Conditions), and they need three things in a row: the alarm raised controller-side, the alarms function activated in the CPU's OPC UA server configuration and downloaded, and an event subscription in the client with a filter on the server's event source. Miss any one and the client shows nothing. The list below runs in order, so the first boundary that drops the alarm is the one you fix.

Two capabilities, not one #

Data access exposes variables: the client browses nodes, reads values and may subscribe to value changes. Event delivery is a separate mechanism. The server pushes event notifications through a subscription whose monitored item sits on the server's event notifier, and that monitored item carries an event filter: select clauses naming the fields to return (message, source, time, severity, condition state) and a where clause restricting which events pass. Part 9 builds alarms on this model as conditions, meaning events with state such as active, cleared and acknowledged. A Program_Alarm is published as such a condition.

A client that only creates data-change subscriptions therefore reads the whole tag database and receives zero alarms. That is by design, not a fault. A data-change subscription is the right tool when a client must catch every PLC input change, as explained for why OPC UA subscription updates beat polling PLC input changes, but it carries no events. Decision: if values arrive, the data path is healthy and the missing piece is the event path, never the tag browse.

Confirm the alarm fires controller-side #

Program_Alarm raises an alarm inside the CPU when its call executes with the signal transition the instruction requires; it does not touch the network by itself. Prove this half before opening any client:

  1. Check that the calling block executes and the instance data block of the alarm exists.
  2. Check that the alarm the call references exists in the CPU's PLC alarm configuration with its number and text.
  3. Trigger a fresh inactive-to-active transition with a spare test bit, never with a process protection signal.
  4. Look for the alarm in the CPU's diagnostics buffer or the engineering alarm display: correct text, active state, timestamp.
  5. Return the test bit to inactive and confirm the state change is recorded.

An alarm whose signal has been asserted continuously since before anyone looked produces no new transition, so no event can be pending for a client that connects later. Decision: if nothing appears controller-side, stop, because no server or client setting delivers an alarm the CPU never raised.

Activate the alarms function and download #

The integrated OPC UA server of the CPU publishes program alarms only when the alarms function, Alarms and Conditions, is enabled in the CPU's OPC UA server properties in the device configuration. The running CPU serves the configuration that was compiled and downloaded; a change that exists only in the offline project is not live. This is the first question to ask on site: was the hardware configuration downloaded again after the alarm was added and the option enabled? That download is the step most often missed.

The server's memory for Alarms and Conditions is limited and product-specific, and the manufacturer documents how to handle those limits.

If the client's endpoint is a separate PC-based server instead of the CPU's own, that server must collect the CPU's alarms and republish them as events, with activation and mapping in its own configuration; the CPU can also serve clients directly with no PC station in between, as covered in when an S7-1500 needs no PC station for OPC UA. Decision: after the download, reconnect and create the event subscription; if the server rejects it, the fault is still in this section.

Create the event subscription #

Use a general-purpose OPC UA client with an event monitor as the diagnostic tool, then reproduce the working setup in the production client.

  1. Connect with a user the server accepts for sessions.
  2. Create a subscription and, on it, one monitored item on the server's event notifier, the standard event source, not on any tag node.
  3. Give that monitored item an event filter: select clauses for message, source name, source timestamp, severity and active state, with an empty or minimal where clause for the test.
  4. Read the service result of the create call. A rejected filter or a permission error names the filter or the user, not the PLC.
  5. Trigger the test alarm again after the subscription exists.

Decision: subscription accepted, alarm fired controller-side and one notification in the event monitor means the path is proven; copy that filter into the production client. If the subscription is accepted and nothing ever arrives, use the table below.

Prove the path with a timed test #

Notifications are queued and sent at the subscription's publishing interval, so expect delivery within roughly one interval plus network and server processing time. Worked example with example values: set the publishing interval to 500 ms, trigger the test alarm, and compare timestamps. The CPU's diagnostics buffer records the alarm at 14:32:05.120; the client's event monitor displays it at 14:32:05.610. Delivery latency = 14:32:05.610 − 14:32:05.120 = 490 ms, and 490 ms is less than the 500 ms interval: the notification arrived in the first publishing cycle after the transition, and the event path is proven end to end. A gap of several intervals, or no event at all, means the drop-out is upstream of the client display.

Now apply the production filter, with event type, severity, source or area restrictions, and repeat the same test. Add one restriction at a time and rerun the trigger after each: every element added to the where clause is a new chance to filter the wanted alarm out. The alarm must still arrive with the final filter in place.

Where the alarm drops out #

Observation Next diagnostic Corrective direction
No alarm in the CPU's diagnostics buffer Calling block execution, instance data, signal transition, alarm configuration Fix controller-side generation first; client work is wasted until this passes
Alarm in the buffer; event subscription rejected by the server Downloaded server configuration, enabled alarms function, user rights, filter syntax Enable and download, correct the user or filter, then reconnect
Subscription accepted; no notification ever Fresh transition after subscribing, filter field list, server-side alarm integration Retrigger the test alarm, widen the filter, verify the downloaded configuration
Diagnostic client receives the event; production client stays silent Production client's event filter, field selection, display rules Mirror the diagnostic filter, then add restrictions one at a time

The common case, tags reading fine with no events anywhere, is fixed by the event subscription plus the downloaded server activation. In every other case, the last point where the alarm was proven tells you which side owns the repair.

Questions asked

Why do alarms that were already active before the client connected not arrive?

An event subscription reports new transitions only. After creating it, request the condition refresh defined in OPC UA Part 9, which makes the server resend the current state of every active condition. Clients that skip the refresh show only alarms that change after connection, so an alarm that fired overnight appears missing until it clears and returns.

Does the checklist change when the client connects to a PC-based OPC UA server?

Only the second half. You still prove the alarm controller-side, but then the alarm path depends on that server: it must collect the CPU's program alarms through its own controller connection and republish them as OPC UA events, with activation and mapping in its own configuration. Confirm explicit S7-1500 program alarm support in that server's documentation before changing the PLC program.

What happens when many Program_Alarm instances fire at once?

The integrated server of the S7-1500 has a product-specific, limited memory for Alarms and Conditions, and the manufacturer publishes separate guidance on handling those limits. Before commissioning a large alarm set, trigger a burst of simultaneous alarms in a test and read that guidance. If the burst overwhelms the server, reduce alarm volume or move alarm collection to a PC-based server.

Can the test be done without tripping a real process signal?

Yes. Trigger the alarm instance from a spare Boolean test bit in its calling block, watch the CPU's diagnostics buffer for the alarm entry, and remove or lock the test bit afterwards. Never use a protection or interlock signal as the source: the goal is a fresh inactive-to-active transition on the alarm input, not a process excursion.

Why do suppressed or out-of-service conditions not reach the client?

OPC UA Part 9 lets a client filter on condition state, and many clients add a where clause that excludes suppressed or out-of-service conditions by default. If your alarm arrives suppressed, for example because its source is disabled, it matches that exclusion and never displays. Remove or widen the state filter in the diagnostic client to make such conditions visible.

Keep reading

  • How-to

    Connect an S7-1500 to SCADA over OPC UA from TIA Portal

    The S7-1500 has a built-in OPC UA server from firmware V2.0, deactivated by default. Enable it in the CPU device properties in TIA Portal, select the installed server license, copy the endpoint URL, and download. Paste the opc.tcp address into any OPC UA SCADA client, trust the certificates on both sides, then browse the PLC variables and map them to SCADA tags.

    SCADA and data logging

  • How-to

    Connecting a CODESYS HMI on Windows to an S7-1500 PLC

    Yes, it works. Use OPC UA with the S7-1500 as server and the CODESYS HMI as client when the PC only supervises; use a CODESYS Control Win runtime with target visualization over a PROFINET controller/device link when the PC must also run logic. The PROFINET path adds one single-device license on top of the runtime; the OPC UA path adds none.

    SCADA and data logging

  • Explainer

    When an S7-1500 needs no SIMATIC PC Station for OPC UA

    Yes. The S7-1500's embedded OPC UA server serves a custom client on the PC end to end: enable the server in the CPU's hardware configuration, publish variables through user-defined server interfaces, trust the client certificate, and keep the published node count inside the CPU class limit of 1,000, 5,000 or 30,000 nodes. No SIMATIC PC Station, no SIMATIC NET and no PLC-side OPC UA program are needed.

    SCADA and data logging