Skip to Content
On this page

OPC AE client

Windows OPC AE event subscription, conditional reception and variable mapping driver

Compatible devices and models

Device series / model examplesConnection requirements
Device servers or industrial software exposing OPC Classic AEConfigure the OPC AE server, ProgID and COM/DCOM permissions on Windows. Devices are accessed through their AE server.

Connect an event source from a server alarm condition

OPC AE receives event notifications; OPC DA reads current Item values. In an AE-capable server, configure an alarm condition for a source such as Channel1.Device1.Temperature. Source and ConditionName are separate identifiers.

KEPServerEX areas, sources, conditions and thresholds

First make the linked Tag update correctly in KEPServerEX. Configure events under Alarms & Events in the order Area → Source → Condition → Sub-Condition. The following configuration windows come from the installed KEPServerEX6.6 vendor help.

  1. Add an Area such as Area1 and keep Enable selected. An area organizes event sources; it is not a PLC station or variable address.

KEPServerEX vendor-help Area name and Enable settings

  1. Add a Source below the area. Use … beside Tag to browse an existing server Tag, for example 模拟器示例.函数.Ramp1, or the intended device point. With Use the tag name as the source name selected, the Tag address names the source; clear it to enter a custom Name. Update Rate defaults to 1000 ms, range 100–60000, and limits how quickly the source receives Tag updates. Keep the source enabled.

KEPServerEX source Tag, naming, update interval and Enable

  1. Add a Condition below the source. The window shows MULTI_LEVEL, which provides HI_HI, HI, LO and LO_LO subconditions. Start with Deadband type None and value 0. Absolute uses an engineering-unit change threshold; Percent derives a percentage threshold from Range. Enable the condition to produce conditional events.

KEPServerEX vendor-help MULTI_LEVEL condition and deadband

  1. Under Sub-Condition General, select each required subcondition and set Description, Severity, Enable and its in-to/out-of/ack messages. Clear Auto-Acknowledge when clients must acknowledge it. Severity must fall within the gateway subscription filter’s range.

KEPServerEX subcondition severity, enabling, automatic acknowledgement and messages

  1. Under Sub-Condition Triggers, configure the comparison. For a fixed high limit, select Value, enter threshold 80 and choose Source > Threshold. Values above80 activate the subcondition; crossing back produces an exit transition. The Tag option shown below uses another numeric Tag as a dynamic threshold. Its Update Rate applies to that threshold Tag. Do not enter the text80 as if Tag mode accepted a fixed value.

KEPServerEX vendor-help Value/Tag threshold, comparison and update interval

After saving, browse Areas and event sources in the gateway and copy the qualified SourceID. Area, Source, Condition and subcondition represent organization, input data, alarm rules and individual states respectively. Use the browsed SourceID as the variable address, not MULTI_LEVEL or HI_HI, and do not invent an area prefix from the DA Tag name. Compare the same source in Recent events before configuring filtering, variables and storage.

Connect events in the gateway

  1. Obtain the server’s actual AE ProgID and URL, for example opcae://localhost/Kepware.KEPServerEX_AE.V6. Changing a DA or UA URL prefix does not create an AE service. Create a device under No channel, name it Collect_OPC_AE and select OPC AE client. Keep Allow method calls off; the execution interval does not set the server’s alarm trigger period.

AE device name and execution interval

OPC AE client and method-call switch

  1. Open Plugin properties and enter the OPC AE URL. Use localhost for a local server; a remote connection also needs the approved COM/DCOM runtime identity. The connection-check interval is in minutes (10 in the figure); reducing it does not generate more events. Save and enable the device, then check connection and subscription state under Protocol debugging → Core status.

Complete OPC AE URL

AE connection-check interval in minutes

  1. Browse Protocol debugging → Areas and sources and copy the complete SourceID. Click Add variable, enter TemperatureAlarm, select Collect_OPC_AE and enable the variable.

Event variable name TemperatureAlarm

Owning device Collect_OPC_AE and enable switch

Paste the complete SourceID into the address. The illustrated Channel1.Device1.Temperature identifies an event source, rather than a PLC register, ConditionName or alarm message. Select Object, Read only, and array length 1, then save.

Complete event source address and Object type

Read-only event variable

Array length1 for the event object

  1. Keep the subscription active and include this Source and its severity in the filters. Change the associated Tag according to the server’s alarm rule. Compare Source, ConditionName, EventTime, ActiveTime and Cookie in Recent events with the variable object. Restore the source value and inspect subsequent condition changes. Without a new event, the acquisition timestamp need not advance every second as a polled point would.

Filtering, refresh and acknowledgement

Event type filters distinguish Simple, Tracking and Condition events. Category and returned-attribute IDs belong to the current server. Areas, sources and severity filters jointly determine which events arrive. Buffer time and batch size do not change alarm thresholds.

Under Subscription filters, read the current settings before editing and applying them. Enter one area or event source per line. Minimum/maximum severity bound the server’s Severity field. Keep Active enabled to receive notifications. Subscription buffer is an aggregation delay in milliseconds; maximum buffer count limits the notification batch, with 0 using the server default. Keep-alive is the notification interval when no events occur.

OPC AE event types, severity, areas, sources and subscription buffers

Subscription refresh requests current condition states, not the complete history. To acknowledge an event, select its latest original record and supply the actor/comment. Source, ConditionName, ActiveTime and Cookie identify the condition; message text alone is insufficient.

Event storage defaults to disabled. Enable it with the database type, connection, table and retention period when persisted queries are required. Defaults are SQLite OPCAE_Event.db and table opcAeEventLog. The gateway identity needs write access. Retention days control history cleanup, not subscription timeout.

Table splitting/timezone affect storage and queries; cache, queue and batch options affect persistence buffering. They do not change AE filtering or acknowledgement. Clearing Recent events leaves persisted records intact.

In device properties, select Event storage → Add, configure the fields, confirm, then save the device.

Storage fieldConfiguration
Enable OPC AE event loggingStores newly received events when enabled. Adding settings alone does not enable logging.
Connection string and database typeMust match. The SQLite example is Data Source=OPCAE_Event.db;Pooling=False; the gateway process needs file access.
Table nameDefaults to opcAeEventLog. Choose the device’s event table consistently with history queries.
Retention daysDefaults to 3650; set the required history retention period.
Timezone offsetFor example +08:00; empty means UTC. Use the same time basis for history queries.
Offline cacheBuffers records during temporary database outages for later persistence.
Queue limitDefaults to 100000 records awaiting storage; size for event bursts and available memory.
Maximum cache-file rowsDefaults to 262144, limiting records per cache file.
Batch sizeDefaults to 2000 records per batch. Larger batches increase individual write latency.
Table splittingDefaults to no splitting. Match the maintenance/query period and existing table naming.

OPC AE event database, retention, timezone and offline-cache settings

Prerequisites

Before using this plugin, you must install OPC Core Components (OPC Core)  on the Windows hosts running the gateway and the OPC AE server. Match the component architecture to the corresponding process.

Open the plugin

Enter “Development Configuration → Collection Configuration”, create a device and select “OPC AE client” in “Device Plugin”.

Supported channels and data types

Channel typePre-configuration check
Plugin built-in connectionConnection parameters are configured in the device dynamic properties and do not use public TCP, UDP or serial channel parameters.

Optional data type: Object (determined by protocol node or payload)

Plugin properties

Connection configuration

SettingDescription
OPC AE URLDefault: opcae://localhost/Kepware.KEPServerEX_AE.V6. Enter the target server’s OPC AE connection URL.

Running parameters

SettingDescription
Recheck Rate (min)Default: 10. Connection check and reconnection interval in minutes.

Event storage

SettingDescription
Event StorageDisabled by default. Configure a relational database connection, table name, and retention period before enabling it. The defaults use SQLite file OPCAE_Event.db and table opcAeEventLog. Save the settings and restart the device; newly received events can then be queried and exported under Persisted events.

Address rules

Use the full OPC AE event source ID as the variable address, for example Channel1.Device1.AlarmHigh. Copy the qualified name from Areas and event sources, preserving its path and case. Event notifications update the variables; register polling and variable writes are unsupported.

Device debug

Enter “Development Configuration → Collection Configuration”, select the current device then open “Protocol Debug” at the top of the workspace.

Dedicated debugging page

The page uses the current device connection. Check the server and subscription state under Core status, then select a query or subscription operation.

Functions

FunctionPurpose
Core statusCheck the connection, server time, subscription activity, buffer, and keep-alive parameters.
Areas and event sourcesBrowse qualified names. Select a node to read its enable state or enable and disable its conditions.
Categories & attributesQuery event categories, attributes, and condition definitions. Read or select the attribute IDs returned for a category.
ConditionRead the current state for a source and condition name, or translate its associated DA item addresses.
Subscription filtersRead or set event type, severity, category, area, and source filters. Adjust subscription activity, buffer time, maximum buffer size, and keep-alive.
Recent eventsInspect source, time, severity, condition and attributes; retain the original identifiers of events requiring acknowledgement.
Acknowledge alarmAdd each original source, condition, active time and Cookie to the acknowledgement list, then enter the actor/comment and inspect each server result.
Persisted eventsQuery, filter, and export records already written to the event database. Enable Event Storage first.

Refresh server subscription requests the current conditions again. Cancel condition refresh cancels that refresh while live event reception continues. Clear recent events clears the recent in-memory list and preserves stored history.

Under Acknowledge alarm, enter the original Source, ConditionName, ActiveTime and Cookie, then select Add for each event. Preserve the original time zone and fractional seconds. Use the Cookie returned with that event. Enter the acknowledger and comment before submitting. One source may have several conditions; the source name alone does not identify the alarm occurrence.

AE acknowledgement source and condition

AE original active time with time zone and fractional seconds

AE original event Cookie and Add button

AE actor and comment

Submit AE alarm acknowledgement

Verify the configuration

  1. Confirm that the OPC AE server is reachable from the Windows gateway and that the device is online.
  2. Create a variable for a known source using its full source ID.
  3. Trigger a test event at that source.
  4. Compare source, condition, time, and attributes under Recent events. Confirm that the variable value and collection time update.
  5. Clear the test condition and confirm that the subsequent state event arrives. Use Read condition state on the Condition tab to inspect its current state.
  6. With event storage enabled, find the same event under Persisted events. Stored records should remain available after clearing recent events.

Troubleshooting

  • Recent events stay empty: an empty list is normal until an event arrives. Trigger a test event, then check subscription activity and filters.
  • The device is offline: check the Windows host, OPC AE URL, ProgID, DCOM permissions, and server process.
  • Events arrive but variables do not update: check the full source ID, path, case, and the variable’s latest error.
  • Messages are dropped or truncated: reduce the test event rate and inspect debug queue counters and message size limits.
  • Persisted events stay empty: confirm that storage is enabled, the device was restarted, the database is writable, and new events arrived after enabling storage.
  • Some acknowledgements fail: inspect the individual results, refresh recent events, and select the original event again, preserving its active time and Cookie.