![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
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 consideration
Lijo
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/guestdefault.png)
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](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
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
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/guestdefault.png)
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](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
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
1 Guest(s)
Devices in use: Desktop (22), Phone (2)