Documentation Home Page RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

OPC Unified Architecture (UA) Server

Description

This document explains how to use the Data Interchange Layer (DiL) system to instantiate an OPC Unified Architecture (UA) server to monitor and control configured data points of a different type. OPC UA is an independent service-oriented communication protocol platform developed by the OPC Foundation and integrates all the functionality of the individual OPC Classic specifications into one extensible framework. The protocol is client/server-based and relies on TCP/IP over Ethernet.

To connect with the server, the OPC UA client must know the IP address of the simulation target, and the TCP port on which the OPC UA server has been configured by the user. After the connection, the client automatically retrieves the information on the data points available from the server.

By adding an OPC UA server to the simulation, the user can use an OPC UA client to monitor any kind of simulation points of the Simulink model and is also able to control the simulation by writing data.

To do that, the user must configure the points to be initialized in the OPC UA server, and perform the appropriate connection on these points in the Simulink model. 

  • The OPC UA server runs asynchronously on core 0 of the simulation target.
  • No specific hardware is required but if the user needs to connect a huge number of points, it is recommended to use a dedicated network interface for the OPC UA communication.
  • An OPC UA client software is required to communicate with the driver. The user must use his own OPC UA client to connect with the server running on the simulation target.
  • The user has the possibility of downloading a free UA client from the Unified Automation UaExpert website.

The OPC UA driver also offers the possibility of providing the server with an external timestamp, as opposed to the server receiving its timestamp directly from the system it is running on. For example, the user can connect a GPS synchronized Spectracom card. This card will timestamp the server according to the epoch time it received through GPS.

Driver Configuration

The driver is entirely configurable via the RT-LAB interface. Users can use OPC UA Server GUI to configure below configurations parameters

  • Server configuration
  • Points setup data configuration

General Configuration

The section explains the generic configuration parameters of OPC UA Server driver

Network interfaceThe desired network interface name. The proper interface name should be selected based on the information given by the Linux command "ifconfig". By default this parameter is configured with "eth0" .
Use an RT core for asynchronous computation
  • If set to true, the driver reserves a real-time CPU core for its communication system and can handle a bigger amount of data.
  • If set to false, the communication system defaults to core 0.
TCP portSelect the TCP port on which the OPC UA Server will listen for a UA client to connect.
VerboseIf enabled, additional information is displayed during the loading of the model.
Advanced optionsIf enabled, advanced configuration options of the OPC UA server is displayed.
Use external synchronizationIf enabled, two data points are provided to input the external time stamp on which the simulation to be run.

Server Configuration

The configuration parameters of OPC UA Server are configured with default values.  The server has two standard configurations such as network interface and TCP port number which is configured in the general section page.


The server has more advanced configurations parameters which are not displayed in the user interface by default. However the user can modify these parameters after enabling the advanced option .

Advanced configuration options for OPC UA Server are available in the following categories. 

TCP binaryThis section configures the TCP connection parameters such as message size, no of connections, and connection timeout.
Secure conversation
This section configures the secure channel layer such as no of revised channels and maximum no of secure channels used in the OPC UA Server architecture.
SecurityThis section configures the end security policy options utilized in the OPC UA Server architecture.
ServicesThis section configures the session (used between server and client) parameters such as maximum no of sessions, session timeout and queue size etc.
Address space and profilesThis section configures user-defined objects represented between server and client.
Server capabilitiesThis section configures the server capabilities in terms of defining the number of browse contents, array length of point setup and length of the string etc
Operation limitsThis section configures the nodes implemented between the server and the client. It defines various parameters of the node architecture such as maximum no of nodes per read and write, maximum no of nodes per method call and maximum no of monitored per item, etc.
InternalsThis section configures the internal parameters such as buffer size, no of buckets for address space hash table, etc.
DiagnosticsThis section configures the diagnostics options such as enabling info and error log
IntervalsIntervals contain an array of predefined cyclic rates that the server can implement very efficiently for sampling and reporting data changes. All intervals must be a multiple of the server cyclic rates. Minimum intervals should be <= index 0 of the intervals array. Maximum intervals should be >= the last entry of the intervals array. cyclicRateMs is the cyclic rate at which the server executes and the rate at which the server is polled by the application. The default value is 100 ms. It is not recommended to increase the rate beyond this (50 ms for example) without very careful testing.

Points Setup Data Configuration

The data points to be monitored and controlled by the user are configured in the Points setup section, each data points has below parameters to be configured

NameThis is the name of the data point configured
TypeThis specifies the data type of data point configured. The supported data types of this driver are displayed below in a table.
DirectionThis specifies the data communication direction it can be either "Server to client" or "Client to server"
Array LengthThis specifies the length of the data, if it is '1' then its a single data point or else the data point is vector of a specified length
PathThis parameter represents the folder tree of the data. All the folders will be displayed in the OPC UA client, and different points can be added to the same folder.
Enable quality controlIt is set, then quality control of the data point is enabled for monitoring with a separate connection point
Initial value(s)This parameter sets the initial value(s) of the data point which communicate in this direction "Client to server". It will define the value applied to the data point before the client decides to write something in it


The following snapshot shows the points setup data configuration of the OPC UA Server example model. It has various data point configured in both directions, scalar and array data points with some enabled with quality control monitoring.

The table below describes the different data types that can be used in the 'type' field of a point:

TypeDescription/range
booleanBoolean value. 0 or 1
int8Signed 8-bits integer (-128 to 127)
uint8Unsigned 8-bits integer (0 to 255)
int16Signed 16-bits integer (-32,768 to 32,767)
uint16Unsigned 16-bits integer (0 to 65,535)
int32Signed 32-bits integer (-2,147,483,648 to 2,147,483,647)
uint32Unsigned 32-bits integer (0 to 4,294,967,295)
int64Signed 64-bits integer (-(263) to 263 -1)
uint64Unsigned 64-bits integer (0 to 264 -1)
floatSingle precision floating point integer (3.4E +/- 38)
doubleDouble precision floating point integer (1.7E +/- 308)

Connections


Once the driver has been configured as desired and associated with the proper model subsystem, the user will have to connect points in the model to points in the driver by using the designated RT-LAB GUI. This connection panel will show all the driver's and model's connectable points, once the model has been compiled. It is also possible to make connections to LabVIEW panels.

The example model provided with RT-LAB is already packaged with connections between the driver and the model. It can be used as an example to understand how the connections between the model and the driver should be done.

Each point setup provides a connection point to return data to the model. The connection point is created with the name of the point under a folder structure according to the path parameter that has been given by the user, in the driver configuration GUI. Based on the value of the direction parameter for each point setup, connection point direction is determined. If the direction is set to "Server to client" then the icon is blue, it is a read operation. The data will be read from the client and returned to the simulation. It means this signal needs to be connected to an OpInput block of the Simulink model.

If the direction of the point setup is set to "Client to server" then the icon is red, it is a write operation. The signal will be written to the client. It means this signal needs to be connected to an output block of the Simulink model.

In addition to these connection points, each point setup set in the direction "Server to client" will have an additional connection point called Quality control to feed status code to the client. It will have the name of the point setup with the suffix of "quality". These connections points are optional, by default they are not enabled. These can be enabled by checking the box "enable quality control" for each point set up in the UI configuration section.

OPC UA Server can be configured to run on external timestamp; for this, the driver provides two connection points to input the timestamp in two entities namely" epoch time" and "nanoseconds". By default, this option is not enabled and it can be enabled by checking box "Use external synchronization" in the general page of the OPC UA Server UI configuration section.

Connection with the OPC UA Server

Connecting using an OPC UA Client

To connect to the OPC UA server running on the simulator using an OPC client, the user only has to fill the address in the following format:

opc.tcp://xxx.xxx.xxx.xxx:4840

where xxx.xxx.xxx.xxx is the IP address of the simulator.

If needed, the user can change the TCP port (4840) using the UI configuration section (see example in the 'Driver configuration' section)

Connecting Using a Classic OPC Client

Even though the server uses the OPC UA protocol, it is possible to use a classic OPC client to connect to it. But in order to achieve this connectivity, an OPC UA Proxy must be deployed on the host computer where the classic OPC client is running.

To do so, you have to install Matrikon's OPC UA Proxy software that comes with a 30-day evaluation license. The full version can be purchased through our sales department. The proxy acts as a 'bridge' between the classic OPC client and the OPC UA server.

To configure:

  • Launch the software, click Add New Connection.

  • Enter the UA Server URL matching this example: opc.tcp://xxx.xxx.xxx.xxx:YYYY with the right IP address and TCP port. The IP address (xxxx) is the one of the simulation target where the OPC UA server is running and the TCP port (YYYY) is the port configured in the driver UI configuration section.
  • Set the security option to None-none, choose a connection name for the server, and then click Done. Some additional options are available when clicking on Logging Options.


You should then see the connection you just created:

  • click the connection
  • Start the proxy connection by clicking on the play icon.
  • Start your OPC client.

Connect to the server by giving the name UAProxy.OPAL_OPC_UA.1.

You can now browse through the folder tree specified in the UI configuration section to add data to be monitored or controlled.

Limitations

The current version of the OPC UA server has the following limitations:

  • Data types: boolean, int8, uint8, int16, uint16, int32, uint32, int64, uint64, float, double
  • Maximum array length: 128
  • Security options: SSL, certificates management, password, etc. are not implemented but can be added easily if it is required by the customer

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter