WOLFRAM SYSTEM MODELER

UpgradingToVersion3

Upgrading from OPCUA 2.0 to 3.0

Wolfram Language

In[1]:=
SystemModel["OPCUA.Documentation.UpgradingToVersion3"]
Out[1]:=

Information

Version 3.0 of the library is not backward compatible with Version 2.0, and the conversion cannot be expressed with conversion scripts. Therefore, any models created with Version 2.0 must be manually adapted to use Version 3.0.

When upgrading to the new version of the library, two fundamental changes should be noted:

  1. Nodes are no longer read or written individually. Instead, each Read or Write block must be connected to a corresponding ReadNodeList or WriteNodeList. All nodes associated with a NodeList are processed together in a single OPC UA request. As a result, the sample rate for reading or writing is now configured at the NodeList level, rather than on individual Read or Write blocks.
  2. The library now utilizes Modelica's synchronous features, with sampling controlled using clock sources from Modelica.Clocked.

Replacing OPCUA.OPCUAServer

All instances of the OPCUAServer must be replaced with with an OPCUA.Components.Core.Client component. Additionally, for every unique read and write sample rate, you must include a corresponding ReadNodeList or WriteNodeList component. The Multirate example illustrates how to create a model that uses multiple sample rates for reading.

For scenarios with a single read sample rate and a single write sample rate, the OPCUA.Client component can be used instead. This convenience component includes one ReadNodeList and one WriteNodeList, simplifying the setup for basic use cases. Most examples in the library use this convenience component; see for example ReadAndWrite.

The endpointUrl parameter in the Client component replaces the previously used hostName parameter in the OPCUAServer component for specifying the OPC UA server endpoint URL.

Replacing Read and Write blocks

Instances of Read and Write blocks should be replaced as follows:

Additionally, instead of connecting them to a OPCUAServer, they should be connected to a ReadNodeList/WriteNodeList or to the corresponding port if the simplified OPCUA.Client is used. Since the sample rate is now handled by the corresponding NodeList, all references to the samplePeriod and startTime parameters must be removed.

Replacing TriggeredRead and TriggeredWrite blocks

Since sampling is now managed by ReadNodeList and WriteNodeList, the TriggeredRead and TriggeredWrite components can be replaced in the same manner as the corresponding Read or Write blocks, as described above.

To get triggered sampling, use an EventClock to trigger the respective ReadNodeList or WriteNodeList. Refer to the TriggeredSampling example for an example.