You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using this OPC/UA implementation inside a process within a production environment.
Very rarely, we observe the Notification event for a MonitoredItem not being called, even though its value changed.
This causes our production process to pause, so it is quite crucial for us.
This is intermittent. We may receive 20 notifications for value changes, but then one of the notifications is missing, so we miss out on the change of that value.
We currently use version 1.4.371.91 of the package, but this has also been observed with previous versions.
The occurrence is very rare, so it is very hard to establish what the specific conditions are that make this occur.
Note that when we had it occur, the value in the OPC/UA server was correct, as verified with a different tool. Only the Notification event of the associated MonitoredItem was not raised when the value had changed.
Expected Behavior
Our <OnNotification> event handler should be called whenever the value of the monitored item changes.
Steps To Reproduce
Here is the code that we are using to subscribe.
// Create the endpoint
EndpointDescription endpointDescription = CoreClientUtils.SelectEndpoint(<some configuration>, <serverAddress>, useSecurity: false);
EndpointConfiguration endpointConfiguration = EndpointConfiguration.Create(<some configuration>);
ConfiguredEndpoint endpoint = new ConfiguredEndpoint(null, endpointDescription, endpointConfiguration);
_session = await Session.Create(
<some configuration>,
endpoint,
updateBeforeConnect: false,
checkDomain: false,
<some application name>,
30 * 60 * 1000,
new UserIdentity(<my user>, <my passwrod>),
preferredLocales: null
###);
_session.KeepAliveInterval = 5000;
// Create a subscription for receiving data change notifications
_logger.Info("Subscribing to items {items}", <some description of the items>);
// Define Subscription parameters
Subscription subscription = new Subscription(_session.DefaultSubscription)
{
DisplayName = "<My Subscription>",
PublishingEnabled = true,
PublishingInterval = 100,
DisableMonitoredItemCache = true,
};
_session.AddSubscription(subscription);
// Create the subscription on Server side
subscription.Create();
_logger.Debug("New Subscription created with SubscriptionId = {SubscriptionId} for items {items}", subscription.Id, <some description of the items>);
// Create MonitoredItems for data changes
foreach (var item in variablesToMonitor)
{
MonitoredItem monitoredItem = new MonitoredItem(subscription.DefaultItem)
{
StartNodeId = <some node Id>(item),
AttributeId = Attributes.Value,
DisplayName = <some display name>(item),
SamplingInterval = (int)Math.Round(item.PollFrequency.TotalMilliseconds)
};
_logger.Trace("Subscribing to {node}", monitoredItem.StartNodeId);
monitoredItem.Notification += OnNotification;
subscription.AddItem(monitoredItem);
}
// Create the monitored items on Server side
subscription.ApplyChanges();
void OnNotification(MonitoredItem sender, IEncodable e)
{
_logger.Trace($"Value\"{sender.DisplayName}\" changed");
... // other processing
}
The steps we currently use are:
Compile the code
Install in the production environment
Run for several weeks independently
Wait until it occurs after 5, or 7, or 9 weeks.
Environment
- OS: Microsoft Windows 10 Enterprise LTSC 10.0.17763 Build 17763
- Environment: Windows Service running as Local System
- Runtime: .Net 4.8
- Nuget Version: 1.4.371.91
- Component: OPCFoundation.NetStandard.Opc.Ua.Client
- Server: CODESYS Gateway -x64 version 3.5.18.30
- Client: In-house built proprietary client application (a Windows Service)
Anything else?
No response
The text was updated successfully, but these errors were encountered:
bbmmcodegirl
changed the title
MonitoredItem Notification not triggered intermittently
MonitoredItem Notification intermittently not triggered
Feb 20, 2024
Hi @bbmmcodegirl, this seems difficult to track down.
Does it always take a few weeks until the issue occurs and is it only a specific variable node that is missing data or rather random?
Hey! I am getting a similar issue on my end. Usually for me its the same nodes
I have the following specifcations:
OPC UA Client: Workstation.UaClient 3.11
Server: Basic OPC Server
I am getting the notifications for all other monitored items except a couple specific ones from time to time. Not too sure what is happening
Type of issue
Current Behavior
We are using this OPC/UA implementation inside a process within a production environment.
Very rarely, we observe the Notification event for a
MonitoredItem
not being called, even though its value changed.This causes our production process to pause, so it is quite crucial for us.
This is intermittent. We may receive 20 notifications for value changes, but then one of the notifications is missing, so we miss out on the change of that value.
We currently use version 1.4.371.91 of the package, but this has also been observed with previous versions.
The occurrence is very rare, so it is very hard to establish what the specific conditions are that make this occur.
Note that when we had it occur, the value in the OPC/UA server was correct, as verified with a different tool. Only the
Notification
event of the associatedMonitoredItem
was not raised when the value had changed.Expected Behavior
Our
<OnNotification>
event handler should be called whenever the value of the monitored item changes.Steps To Reproduce
Here is the code that we are using to subscribe.
The steps we currently use are:
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: