after a workshop (introduction to OPC UA using Unified Automation SDK) last month we're currently doing some basic prototyping based on SDK.
We already prepared a Client subscribing some values.
Now we're trying to setup a server to supply these values. Basically this is already working as well. Except it works only for short time. Afterwards the server still updates the value, but the subscribing client no longer gets notified.
When using UaExpert the value still gets updated.
By the way: It's a boolean value.
Here is an excerpt of the client:
Code: Select all
_subscription = new Subscription(Session);
_subscription.PublishingInterval = 1;
_subscription.PublishingEnabled = true;
_subscription.Lifetime = Session.SessionTimeout;
_subscription.MaxKeepAliveTime = Session.WatchdogTimeout / 2;
_subscription.DataChanged += new DataChangedEventHandler(LineControllerSubscriptionDataChanged);
_subscription.StatusChanged += new SubscriptionStatusChangedEventHandler(LineControllerSubscriptionStatusChanged);
_subscription.MaxNotificationsPerPublish = 0;
_subscription.MissingSequenceNumber += new MissingSequenceNumberEventHandler(TestMissingSequence);
_subscription.NewEvents += new NewEventsEventHandler(TestNewEvents);
_subscription.NotificationMessageReceived += new NotificationMessageReceivedEventHandler(TestNotificationMessage);
_subscription.Create();
var monitoredItems = new List<MonitoredItem>();
_linecontrollerWriteMonitoredItem = new DataMonitoredItem(NodeId.Parse(Identifier.LcWriteNodeId));
_linecontrollerWriteMonitoredItem.SamplingInterval = 0;
_linecontrollerWriteMonitoredItem.DiscardOldest = true;
_linecontrollerWriteMonitoredItem.QueueSize = 10;
_linecontrollerWriteMonitoredItem.MonitoringMode = MonitoringMode.Reporting;
monitoredItems.Add(LinecontrollerWriteMonitoredItem);
_linecontrollerValidateMonitoredItem = new DataMonitoredItem(NodeId.Parse(Identifier.LcValidateNodeId));
_linecontrollerValidateMonitoredItem.SamplingInterval = 0;
_linecontrollerValidateMonitoredItem.DiscardOldest = true;
_linecontrollerValidateMonitoredItem.QueueSize = 10;
_linecontrollerValidateMonitoredItem.MonitoringMode = MonitoringMode.Reporting;
monitoredItems.Add(LinecontrollerValidateMonitoredItem);
The servers minimumPublishingInterval is default = 100.
Any idea what could cause the client/server subscription to stop working?
How can I change the minimumPublishingInterval without using app.config?
Thanks for your help,
Matthias Sandmann