OPC UA Subscribe

Overview

You can use this Snap to subscribe to OPC UA notifications from a server when specific conditions occur, such as real-time data changes and event notifications. You can subscribe to specific Node IDs for:
  • Data changes on Variable nodes.
  • Events on Object or View nodes with SubscribeToEvents flag in their EventNotifier attribute.
This allows efficient and real-time monitoring of data without continuous polling.

OPC UA Subscribe Overview

Snap views

View Description Examples of upstream and downstream Snaps
Input This Snap has at the most one document input view. Mapper
Output This Snap has at the most one document output view. It outputs documents with the data changes or events for the subscribed Node IDs. Mapper
Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution Stops the current pipeline execution when an error occurs.
  • Discard Error Data and Continue Ignores the error, discards that record, and continues with the remaining records.
  • Route Error Data to Error View Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap settings

Legend:
  • Expression icon (): Allows using JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Account configuration.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field / Field set Type Description
Label String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: OPC UA Subscribe

Example: Subscribe company mailing list
Node ID String/Expression

Required. Specify the node ID to subscribe to.

Default value: N/A

Example: ns=2;s=Machine1/SetTemperature
Subscription type Dropdown list/Expression
Required. Choose the subscription type. Available options are:
  • Data change: Subscribes to data changes.
  • Event: Subscribes to events.

Default value: Data change

Example: Event
Subscription properties Use this field set to configure subscription related properties.
Publishing interval (milliseconds) Integer/Expression

Required. Specify the interval at which the server sends notifications to the client.

Default value: 1000

Example: 2000
Execution time (milliseconds) Integer/Expression
Required. Specify how long the subscription should run.
Tip: For indefinite execution specify the value -1 or specify a time limit in milliseconds.

Default value: 5000

Example: 6000
Monitoring item properties Use this field set to configure the monitoring item properties.
Sampling interval Integer/Expression

Required. Specify the interval at which the server samples data for monitored items.

Default value: 1000

Example: 2000
Monitoring mode Dropdown list/Expression

Required.

Choose how the item should be monitored for data changes and events. Available options are:
  • Disabled: Monitoring is turned off.
  • Sampling: Enables data sampling at the specified interval without sending notifications.
  • Reporting: Enables both sampling and sending notifications when data changes.

Default value: Disabled

Example: Sampling
Queue size Integer/Expression

Required. Specify the maximum number of notifications stored in the queue before being sent to the client.

Default value: 2

Example: 10
Discard oldest Checkbox/Expression

Select this checkbox to discard the oldest notifications when the queue is full.

Default status: Selected

Data change filter properties Use this field set to configure the data change filtering settings.
Data change trigger Dropdown list/Expression The DataChangeTrigger is an enumeration that specifies the conditions under which a data change notification should be reported. It is triggered only when the monitored data value changes based on the specified change filter. Choose the type of trigger for data change notifications. Available toptions are:
  • Status: (0) Reports a notification only if the status code is associated with the value changes. Learn more.
  • Status value: (1) Reports a notification if either the status code or the value changes.
  • Status value timestamp: (2) Reports a notification if either Status code, Status value or the source time stamp changes.

Default value: Status value

Example: Status value timestamp
Deadband type Dropdown list/Expression

Choose the type of deadband to suppress minor changes. The Deadband is applied only if the trigger includes value changes and the deadband type is set. Available toptions include:

  • None
  • Absolute: This is applicable only to variables with the Number data type.
  • Percent: This is applicable only to analog items with an EU Range property.

Default value: None

Example: Absolute
Deadband value Integer/Expression

Appears when Absolute or Percent option is selected in the Deadband type field.

Required. Specify the threshold value to ignore minor data changes.

Default value: 0

Example: 0.5
Event filter properties Use this field set to define the list of Event type node IDs and Field browse names that should appear in the output.
Event type node ID String/Expression/ Suggestion

Specify the Node ID of the event.

Default value: N/A

Example: ns=0; i=2041
Field browse name String/Expression/ Suggestion

Specify the browse name of the event field to select.

Default value: N/A

Example: Severity or ns=2;Temperature
Snap execution Dropdown list
Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Validate & Execute

Example: Execute only