Course B1 · Build

Events, alarms and history

Values tell you what is happening now; events and history tell you what happened and why. This course covers the Part 9 alarm hierarchy, event filters that return only what you need, condition classes as machine-readable reason codes, and server-side aggregates.

Lessons10
Timeabout 72 minutes
PrerequisitesA4
CostFree: written lessons open, video and labs need a free account

What you will be able to do

  • You can subscribe to events with a select and where clause you wrote yourself.
  • You can use ConditionClassId as a portable downtime reason code.
  • You can read history without pulling more than you need.
  • You can ask the server for a time-weighted average instead of computing it downstream.

Syllabus

  1. 1
    Subscribe to events, not values

    The event notifier, the event type hierarchy, and why a downtime reason should arrive as a timestamped event rather than be inferred from a sampled boolean.

    Asset An event subscription printing real events from the Milo demo server

    8 min
  2. 2
    Write a select clause

    Choosing the fields you want: Time, SourceNode, Severity, Message, ConditionClassId. The default selection is rarely what you need.

    Asset The same events with a default and a hand-written select clause, both outputs shown

    8 min
  3. 3
    Write a where clause

    Filtering server-side so the noise never reaches you. Operators, operands and the errors a malformed filter produces.

    Asset Three where clauses, one of which fails, with the status code it returns

    8 min
  4. 4
    Navigate the Part 9 hierarchy

    BaseEventType down through ConditionType, AcknowledgeableConditionType and AlarmConditionType. What a condition is that an event is not.

    Asset The event type tree browsed from a live server, with the inherited fields at each level

    7 min
  5. 5
    Handle acknowledge and confirm

    Two-stage alarm handling, who is allowed to do it, and what the state machine does in between.

    Asset An alarm acknowledged and confirmed over OPC UA, with the state transitions logged

    6 min
  6. 6
    Refresh conditions after a reconnect

    ConditionRefresh and why a client that reconnects without it believes the plant is healthy.

    Asset A reconnect with and without ConditionRefresh, showing the missed active alarms

    6 min
  7. 7
    Use ConditionClassId as a reason code

    The mechanism that makes downtime reasons portable between machines and vendors, and how MachineTool's condition classes plug into it.

    Asset A table of MachineTool condition classes mapped to a downtime reason taxonomy

    7 min
  8. 8
    Read raw history

    HistoryReadRawModified, bounding values, continuation points, and what a gap in history means.

    Asset A raw history read across a gap, with the bounding values returned

    7 min
  9. 9
    Ask for aggregates instead

    TimeAverage, DurationGood, PercentGood and Count computed server-side. Far cheaper than streaming raw data and aggregating downstream.

    Asset The same shift summarised by server-side aggregate and by client-side computation, with both costs

    8 min
  10. 10
    Check the server can do any of this

    The HistoricalRawData2022 and AggregateHistorical2022 facets, and how to find out before you design around them.

    Asset ServerProfileArray from three servers, showing which history facets each claims

    7 min

Lab

Free account required

Subscribe to events on opc.tcp://milo.digitalpetri.com:62541/milo with a where clause that returns only severity above 500, then read one hour of history for a node and ask the server for its time-weighted average.

Unlock the lab →
Specification background

Last verified 7 September 2026 against OPC UA 1.05.07. OPC UA Connect is an educational resource and is not affiliated with the OPC Foundation.

Free download
OPC UA Server Acceptance Test Pack
A 40-check acceptance test you run against a vendor's server before commissioning sign-off. Weighted scoring, three hard gates, and a one-page verdict for the supplier meeting.
Get the free test pack →
Free, no course, no login