OPC UA Usage Notes
OPC UA Usage Notes — Detailed information about the
OPC UA protocol and the native OPC UA blockset
Introduction to OPC UA
OPC UA is an Ethernet communication protocol based on a client-server
architecture. Each item of information in the server is represented by nodes of
different node classes, such as objects, variables and methods. Depending on the
node class, the node has different attributes such as name, value and unit. Nodes
can be derived from other node definitions, they can have references to one another
and they are part of a node tree whose structure is given by the information model
used. Clients connect to servers to read and write nodes, call methods, request
historical data, check alarms, or transfer a file. Speedgoat provides a native
interface for OPC UA which is supported with the onboard Ethernet interfaces and I/O
modules. The OPC UA protocol stack runs on the target machine's CPU. Simulink driver
blocks for client and server operation are available.
For further information about OPC UA, read the OPC UA Online Reference: https://reference.opcfoundation.org/
Typical Target Machine Configurations
Use the Ethernet Configuration Tool to assign IP addresses the target machine's
Ethernet interfaces. Enter the following in the MATLAB command window to open the
tool:
>> speedgoat.configureEthernet
For OPC UA, you can use any Ethernet interface when Configuration is set to IP
Protocols.
One real-time target machine can perform multiple OPC UA clients and servers.
There are three possible configurations:
- One IP Address per Ethernet Interface
One IP address is assigned to one Ethernet interface. This Ethernet
interface acts as either one OPC UA client or one OPC UA server in the
network. You can install multiple Ethernet I/O modules (providing up to
4 interfaces each) or use additional onboard Ethernet interfaces to set
up multiple OPC UA clients or servers. As all the Ethernet interfaces of
a target machine must be associated with different Ethernet subnets,
each OPC UA station must operate in another Ethernet network. If an
application requires multiple clients to communicate with different OPC
UA networks, then this target configuration is the correct choice. In
contrast, if the simulation of an OPC UA network with multiple servers
is required, this setup cannot be used.
The subnet dedication of an Ethernet interface is defined by IP
address and subnet mask.
- Multiple IP Addresses per Ethernet Interface (IP Aliasing)
IP aliasing can be used to assign multiple IP addresses to a single
physical interface. This allows multiple OPC UA clients and servers to
be operated on the same Ethernet I/O module or the same onboard Ethernet
interface. As the related IP addresses are always associated with the
same Ethernet subnet, this configuration is ideal for simulating an OPC
UA network containing multiple servers. Even mixed operation (client and
server) is possible for the purpose of loopback testing. Alias addresses
can be configured in the advanced settings of the Ethernet Configuration
Tool or by functions.
Enter the following in the MATLAB command window to manage IP
aliasing:
>> ipAliasObj = speedgoat.IpAliasConfiguration()
>> ipAliasObj.add('ETH2', {'192.168.10.31','192.168.10.32','192.168.10.33'})
>> ipAliasObj.remove('ETH2', {'192.168.10.33'})
>> ipAliasObj.add('Host Link', {'192.168.1.15','192.168.1.19'})
Enter the following in the MATLAB command window to check the available
Ethernet interfaces and configured IP aliases:
>> ipAliasObj.show()
Interface Name IP Address Subnet Mask
--------------- --------------- ---------------
ETH2 192.168.10.1 255.255.255.0
192.168.10.31 255.255.255.255
192.168.10.32 255.255.255.255
192.168.10.33 255.255.255.255
Host Link 192.168.1.14 255.255.255.0
192.168.1.15 255.255.255.255
192.168.1.19 255.255.255.255
- Multiple TCP Ports per IP Address
This is the normal operation for clients as each connection of the
client to a server requires a separate TCP port.
For server simulation, you can ignore the default server port 4840 and
allow multiple servers to listen on different TCP ports. All these
servers will then act in the same subnet.
Runtime License
OPC UA blocks require a runtime license installed on the target machine. Please refer to
the Runtime
Licensing help.