Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
OnDataChange trigger
September 17, 2014
20:55, EEST
Avatar
Xavier
Member
Members
Forum Posts: 43
Member Since:
March 26, 2014
sp_UserOfflineSmall Offline

Hello,

I have 4 questions regarding DataItem subscription (with Java OPC UA Server SDK) :

1) Is it possible to be notified when the source or server timestamp of the value is modified ? Even if the value itself remains the same ? My guess is that it’s not, but is there any way to do this ?

2) Is there a way to subscribe to an object and be notified if any of its variable changes ? My guess is that it’s not possible and that you can only subscribe to variables/properties directly, right ?

3) There is a function to transfer a subscription to another client in the SDK. Imagine that the subscription is transfered to a new client after the detection that a “master client” is disconnected. There will be a little time during which the server will be storing the notifications that the client missed, but when a new client gets the subscription, does it first start with a full notification of all the items (like the first notification of a new subscription) or only with the “partial” notification that were being stored for the first client ?

I would like my backup client to be able to perform its job as if it was the master client, ie: having the state of all the items of the subscription at the time of the master client failure + then the partial notifications that the master missed. If I do first a manual read in the backup client when the master fails, I may have missed some data changes between the disconnection of the “master client” and the transfer to the backup client.

So if 1 2 and 3 are not possible, I imagine that my solution could be to create a DataType containing all I need to know “together”, and be notified of the whole value if one of its property changes. Example : A value of MyDataType composed of informations A B C, if A B or C changes I get the value change notification containing A B and C. But I imagine 2 ways to do this :
4.a) If I create a DataType composed of several variables (like it seems to be the case for the standard “SessionDiagnostics” DataType), if I subscribe to a SessionDiagnostic item, am I notified if a subvariable changes ? If it works, can this data type be created directly by using UaModeler and the code generation or do I need to create the serialize/deserializer like in 4.b ?

4.b) If i create my own ComplexDataType from scratch (with a serializer and deserializer), then I think that if I modify anything in it I will be notified right ?

Thank you :)

September 18, 2014
8:40, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Good questions!

1) Yes it is. You can use the DataChangeFilter property of the MonitoredDataItem. For example:

MonitoredDataItem item = …;
DataChangeFilter filter = new DataChangeFilter();
filter.setTrigger(DataChangeTrigger.StatusValueTimestamp);
item.setDataChangeFilter(filter);

2) No it isn’t possible to subscribe to an object. I agree that it would be useful in certain situations, but you will have to arrange that yourself, to get notified of all changes in an “area” with a single DataItem. For example like this. Another option would be to create an EventType, which can deliver all value changes in an area for you. But that’s also a “non-standard” way to do it.

3) The server will keep the notifications in a RetransmissionQueue until the client acknowledges them. So the client has a chance to re-request the notifications through the new session, when you transfer it to a new session. In practice this scenario is not yet thoroughly tested in the Java SDK. Especially, if you need to move the subscription from one application to another. But we can work together to find a way to do that.

4a&b) Yes, in principle, changes to the members of a Structure (i.e. complex type) variable should trigger a change to the complete variable. The code generator generates the types and the serialisers for you. But I think that the mapping between the members and the complete value does not work properly yet, either. It is also something that we need to work on, to make the changes in the member variables trigger the change to the main variable.

September 18, 2014
16:32, EEST
Avatar
Xavier
Member
Members
Forum Posts: 43
Member Since:
March 26, 2014
sp_UserOfflineSmall Offline

Thank your for your answers !

For the point 3, I think we will make some tests later on and tell you if we find some problems.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
35 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 738

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6451

Newest Members:

jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1