OPC Studio User's Guide and Reference
OnNext(IUADataSubscription,UAStatusCode) Method



OpcLabs.ServerOpcUA Assembly > OpcLabs.EasyOpc.UA.NodeSpace Namespace > IUADataSubscriptionExtension Class > OnNext Method : OnNext(IUADataSubscription,UAStatusCode) Method
The data subscription that receives the data.

The value of this parameter cannot be null (Nothing in Visual Basic).

The new status code of the data variable.

Because the OpcLabs.EasyOpc.UA.UAStatusCode has implicit conversions from System.Int64 and OpcLabs.EasyOpc.UA.UASeverity, in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use a long integer (representing the internal status code value), or one of OpcLabs.EasyOpc.UA.UASeverity enumeration members (representing the severity code) in place of this parameter, and the corresponding OPC UA status code will be constructed automatically. When the implicit conversion operators are not supported (such as with Python.NET), you can use the OpcLabs.EasyOpc.UA.UAStatusCode.FromInt64 or OpcLabs.EasyOpc.UA.UAStatusCode.FromUASeverity static method instead.

The value of this parameter cannot be null (Nothing in Visual Basic).

Provides the data subscription with an updated status code.
Syntax
'Declaration
 
<ExtensionAttribute()>
Public Overloads Shared Sub OnNext( _
   ByVal dataSubscription As IUADataSubscription, _
   ByVal statusCode As UAStatusCode _
) 
'Usage
 
Dim dataSubscription As IUADataSubscription
Dim statusCode As UAStatusCode
 
IUADataSubscriptionExtension.OnNext(dataSubscription, statusCode)

Parameters

dataSubscription
The data subscription that receives the data.

The value of this parameter cannot be null (Nothing in Visual Basic).

statusCode
The new status code of the data variable.

Because the OpcLabs.EasyOpc.UA.UAStatusCode has implicit conversions from System.Int64 and OpcLabs.EasyOpc.UA.UASeverity, in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use a long integer (representing the internal status code value), or one of OpcLabs.EasyOpc.UA.UASeverity enumeration members (representing the severity code) in place of this parameter, and the corresponding OPC UA status code will be constructed automatically. When the implicit conversion operators are not supported (such as with Python.NET), you can use the OpcLabs.EasyOpc.UA.UAStatusCode.FromInt64 or OpcLabs.EasyOpc.UA.UAStatusCode.FromUASeverity static method instead.

The value of this parameter cannot be null (Nothing in Visual Basic).

Remarks

This method is useful, as it combines the construction of the OpcLabs.EasyOpc.UA.UAAttributeData with obtaining the source timestamp and sending the attribute data to the data subscription. The source timestamp is set to the current time. If your server provides its own source timestamps, do not use this method overload, construct the OpcLabs.EasyOpc.UA.UAAttributeData yourself and call OpcLabs.BaseLib.ISink<T>.OnNext method directly.

This method overload is meant for "Bad" status codes, which do not carry a value with them.

Data polling must not be effect on the associated data variable, otherwise the update will be discarded. For more details, see UADataVariable.UseDataPolling. In most cases, the data polling is suppressed for you automatically.

This is an extension method (info: C#, VB.NET). In languages that have support for extensions methods (such as C# and VB.NET), you can use the extension method as if it were a regular method on the object that is its first parameter. In other languages (such as with Python.NET), you will call the extension as a static method, and pass it the object on which it acts as its first parameter.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also