Monitoring a change of status through a client subscription

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
NicovanVeen
Hero Member
Hero Member
Posts: 23
Joined: 23 Aug 2013, 09:30

Monitoring a change of status through a client subscription

Post by NicovanVeen »

Hi forum

Is there a way at a client to trap a change in Value.StatusCode when the Value remains unchanged ?

Situation : I'm writing a server at the moment. Whenever a requested value can't be read in the underlying system on the server, the read response returns a DataValue with the last known healthy value together with a "bad" statuscode .
When applying direct reading on the client this works fine, but when you put a value on monitor in a subscription like in "subscription.DataChanged += new DataChangedEventHandler(Subscription_DataChanged)" the event is only fired when the value of data changes, but not when the status of the data changes from "Good" to "bad".
The result of this is that the monitored data in the GUI doesn't update (this is OK) but I can't show the user that this data is bad.

Kind regards

Nico

cacamille3
Hero Member
Hero Member
Posts: 73
Joined: 15 Feb 2012, 21:43

Re: Monitoring a change of status through a client subscript

Post by cacamille3 »

You have to do that on your Server side.
In order to your server has to support Data Change FIlter :
There is 3 type of trigger : Status - Status/Value - Status/Value/Timestamps.
(You should also take a look at Deadband Filter btw)
By default if no DataChangeFilter is set the behaviour must be like Status/Value : your Server shall publish DataNotification when either the status or the value of one of the monitoredItems has been updated.

User avatar
Support Team
Hero Member
Hero Member
Posts: 2670
Joined: 18 Mar 2011, 15:09

Re: Monitoring a change of status through a client subscript

Post by Support Team »

Hello Nico,

When you create a DataMonitoredItem you have to set the DataChangeTrigger property to DataChangeTrigger.Status.
You must set this before you create the MonitoredItem or call ModifyModifyMonitoredItems after changing it.
This feature must be supported by all Servers.

Best regards
Support Team

NicovanVeen
Hero Member
Hero Member
Posts: 23
Joined: 23 Aug 2013, 09:30

Re: Monitoring a change of status through a client subscript

Post by NicovanVeen »

Thank you for your responses

I figured out that the client side must be OK , but the problem seems to be that my server doesn't seems to support it. Then it is stated below : "your Server shall publish DataNotification when either the status or the value of one of the monitoredItems has been updated". How, where and when do I do this ? any examples ?
Kind regards Nico

Post Reply