MATLAB Examples

Install an OPC UA Simulation Server for OPC UA Examples

This example shows you how to install a simulated OPC UA Server for use with the OPC Toolbox examples.

Many of the examples in OPC Toolbox need to connect to a live OPC server. OPC Foundation provides a set of sample OPC UA servers for demonstrating OPC UA functionality. This example explains how to download and install that simulation server, and test that MATLAB can connect to the server.


Note: You must have administrator privileges on your machine in order to install the OPC Foundation Quickstart Servers correctly.

Download the OPC Foundation Sample Servers

Download the sample servers by visiting and downloading the "Sample Applications".

You will be required to register with the OPC Foundation in order to download the Sample Applications.

Install the OPC Quickstart Sample Applications

Open the ZIP file you downloaded and run the .MSI file to install the OPC Quickstart examples.

Once installed, you must use the OPC UA Dashboard to launch each required server prior to using that server. The examples make use of the HA Data Server and the Generic Server. Because of the behvaiour of the servers, it is recommended that for these examples you run the servers only when exploring these examples, and close the servers when you have finished working with the examples.

Verify the Existence of the OPC Quickstart Simulation Server

Run the HA Data Server and Generic Server from the OPC UA Dashboard.

Browse for OPC UA servers on your local machine to verify that the two servers have successfully started.

sInfo = opcuaserverinfo('localhost')
sInfo = 

1x2 OPC UA ServerInfo array:
    index              Description              Hostname  Port 
    -----  -----------------------------------  --------  -----
      1    Quickstart Historical Access Server  ons-dean  62550
      2    UA Sample Server                     ons-dean  51210