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
Subscriptions and arrays
February 28, 2017
20:43, EET
Avatar
Mark Petty
Member
Members
Forum Posts: 11
Member Since:
October 26, 2016
sp_UserOfflineSmall Offline

Hi,

I’ve got a question about collecting data from arrays.

I’m using the SDK to develop a tool to retrieve OPC data and am currently using the Prosys OPC Simulation Server as my testbed target. I’m currently looking to retrieve the data objects displayed under Objects \ Server \ ServerDiagnostics\ SessionsDiagnosticsSummary \ SessionDiagnosticArray (or, more simply, i=3707).

My impression is that “has component => SessionDiagnostics” elements can be dynamically added and removed from SessionDiagnosticArray whenever they want to be, which makes adding them to a subscription process less than ideal. The only answer I can see at this point is to grab SessionDiagnosticArray ever data collection interval and walk through its references. Is this correct?

-Thanks
-Mark

March 1, 2017
10:29, EET
Avatar
Heikki Tahvanainen
Member
Members
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hi Mark,

As a start, can you explain do you mean 1) how to access SessionDiagnosticArray or 2) how to detect address space changes dynamically in a more general setting?

For the case 1: If you want to collect the data from SessionDiagnosticArray (i=3707), you can just subscribe to the value attribute of that node.

In general case, subscribing to the SessionDiagnosticArray node may not make that much sense, because it contains for example PublishCount variable which will change all of the time if you subscribe to this node. Fortunately for this case, the Simulation Server does not update the PublishCount etc. variables so you can succesfully subscribe to the SessionDiagnosticArray in Simulatioin Server.

Less fortunately, it seems that there’s a bug where old sessions are not cleared correctly from the SessionDiagnosticArray value. I marked this into our issue tracker and this will be handled in the future.

As for the case 2: if you want to detect address space changes dynamically, you can perhaps use the ModelChange events of the OPC UA specification. However, implementing these is server application specific and the ModelChange events are not supposed to be used for example with the SessionDiagnostic nodes.

March 1, 2017
16:04, EET
Avatar
Mark Petty
Member
Members
Forum Posts: 11
Member Since:
October 26, 2016
sp_UserOfflineSmall Offline

My current plan is to get the node with the ID of i=3707 (which should be unique, yes?). I’ll then walk through all the references looking for objects with a browse name of SessionDiagnostics and place the data from those objects (and sub objects) in my array.

My concern is that the processing for this isn’t incredibly efficient, but I don’t see a better way. I was just hoping that someone had come up with a better way to track these object based array data sets.

It does look like both of your suggestions based on subscribing to i=3707 won’t work because of either too many false positives or differences in server based implementations.

Thanks once again, I really appreciate the quick responses.

-Mark

March 1, 2017
16:42, EET
Avatar
Heikki Tahvanainen
Member
Members
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hello Mark,

Just to go through the basic concept: the idea is that you have the value as an array in the node i=3707 and then you have components of the same array value available as values of subnodes. The idea behind the subnodes (referenced with HasComponent) is that you can easily read just part of the larger structure if you are not interested in the whole array.

Another example of this same approach is the ServerStatus node (i=2256).

So, I’m not completely sure what you mean by “subscribing to i=3707 won’t work because of either too many false positives or differences in server based implementations”.

I understand that there’s a bug in the current Simulation Server, but more generally speaking the diagnostics nodes are specified in the OPC UA specification and all server implementations should work similarly.

You are correct when saying ” the processing for this isn’t incredibly efficient”. My point is that you should not be doing the pattern “walk through all the references… and place the data from those objects … in my array”. The most efficient solution is to simply read the value attribute of node i=3707. This is one single OPC UA service call.

And yes, the node i=3707 is unique. Or more formally, unique in the namespace index 0.

But maybe the problem is that I don’t fully understand what you plan to do with the diagnostic information. So, if you can explain more about the purpose of the diagnostic information I’m happy to hear.

March 1, 2017
17:38, EET
Avatar
Mark Petty
Member
Members
Forum Posts: 11
Member Since:
October 26, 2016
sp_UserOfflineSmall Offline

Hi,

Here’s the overview: I’m working on a generic OPC client that can be configured to read data from any OPC server by the use of a proprietary mapping file. While trying to retrieve the data from the Simulation Server I found this section of “real world data” in the session data area. I’ve got a section of my mapping file that I’ve created to cover SessionDiagnosticArray, which I see as an array of objects of type SessionDiagnostics complete with sub objects per session, but these objects can show up and vanish.

So the end goal that I’m looking for is that during every interval’s data collection I collect and process an array of objects (and sub objects) all connected by GUID containing all the data available under SessionDiagnotics (until the end user removes the sections of the configuration that they don’t consider relevant or useful). (basically recreating your Connection Log page but containing all the data and being updated continuously.)

Does that help? I’m happy to answer questions about what I’m trying to do.

To clarify your statement, though, if I read the value attribute to i=3707 it should contain all the other referenced objects? That seems to be a lot of data being marshaled by the server and passed over the wire for each value request. Is that because it’s type [Variable]? (sorry if this is a simplistic question, still new to how OPC does things.)

March 3, 2017
10:19, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Yes, the value of SessionDiagnosticArray can get very big, but in practice you can marshal very large arrays through the OPC UA connection, so it will not become a problem very soon.

However, there may also be a variety of different implementations regarding the data that is available from this node, as is in general reading the diagnostic data.

Anyway, this would be the simplest way to do the monitoring – and if it turns out to not be feasible, you can try the other options. Also, this is probably the fastest way to read all the data, if you need to read or refresh it all.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
30 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: 730

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

HypromeImpupe, toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, Deakin

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

Administrators: admin: 1