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. The 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 to install the OPC Foundation Quickstart Servers correctly.
Download the sample servers by visiting https://opcfoundation.org/developer-tools/developer-kits-unified-architecture/ and downloading the "Sample Applications".
You are required to register with the OPC Foundation to download the 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 behavior 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.
Run the HA Data Server and Generic Server from the OPC UA Dashboard.
In MATLAB, 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 op-host1 62550 2 UA Sample Server op-host1 51210