How to get Data Change Notification OPC UA Java Client|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
How to get Data Change Notification OPC UA Java Client
Avatar
Lijo Louis
Member
Members
Forum Posts: 4
Member Since:
04/11/2016
sp_UserOfflineSmall Offline
1
05/20/2016 - 02:01
sp_Permalink sp_Print

Hi,

I am using OPC UA java stack and developing an OPC UA client. I have made subscriptions and publish request to a monitored Item. I am using datachangefilter to set trigger if the value of the monitored item changes. code snippet is given below.

            DataChangeFilter filter = new DataChangeFilter();
            filter.setTrigger(DataChangeTrigger.StatusValue);

I am not getting any notification from server side. I am able to receive a publish response which has an error Bad_SequenceNumberUnknown (0x807A0000) "The sequence number is unknown to the server." I have read few comments about this error. For example change retransmission queue size on server side. I am not able to resolve this error any way and not able to get any notification.

Can you please help me how can I get datachange notification and to get the changed value.

Thank you for your time and considerationSmile

Lijo

Avatar
Guest
Guests
2
05/20/2016 - 21:45
sp_Permalink sp_Print

Bad_SequenceNumberUnknown should only occur if you provide "subscriptionAcknowledgements" in the request. Since you never received notifications, this parameter is supposed to be empty (an empty list).

If this does not apply I suggest that you use another Client (you can google for free stuff) and use the OPC UA wireshark plugin to analyse the difference between your request and the working request of other clients.

-Karl

Avatar
Lijo Louis
Member
Members
Forum Posts: 4
Member Since:
04/11/2016
sp_UserOfflineSmall Offline
3
05/23/2016 - 07:23
sp_Permalink sp_Print

Dear Karl,

Thank you very much for your information. Now I am able to get notification. But i want to get the notification only when data change occurs. I am using this code snippet 

            DataChangeFilter datachange = new DataChangeFilter();
            datachange.setTrigger(DataChangeTrigger.StatusValue);
            ExtensionObject filter = new ExtensionObject(datachange.getTypeId());
            MonitoringParameters parameters = new MonitoringParameters(
                     clientHandle,
                     0.0,     // sampling interval
                     filter,       // filter
                     QueueSize,   // queue size
                     false);      // discard oldest      
            MonitoredItemCreateRequest monitoreditm = new MonitoredItemCreateRequest(ReadvalueId,MonitoringMode.Reporting,parameters);

After setting trigger also sevice request looks like this ;- 

serviceRequest: message=CreateMonitoredItemsRequest

/***** only filter part***/////////

 Filter=DataChangeFilter: DataChangeFilter
          Trigger=null
          DeadbandType=null
          DeadbandValue=null

 And corresponding response message--- Response: CreateMonitoredItemsResponse   

/***** only filter part***/////////

 FilterResult=null   

Can you please help me to get notification only when data change occurs. I really appreciate your time and consideration.

Thank you Smile

Avatar
Guest
Guests
4
05/23/2016 - 23:43
sp_Permalink sp_Print

It is a fundamental property of subscriptions that notifications are only sent when data changes. There is not even a way to set it up differently.

An initial notification is sent after creating the monitored item. After that, notifications are only sent when value or status changes.

-Karl

Avatar
Lijo Louis
Member
Members
Forum Posts: 4
Member Since:
04/11/2016
sp_UserOfflineSmall Offline
5
05/25/2016 - 01:27
sp_Permalink sp_Print

Ok That helps. I could receive publish response and data change notification. Now I get NotificationData as ExtensionObject from publish response. Is there any way to decode it using Opc ua java stack. I want to get the changed value and node id from publish response.

 

Thank you very much

Lijo

Avatar
Guest
Guests
6
05/26/2016 - 04:22
sp_Permalink sp_Print

I don't know enough about the Java stack. To get help you may want to create an issue on github.

Avatar
Lijo Louis
Member
Members
Forum Posts: 4
Member Since:
04/11/2016
sp_UserOfflineSmall Offline
7
05/27/2016 - 07:18
sp_Permalink sp_Print

Ok.Thank you

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online: David Puffer
Guest(s) 52
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855