The OPC UA Server Simulator is a built-in tool of the software platform that emulates the behavior of an OPC UA server. It exists to facilitate the testing and development of OPC UA client applications in the absence of physical hardware. The simulator generates simulated data and provides a hierarchical address space for clients to interact with. Potential uses include testing client functionality, prototyping data models, and experimenting with OPC UA communication patterns. Users can configure server settings, define the data structure, and launch the simulator through its graphical interface or by using command-line parameters. Once running, OPC UA clients can discover and connect to the simulator as they would with a real OPC UA server.

On this page:


Overview

This page contains information on the OPC UA Server Simulator Configuration and Runtime behavior.

The OPC Simulator can be Started from the DataExplorer User interface, or running its executable directly with the proper command line parameters. 

When running, it will create an OPC UA server, populating the Address Space with simulated data. From the client point of view, the OPC Simulator, will just be found and act as it was any other OPC UA server.


Simulator Configuration

The OPC UA Server Simulator is divided in two main regions. Configuration (customize Server settings and DataStructure) and View (DataBrowser and Client Connection List).

Server Configuration

The Server Configuration component enables users to customize server-specific settings.

  • Server URL: Read-Only field, indicating the communication endpoint URL for Client-Server interactions. It is composed by the localhost address and Server Port field.

  • Server Port: Defines the OPC UA Server port to be used as Server URL.

  • Security: Defines which security policies will be enabled in the Server

    • None.

    • Basic256

    • Basic128Rsa15

    • Basic256Sha256

  • AutoStart: OPC Server is started automatically (valid for the next time the application is started).

  • Start Minimized: Application starts minimized (valid for the next time the application is started).

  • Auto Trust Client Certificates: Server will automatically trust incoming connections using security. If False, a popup window will appear, so the user can choose to Trust or Reject the Client certificate

Use the Trust button to allow the Client connection, or Reject to block it.

You can store the OPC Client in the Server’s trusted list, enabling the Save to Trust List CheckBox.


The fields can only be modified while the OPC Server is not running.

Data Structure

In this tab, you will be able to configure the Data Structure for the OPC Server address space.

The structure is defined based on a hierarchical structure that is illustrated below.

<MainNodeName> |-- Area1 | |-- Device1 | | |-- Var1 | | |-- ... | | |-- VarN | |-- Device2 | | |-- Var1 | | |-- ... | | |-- VarX |-- Area2 |-- Device1 | |-- Var1 |-- Device2 |-- Var1

To edit the structure, click on the Edit Data Structure and customize your OPC Server structure at the dialog window.

There are some properties to be defined for Variables:

  • Type: Define the Variable DataType. Options are:

    • Double

    • Integer

    • Long

    • Boolean

    • String

  • VariationFlag: Flag that indicates if variable value will be simulated every second in Runtime.

  • Min: Defines the minimum value for simulated data.

  • Max: Defines the maximun value for simulated data.


The DataStructure can only be edited while the OPC Server is not running.

Data Browser

In this region, you will be able to see the OPC Server Address space in a TreeView structure.

The TreeView connects only to the OPC Simulator. It cannot be used to connect to other OPC Servers.

Client Connections List

In this tab, you can monitor the clients that are/were connected to the OPC Server.

Where:

  • Name: Name of the Client’s session.

  • Connected At: DateTime the Client connected to the Server.

  • Disconnected At: DateTime the Client disconnected from the Server. The Client Connections list is cleared if the OPC Server is stopped.


Command Line Parameters

The OPC Simulator can be executed with custom parameters through the command line. The syntax is as follows:

"..\OPCUASimulator.exe" /param1:<param1Value> ... /paramN

The existing parameters are listed below:

  • Minimized: Application starts minimized.
  • AutoStart: OPC Server is started automatically.
  • AutoTrustClientCertificates: Server will automatically trust incoming connections using security. If False, a popup window will appear, so the user can choose to Trust or Reject the Client certificate
  • Port: Defines the OPC UA Server port to be used as Server URL.
  • Config: Full path for *.xml configuration file with Server Configuration and custom DataStructure. More details on the syntax for the *.xml file in section 4.
  • Path: Full path of a FrameworX solution directory in which a configuration file can be found

Usage:

"..\OPCUA_Simulator.exe" /Minimized /AutoStart
                         /Config:"C:\Documents\CustomSource.xml"


The input parameters are not case-sensitive


Custom Configuration (*.xml)

With a custom configuration file, you will be able to define your own OPC Server Configuration and DataStructure. The syntax for the configuration is described below:

<?xml version="1.0" encoding="utf-8" ?>
<OPCServerConfiguration>
	<SimulatorControl>
		<ServerPort>4840</ServerPort>
		<AutoStart>false</AutoStart>
		<Minimized>false</Minimized>
		<AutoTrustClientCertificates>false</AutoTrustClientCertificates>
		<SecuritySettings>
			<None>true</None>
			<Basic256>false</Basic256>
			<Basic128Rsa15>false</Basic128Rsa15>
			<Basic256Sha256>false</Basic256Sha256>
		</SecuritySettings>
	</SimulatorControl>
	<DataStructure>
		<Node Name="OPCServerObjects">
			<Node Name="Area1">
				<Node Name="Motor1">
					<Variable Name="Current" Type="Double" VariationFlag="true" Min="-20" Max="20"/>
					<Variable Name="Voltage" Type="Double" VariationFlag="true" Min="12" Max="14"/>
					<Variable Name="Temperature" Type="Integer" VariationFlag="true" Min="40" Max="60"/>
					<Variable Name="Status" Type="Boolean" VariationFlag="true"/>
					<Variable Name="LastMessage" Type="String" VariationFlag="true"/>
				</Node>				
				<Node Name="Controller1">
					<Variable Name="Kp" Type="Double" VariationFlag="false" Min="0" Max="50"/>
					<Variable Name="Ki" Type="Double" VariationFlag="false" Min="0" Max="100"/>
					<Variable Name="Setpoint" Type="Double" VariationFlag="false" Min="60" Max="65"/>
				</Node>
			</Node>
			<Node Name="Area2">
				<Node Name="Motor1">
					<Variable Name="Current" Type="Double" VariationFlag="true" Min="-20" Max="20"/>				
				</Node>
				<Node Name="Controller1">
					<Variable Name="Kp" Type="Double" VariationFlag="false" Min="0" Max="50"/>
				</Node>
			</Node>
		</Node>	
	</DataStructure>
</OPCServerConfiguration>

In this section:

  • No labels