WOLFRAM SYSTEM MODELER
UpgradingToVersion3Upgrading from OPCUA 2.0 to 3.0 |
![]() |
SystemModel["OPCUA.Documentation.UpgradingToVersion3"]
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:
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.
Modelica.Clocked
.
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.
Read
and Write
blocksInstances of Read and Write blocks should be replaced as follows:
OPCUA.Blocks.SamplerBoolean.Read
→ OPCUA.Components.Unclocked.BooleanSignals.Read
OPCUA.Blocks.SamplerBoolean.Write
→ OPCUA.Components.Unclocked.BooleanSignals.Write
OPCUA.Blocks.SamplerInteger.Read
→ OPCUA.Components.Unclocked.IntegerSignals.Read
OPCUA.Blocks.SamplerInteger.Write
→ OPCUA.Components.Unclocked.IntegerSignals.Write
OPCUA.Blocks.SamplerReal.Read
→ OPCUA.Components.Unclocked.RealSignals.Read
OPCUA.Blocks.SamplerReal.Write
→ OPCUA.Components.Unclocked.RealSignals.Write
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.
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.