How do you best configure an OPC UA client to communicate efficiently with the OPC UA server of a SIMATIC S7-1500 CPU and with the best performance possible?
How heavily the OPC UA server of a SIMATIC S7-1500 CPU and the OPC UA communication are loaded depends mainly on the accessing OPC UA client. This FAQ response gives you useful tips about how to keep the server load as low as possible to ensure smooth communication between client and server.
Repeated read and write access to the server
When using frequently repeated read and write access to the same tags of the server, we recommend implementing the "Registered Read" and "Registered Write" service. When registering variable nodes, the OPC UA server creates a so-called "handle" that refers directly to the registered nodes. In the case of read or write jobs of the client to this "handle", the server no longer has to resolve the NodeID and also have optimized access to the required variable.
Large data structures and arrays in a subscription
In the case of a subscription you should not always create a complete structure or a whole array as "Monitored Item" if your process does not require it. If only one value changes in a structure or array, the whole data block is always transferred in a "Publish Response". This creates an unnecessary communication load.
Temporarily disable unneeded subscriptions
Temporarily disable unneeded subscriptions via your client. Using the "Publishing Mode" you can temporarily disable unneeded subscriptions and enable them again as required. This temporarily relieves the server and the communication.
Temporarily disable unneeded Monitored Items of a subscription
Just like the actual subscription, you can also disable single Monitored Items in a subscription. For this you set the "Monitoring Mode" of the items to "Disabled". In order to enable querying of the items again you set their "Monitoring Mode" back to "Sampling" or "Reporting" as the case requires. This temporarily relieves the server and the communication.
Distribution of Monitored Items within subscriptions according to different sampling intervals
If your OPC UA client is to subscribe tags of the server with different sampling intervals, we recommend distributing the tags over various subscriptions ordered according to the required sampling intervals. For instance, group Monitored Items with short sampling intervals (500 ms, for example) in a different subscription to Monitored Items with long sampling intervals (5000 ms, for example).
Consistent data transmission
With OPC UA methods you have the option of writing data consistently to the OPC UA server of a SIMATIC S7-1500 CPU and reading data consistently from the server. The access types Read, Write and Subscription do not ensure data consistency. Here the user has to ensure the data consistency.
Recommendation for the maximum number of Monitored Items of subscriptions
Recommendations for the maximum number of Monitored Items of subscriptions are available in the technical data of each CPU in the Siemens Industry Online Support taking the example of a sampling and publishing interval of 1000ms.
Exceeding the desired sampling time through overloading of the server or too many Monitored Items
If the sampling time of Monitored Items demanded by your client is exceeded, the OPC UA server issues a "GoodOverload" status message. This publishing response does not have any updated values, because the server is overloaded and the demanded sampling time cannot be kept to. You can react to this message with the client by following some of the points of this FAQ response: 109763090
OPC UA specification 1.0.4 with "Type Definitions" (firmware V2.6 and higher)
If your process is due to read complex data types like structures or UDTs from the OPC UA server of a SIMATIC S7-1500 CPU, we recommend using the new attribute "Type Definition" for parsing the transmitted data. In this case you can switch off the "Type Dictionary" of the previous specification on the CPU to release memory resources. Furthermore, switching off the "Type Dictionary" has a positive effect on the startup performance of the OPC UA server of the CPU. The setting for the "Type Dictionary" is in the device configuration of the CPU under "OPC UA > General > Backward compatible data type definitions according to OPC UA specification <= V1.03".
Analysis of the communication load and cycle time of the OPC UA server of the SIMATIC S7-1500
A detailed picture of the communication load caused by your client and the cycle time of the OPC UA server of a SIMATIC S7-1500 CPU is given via the system function block "RT_Info". The following operating modes help you here:
21: For the last program cycle this returns which parts of the runtime are allotted to the communication and the user program.
25: Outputs the shortest, longest and current cycle times of the user program.
Compare the results of "RT_Info" without and with OPC UA communication in order to establish the differences. Further information about the SFB is available in the TIA Help ("F1").
Background: The OPC UA communication of an S7-1500 CPU runs within the program cycles and therefore has a negative effect on the cycle time of the CPU program.