![](dotnetdiagramimages/OpcLabs_EasyOpcUA_OpcLabs_EasyOpc_UA_PubSub_OperationModel_EasyUASubscriptionResolvedEventArgs.png)
'Declaration
<CLSCompliantAttribute(True)> <ComDefaultInterfaceAttribute(OpcLabs.EasyOpc.UA.PubSub.OperationModel.ComTypes._EasyUASubscriptionResolvedEventArgs)> <ComVisibleAttribute(True)> <GuidAttribute("74C6F7D0-288C-433B-ACAC-6FC86769AFEA")> <TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter)> <SerializableAttribute()> Public Class EasyUASubscriptionResolvedEventArgs Inherits System.EventArgs Implements OpcLabs.EasyOpc.UA.PubSub.OperationModel.ComTypes._EasyUASubscriptionResolvedEventArgs, System.ICloneable
'Usage
Dim instance As EasyUASubscriptionResolvedEventArgs
[CLSCompliant(true)] [ComDefaultInterface(OpcLabs.EasyOpc.UA.PubSub.OperationModel.ComTypes._EasyUASubscriptionResolvedEventArgs)] [ComVisible(true)] [Guid("74C6F7D0-288C-433B-ACAC-6FC86769AFEA")] [TypeConverter(System.ComponentModel.ExpandableObjectConverter)] [Serializable()] public class EasyUASubscriptionResolvedEventArgs : System.EventArgs, OpcLabs.EasyOpc.UA.PubSub.OperationModel.ComTypes._EasyUASubscriptionResolvedEventArgs, System.ICloneable
[CLSCompliant(true)] [ComDefaultInterface(OpcLabs.EasyOpc.UA.PubSub.OperationModel.ComTypes._EasyUASubscriptionResolvedEventArgs)] [ComVisible(true)] [Guid("74C6F7D0-288C-433B-ACAC-6FC86769AFEA")] [TypeConverter(System.ComponentModel.ExpandableObjectConverter)] [Serializable()] public ref class EasyUASubscriptionResolvedEventArgs : public System.EventArgs, OpcLabs.EasyOpc.UA.PubSub.OperationModel.ComTypes._EasyUASubscriptionResolvedEventArgs, System.ICloneable
The OPC UA PubSub logical resolution is a mechanism that allows you to write code that specifies the information you work in logical terms (symbolic names of PubSub objects), and not in physical terms (such as the various identifier numbers that appear "on the wire").
The logical resolution is automatically used by QuickOPC if, in the various descriptors you pass into the UnsubscribeDataSet Method, you use a logical identifier (PubSub object name, usually), and do not specify a physical identifier at the same time.
There are kinds of resolvers, depending on where the data needed for the logical resolution come from.
When the ResolverKind Property in the UAPubSubResolverDescriptor is set to UAPubSubResolverKind.None, the logical resolution cannot be performed.
This resolver is used when the ResolverKind Property in the UAPubSubResolverDescriptor is set to UAPubSubResolverKind.PublisherEndpoint. The resolver connects to an OPC UA server which has the PubSub configuration model, and contains a configuration of the publisher whose messages you want to subscribe to. Based on the publisher configuration and the parameters and logical identifiers and you have specified, the resolver derives the parameters and physical identifiers needed for making the required subscription to the publisher's data.
The OPC UA server that provides the publisher configuration may be integrated with the publisher in the same hardware or software component, but it can also be separate.
When selecting this resolver kind, you need to specify the URL (and possibly other characteristics) of the OPC UA server with the publisher configuration using the PublisherEndpointDescriptor Property in the UAPubSubResolverDescriptor. Instead of creating the PubSub resolver descriptor yourself by setting its kind and the URL, you can call the static Publisher Method and create it in one step.
This resolver is used when the ResolverKind Property in the UAPubSubResolverDescriptor is set to UAPubSubResolverKind.PublisherFile. The resolver opens a file with PubSub configuration model that contains configuration of the publisher whose messages you want to subscribe to. Based on the publisher configuration and the parameters logical identifiers and you have specified, the resolver derives the parameters and physical identifiers needed for making the required subscription to the publisher's data.
When selecting this resolver kind, you need to specify the PubSub configuration file path and name using the PublisherFileResourceDescriptor Property in the UAPubSubResolverDescriptor. Instead of creating the PubSub resolver descriptor yourself by setting its kind and file name, you can call the static File Method and create it one step.
The configuration file must be in the UABinary format as described in the OPC UA specification (UABinaryFileDataType in Annex A "Common Types" of Part 14).
The use of the publisher file resolver is illustrated in the example below.
When specifying the identifiers for logical resolution, the conditions below must be fulfilled.
In general, there are two approaches that you can take when using the logical resolution (although you can also combine them, and also use physical identifiers in some places):
In the first case, the resolution provider finds the specified objects in the configuration, and uses their parameters to determine the proper subscription settings (such the PubSub connection descriptor, communication parameters, and subscribe dataset filter).
In the second case, the resolution provider finds the published dataset in the structure of the dataset folders in the PubSub configuration. It then attempts to find a dataset writer that is configured with this published dataset. Since the same dataset may be published by multiple dataset writers, the algorithm only considers as eligible the dataset writers that reside on PubSub connections with transport profile URI that the component supports.
The example below shows the approach with specifying published dataset name.
When resolving from the publisher configuration, the resolution process is sometimes required to provide information that is somewhat difficult to obtain. The most prominent example of this is the MessageReceiveTimeout Property in the UADataSetSubscriptionDescriptor.CommunicationParameters. If you do not specify a non-zero value yourself, what should the resolution process fill in? The only hint it has from the provider configuration is the KeepAliveTime Property in the writer group (UAWriterGroupElement Class). But the keep alive time cannot directly be used as the message receive timeout: There needs to be some tolerance allowed, for computing and network delays. How big this tolerance should be is a big question, and depends on multiple parameters of your system.
In order to provide working results in most cases, the resolution provider uses a linear function to compute the message receive timeout from the keep alive time. The value of the keep alive time is multiple by message receive timeout factor (MessageReceiveTimeoutFactor Property), and then a message receive timeout increase (MessageReceiveTimeoutIncrease Property) is added to it.
The default message receive timeout factor is 1.05 (i.e. 5% over the keep alive time), and the default message receive timeout increase is 250 milliseconds. Example: For a keep-alive time of 1000 milliseconds, with the default parameters, the resulting message timeout will be 1300 milliseconds. If the computation described here does not work well for you, you can either set the message receive timeout directly to a value you have determined as proper, or you can modify the computation parameters so that they accommodate the keep alive times better to your system.
When the resolver constructs the subscribe dataset filter (see Message Filtering (OPC UA PubSub)), it has knowledge about which pieces of data are included in the PubSub messages, and which are excluded. As explained with the subscribe dataset filter, filtering must not be specified on data pieces that are not included in the PubSub messages. The resolver sets the filter properties in such a way that no filtering is specified for information that is excluded from the PubSub messages, and guarantees that the filter will actually work correctly.
The publisher endpoint resolver and the publisher file resolver are periodic resolvers. This means that the resolution with them is not normally a one-time occurrence. This allows for long-running programs to achieve resiliency without further programming needed on your part.
If a periodic resolver encounters a failure obtaining the data it needs to perform the resolution, it will retry after a period given by the FailureRetrialDelay Property (in milliseconds). An inaccessibility of the data does not therefore result in permanent loss of the subscription. Note that, however, if there are no problems accessing the data needed to perform the resolution, the resolution will proceed, and if the data is flawed (e.g. in case of an incorrect configuration of the publisher), it may yield subscription parameters that won't work at all, or won't work properly. This kind of error cannot be easily detected.
If a periodic resolver succeeds in obtaining the data it needs to perform the resolution, it will still retry the resolution - but this time, after a period given by the SuccessRetrialDelay Property (in milliseconds). This behavior allows for improper configurations be fixed "on the fly": If there was a configuration error and the resolution yielded dysfunctional result, and the configuration error was later fixed, eventually, the resolver will pick up the new configuration, and make a new resolution, this time with a result that will be functional.
QuickOPC does not necessarily create separate resolver objects for each dataset subscription you make. Instead, resolvers that use the same data source (e.g. access the same OPC UA server) are shared. For optimization reasons in this scenario, the delays that control the repeated resolution attempts described above are actually further modified by an additional MaximumWaitDelay Property (in milliseconds) in the parameters. This is kind of maximum allowed age of the resolution result. If a retrial has been scheduled for an earlier time, its resolution result will be used (sparing an unnecessary resolution attempt).
The resolver parameters mentioned above are all part of the PeriodicResolverParameters Class instance, stored in static EasyUASubscriber.AdaptableParameters.ResolverParameters.PublisherEndpointResolverParameters Property or PublisherFileResourceResolverParameters Property (if the Isolated Property is set to 'false', which is the default), or in the corresponding sub-properties of the EasyUASubscriber.InstanceParameters.ResolverParameters Property Property (if you have set the Isolated Property to 'true').
For advanced scenarios, your code is informed about certain aspects of the logical resolution process. This is done using the ResolverAccess Event on the EasyUASubscriber Class. With this event, you will receive event arguments that are an instance of EasyUAResolverAccessEventArgs Class. The event arguments contain the ResolverDescriptor Property which tell you the kind of the resolver involved, and its parameters.
The event is raised every time after the resolver accesses its information source. There are two possible outcomes:
When the dataset subscription descriptor is successfully resolved, the component raises the SubscriptionResolved Event. This event contains the automatically resolved dataset subscription descriptor in its EasyUASubscriptionResolvedEventArgs.DataSetSubscriptionDescriptor Property. This allows your code to inspect it.
In addition, the event handlers for the SubscriptionResolved Event are allowed to modify the dataset subscription descriptor, and the modifications will be taken over by the component and use d for the actual subscription. This is useful in cases when the automated resolution is not complete, or fully correct.
For example, the PubSub configuration only contains endpoint URLs of Security Key Services (SKS), but no user authentication data with them. The automated resolution fill is in the URLs in the SecurityKeyServices Property of the UAPubSubCommunicationParameters Class, and you can write code inside the SubscriptionResolved Event handled to provide the use authentication information to authenticate the user to the SKS.
In the DataSetMessage Event, after a successful logical resolution, the event arguments contain the final resolved dataset subscription descriptor in the ResolvedDataSetSubscriptionDescriptor Property. The resolved descriptor is derived from the one you passed to the SubscribeDataSet Method, with all the logical identifiers resolved to physical ones, and possible modifications made in the handlers for the SubscriptionResolved Event.
System.Object
System.EventArgs
OpcLabs.EasyOpc.UA.PubSub.OperationModel.EasyUASubscriptionResolvedEventArgs