14:29, EEST
May 29, 2018
I connected to the OPC UA Server and search with
my 1500 Nodes.
I subscribe all Nodes one after another:
for (ReferenceDescription rd : nodeSubscriptionList) {
try {
if (subscribeNode == null) {
subscribeNode = new SubscribeNode(client);
}
subscribeNode.subscribe(namespaceTable.toNodeId(rd.getNodeId()));
} catch (ServiceException e) {
e.printStackTrace();
} catch (ServiceResultException e) {
e.printStackTrace();
}
}
That takes 8 Minutes, can i do it faster?
Another “problem” is, if i subscribe 1500 Nodes my response of datachange ist 10s, if i subscribe 100 Nodes the dataChange ist 200ms, is this a problem of the OPC UA Server or my Client?
Thx
15:28, EEST
December 21, 2011
I am assuming that your SubscribeNode.subscribe calls Subscription.addItem in the background.
You can try to create all monitored items in the client before you connect to the server, in which case it should create them with one CreateMonitoredItems call in the service layer. In this case, since your client must be connected already, you can do that by creating the Subscription without connecting to the UaClient, until you have subscribed to all items. I.e. call UaClient.addSubscription afterwards.
Note that if there are errors from individual monitored items, there will be no exceptions from them. instead you will need to check the errors properties of the respective MonitoredDataItem objects after the subscription is added to the client.
In general, it is not easy to say, which one is the actual problem, client or server in these cases, but you can check the resource consumption of the client: if it’s not using much of the processor capacity, most probably the server is the bottle neck.
15:39, EEST
May 29, 2018
Thanks. Yes, i subscribe it in the background, but 1856 Nodes need time.
I think the problem is on Server, the client working fine.
Another question:
what does this
If i subscribe 100 Nodes, i becomme every 200ms a value, if i subscribe over 1500 Nodes, i become automaticly every 10s a value. Is this a server feature, cann i disabel this featur?
my sampling intervall is
17:18, EEST
December 21, 2011
The QueueSize defines how many samples the server should keep in a temporary queue to enable sampling faster than the PublishingInterval. But it does not play any role here.
So it’s probably just the resources of the server that define how fast it can sample the items in practice. OPC UA does not require the servers to provide data at some rate – they can always provide less data than what the clients request.
14:09, EEST
May 29, 2018
Thank you.
i will try to register Nodes and receive the values faster.
i register one Node:
how can i receive the values from the registered node?
I can read it
but this it to slow,, any idea how can i receive the values from registered nodes if the values are changed?
14:54, EEST
April 17, 2013
Hello,
The best performance to receive value changes is to create a subscription. Sending read requests constantly will be inefficient compared to creating a subscription.
The RegisterNodes service is described in the following way in OPC UA specification:
“Service can be used by Clients to register the Nodes that they know they will access repeatedly (e.g. Write, Call). It allows Servers to set up anything needed so that the access operations will be more efficient. Clients can expect performance improvements when using registered NodeIds, but the optimization measures are vendor-specific.”
As a consequence, there’s no standardized expectation about the RegisterNodes service. Actually, it’s possible that the service offers no performance improvements whatsoever. You’ll need to check the server documentation or ask the server vendor if this service does anything at all.
One thing that can be said is that the RegisterNodes service should not be used to optimize Read service. If there’s a need for constant Read service calls, you should instead define a subscription to receive value updates. So in that sense, using the RegisterNodes in this setup does not make sense.
15:17, EEST
May 29, 2018
Okay, I understand that but with my 1700 Nodes, the subscription method is not enough. Because more variable I have, the bigger the interval time for change the data.
The OPC UA server from Siemens supports registerdNodes, where I can expect increased performance.
The only question is, how do I get the values when they change?
17:56, EEST
April 17, 2013
Hello,
It sounds like the actual issue is that the OPC UA server in question cannot handle 1700 monitored items. If this is the case, you should contact the server vendor and ask their opinion on how to optimize the server resource consumption.
As an example, defining longer sampling intervals for the monitored items and longer publishing intervals for subscriptions could lower the resource consumption of the server application. Please see some general communication parameters listed here: https://prosysopc.com/blog/opc-ua-sessions-subscriptions-and-timeouts/
However, as Jouni wrote above, it is not easy to say which one is the actual problem, client or server. Meaning that it’s still possible that actually the client application is the bottleneck in this case.
Generally speaking, RegisterNodes service is not related to OPC UA subscriptions. There’s no reason to expect increased subscription performance by calling the RegisterNodes service.
16:34, EEST
May 29, 2018
10:37, EEST
April 17, 2013
Hi Otto,
Yes, subscribing for data changes is exactly what you should do. The limitations that you are experiencing are not related to the OPC UA specification but they are practical limitations of the applications that you are using.
1700 monitored items is not an exceptionally large setup. Actually this is quite a normal amount of variables to monitor. Large OPC UA servers can sample even hundreds of thousands of monitored items simultaneously. However, you are using a relatively low powered device (embedded OPC UA server running on a PLC device) and it’s completely possible that you may have exhausted the server application resources.
The main problem here is a performance issue related to a certain OPC UA application. The subscriptions are the most powerful way of receiving data changes so you are not doing anything wrong in that sense.
You should start by finding out what is the bottleneck of the communication (client or server application). Then you could proceed to modify the communication parameters so that the bottleneck can handle all of the required data changes (as an example, create a smaller amount of monitored items until the data changes come through as expected). At this point, you can see if the performance is on a required level. If not, you can then report this performance issue either to the server vendor or to the client vendor, depending on what the bottleneck was. In this case we are the client vendor as you’re using our Java SDK to develop the client side application.
9:59, EEST
May 29, 2018
17:13, EEST
May 29, 2018
Hi,
im trying another way with custom structure type.
I defined a struct
Image:
https://1drv.ms/u/s!AnWUmBpk49FJnMhnkEPFfxwbqhsRcw
i subscribed it, but i cant parse ist. How can i decode this type and become the values?
i tryed it with xml, but this not working for me, any idea?
THANKS
9:19, EEST
April 17, 2013
Hi,
To use structure values, the Java Stack and SDK need to know the encoding and decoding rules. This information may be obtained either:
1) from the Information Model describing the structure type. Practically speaking this is a UaNodeSet2 file which is outputted by a modelling tool.
2) from the server address space directly. There’s a DataTypeDictionary system described in the OPC UA specification and by using this system the client aplications can also dynamically find out the encoding and decoding rules of structures.
The screenshot was made most probably with UaExpert and as you can see, it can decode the structure values succesfully. This happens because the UaExpert uses the DataTypeDictionaries provided by the server application.
With the Prosys OPC UA Java SDK, most convenient way of handling customized structures is to try and obtain the Information Model XML file which describes these customized values. You can then use the code generator supplied together with the SDK and use the structure values very conveniently in your own application code.
If the UaNodeSet XML file is not available, then you can also use the DataTypeDictionaries with the Prosys OPC UA Java SDK. This functionality is used with the TypeDictionary class.
Because you are saying “I tried with XML”, I get the idea that you probably have the UaNodeSet file available. In this case, you should find more information from the code generator tutorial (file “Prosys_OPC_UA_Java_SDK_Codegen_Manual.pdf”) and then client tutorial chapter “18. Information Modeling and Code Generation”.
15:00, EEST
May 29, 2018
I try to solve this problem wit the TypeDictionary class.
i receive this Message from
“Struct Test”.”Struct Dat Komm SPS S120 UM”values: org.opcfoundation.ua.builtintypes.ExtensionObject@c7dad369
then i get the Extension Object of DataValue
create typeDictionary and decode it:
try {
System.out.println("decode " + typeDictionary.decode(extensionObject).toString());
} catch (DecodingException e) {
e.printStackTrace();
}
But decode does nothing, i do not get a error message or anythink.
where my doing wrong?
15:41, EEST
April 3, 2012
Hi,
(I assume you are using SDK version 3.1.4)
How many different Enumeration and Structure types are there in total on the server?
On the first TypeDictionary.decode it will try to create parsers for all unknown Structure and Enumeration types (this involves lots of Read and Browse operations, also completely relies on the server to provide correct data and also pretty much cannot be done easier, spec version 1.04 will provide an optional alternative way), if there are alot it might take a while; how long did you run the code? Anyway if that or decoding cannot be done it would throw a DecodingException.
11:35, EEST
May 29, 2018
Thanks Bjarne,
the first TESTS are working, i need for 11 Attribute in one Struct, 70seconds.
@Prosys Team, have you interesset work together, we produce machines @DIENES and would like to deliver all machines with opcua server and clients to our costumers. We can develop solution together.
Thank you for your help
14:30, EEST
April 17, 2013
Hi Otto,
Good to hear that your tests are working. 70 seconds is a long time to initialize the TypeDictionary. However, normally the client application should only have to do this initialization once so it shouldn’t be too much of a problem in normal circumstances.
We’re happy to offer a variety of development services related to OPC UA. I’ll send you an email containing further information.
16:36, EEST
May 29, 2018
Thank you for the Mail,iI’ll discuss it with my supervisor and then contact you. 🙂
It’s okay if I need a minute or two to initialize.
I am now looking for a way to read the structure once and then decode it quickly.
It’s not easy to find it from the documentation. If you could tell me the procedure or the required Java classes would be great.
17:18, EEST
April 17, 2013
Hi Otto,
You’re correct that the documentation regarding the TypeDictionary usage is still somewhat lacking. This is not a widely used feature because the original and primary model of handling customized structures in Java SDK has been the code generator.
This being said, the usage shouldn’t be too difficult. You can initialize the TypeDictionary cache by reading the value from a known custom structure node once when the application starts. After this initial decode, all subsequent decodes should be fast.
One detail to note is that you need to retain the same TypeDictionary object in order to utilize the cache features. Otherwise every single decode will be slow.
Most Users Ever Online: 1919
Currently Online:
15 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:
rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof, Wojciech KubalaModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1