OPC UA

Manual for OPC UA devices and variables in the configuration area.

Updated 17 min read
On this page (9 sections)
  1. Overview
  2. Device Settings
  3. Subscriptions
  4. Variable Settings
  5. Browsing the Address Space
  6. Supported Data Types
  7. Node ID Format
  8. Variable Arrays
  9. Notes

The OPC UA configuration pages define OPC UA devices and OPC UA variables. Use the device page to configure the endpoint and security-related connection information. Use the variable page to map individual nodes into the EnvisionSCADA variable namespace.

OPC UA is suitable when structured node browsing and standardized industrial communication are required. Plan naming carefully so node paths remain understandable after import or manual configuration.

Keep security certificates and endpoint behavior consistent with the target server requirements, especially when moving between development and production environments.

Device Settings

Each OPC UA device defines a client connection to an OPC UA server. Configure the connection endpoint, user authentication, secure channel behavior, and subscription timing.

Create a new device with the Add button in the toolbar. The Add device dialog contains all device settings organized in the tabs General, Connection, and Subscription, with default values already filled in. Enter at least the Name and Server URL and press Create.

The device row shows Enable, Name, Server URL, Template, and Description directly and these values can be edited in place. Press the Settings icon on a device row to open the Edit device dialog, which contains the same tabs and all settings of the device. Press Save to apply the changes.

15 rows
SettingDescriptionExampleUnits / Format
EnableEnables or disables the OPC UA client connection.trueBoolean
SimulationRuns the device in simulation mode. The device does not open its real connection; its variables stay available and become read and write in memory like Local variables, with a Good status and a Channel State of Simulation, so the project can be tested without hardware. Written values are held in memory only and reset when the application restarts.falseBoolean
NameUnique device name used as a prefix for all variables on this device.OPCUA1Text
Server URLEndpoint URL of the OPC UA server.opc.tcp://192.168.1.10:4840URL
TemplateTemplate device name. When set, all variables from the template are cloned to this device at startup.OPCUA_TemplateText
DescriptionFree text description for documentation purposes.Production serverText
User NameUser name for authentication with the OPC UA server. Leave empty for anonymous access.adminText
PasswordPassword for authentication with the OPC UA server.Text
Enable Secure ChannelEnables encrypted communication using a secure channel.falseBoolean
Subject NameSubject name of the client certificate used for the secure channel. On Windows the certificate is looked up in the Windows certificate store under Local Computer / Personal. On Docker the certificate is kept in the /app/certs/pki/own folder and is created automatically on the first secure connection; leave empty to use CN=EnvisionUaClient. See Notes.CN=MyCN, OU=MyOUText
Validate Server CertificateValidates the server certificate when connecting over a secure channel.falseBoolean
Keep Alive IntervalInterval between keep-alive messages to maintain the session.5000ms
Reconnect PeriodTime to wait before attempting to reconnect after a connection loss.10000ms
Session Life TimeRequested session lifetime on the server.60000ms
VerboseLogging verbosity level. 0 is silent, higher values produce more diagnostic output.0Integer

Subscriptions

Each OPC UA device supports up to 5 subscriptions. Subscriptions group monitored items that share the same publishing interval and lifetime behavior. Variables are assigned to a subscription using their Subscription field.

SettingDescriptionExampleUnits / Format
Enable Subscription 1-5Enables or disables the subscription.trueBoolean
Publishing Interval 1-5Server-side publishing interval for the subscription.1000ms
Lifetime Count 1-5Number of publishing intervals before the subscription expires if no keep-alive is received.100Integer
Min Lifetime Interval 1-5Minimum lifetime interval enforced by the client.10000ms

Variable Settings

Each OPC UA variable maps a server node to a named variable in the EnvisionSCADA namespace.

Create a new variable with the Add button in the toolbar. The Add variable dialog organizes all variable settings in the tabs General, Scaling, Historian, and Gateway, with default values already filled in. Enter at least the Name and Node ID on the General tab and press Create. When the variable is created on a template device, it is also created on all instance devices that use the template. On a template device, start the Name with the {Device} replacer, so that each instance device gets its own variable. The Name must resolve to a different variable on each device; this is checked for every instance device before anything is saved, when a variable is created and when it is renamed. The Browse button in the toolbar shows the server address space as a tree and creates variables directly from it, as described in Browsing the Address Space.

The variable row shows Enable, Name, Asset, Data Type, Node ID, Sampling Interval, Subscription, and Description directly and these values can be edited in place. Press the Settings icon on a variable row to open the Edit variable dialog, which contains the same tabs and all settings of the variable. Press Save to apply the changes. Changes made on a template device are also applied to the matching variable on all instance devices, while each instance keeps its own Modbus Address value. The Gateway tab settings Modbus Address, OPC UA, Writeable, MQTT Publisher, Kafka Device, Kafka Remap Device, and Kafka Remap Variable are also available as table columns, which are shown with Columns as described in the Configuration Tables article.

37 rows
SettingDescriptionExampleUnits / Format
EnableEnables or disables monitoring of this variable.trueBoolean
NameFull variable name. The {Device}. replacer prefix is optional: {Device} resolves to the device name when the device loads, so the variable follows a device rename automatically, while a literal name is used exactly as written and keeps working across device renames. The resolved name must be unique across the whole project.{Device}.Pump1_SpeedText
AssetAsset path for logical grouping.Line1/Pump1Text
Data TypeOPC UA data type of the node.FloatEnum
Node IDOPC UA Node ID of the server node.ns=2;s=Channel1.Device1.Tag1Text
Sampling IntervalRequested sampling interval on the server for this monitored item.500ms
SubscriptionSubscription this variable is assigned to.Subscription 1Enum: Subscription 1-5
DescriptionFree text description for documentation.Pump speed feedbackText
User GroupsComma-separated user groups allowed to write this variable from the runtime.Operators,EngineersText
Signature RequiredRequires an electronic signature for each write to this variable from a page object, the Live Manager, the Runtime API or MCP while Part 11 compliance mode is enabled and Write variables marked Signature Required is selected under Signature Required Actions on the Parameters page. The write rights of the user and the value range are checked first, so a refused write does not open the Electronic Signature dialog. A variable created while Part 11 compliance mode is enabled starts with Signature Required selected. Writes by alarm, event and schedule actions, Python scripts and the gateways run without a signature. See the Electronic Signatures article.trueBoolean
Recipe TargetsRecipe target this variable belongs to, or a comma-separated list of targets. Supports the {Device} placeholder, which resolves to the owning device name so one naming rule can spread a set of variables across several devices.Line1Text
Recipe Parameter NameExplicit name of the parameter this variable represents inside a recipe. Variables that fill the same role across different targets share the same Recipe Parameter Name, which is how values are matched on Apply and Snapshot. A variable takes part in recipes only when both Recipe Targets and Recipe Parameter Name are set.SetpointText
Trend GroupsComma-separated list of trend group names this variable belongs to. A variable can be in several groups. The groups are the filter the Trend Analyst offers when picking variables. The names accept the {Device}, {DeviceName} and {VariableName} placeholders, so one UDT definition gives every instance its own group.Pumps,{Device}Text
UnitsEngineering units displayed alongside the value.RPMText
FormatDisplay format of the value on screens and in the Trend Analyst: the value of a Label or Input (unless the object uses its own Floating Point and Decimals), the value text of a Knob and a Slider, the Trend tooltip, a Data Grid Variable column, the right-click menu, Quick Trend, the current value in the Recipe Manager, variable tokens in alarm and event messages, and the Trend Analyst tooltip, summary and pen Format. An Input shows the plain value while it is being edited. 0 shows no decimals, 0.00 always shows two decimals, 0.0## shows one to three decimals and #,##0.00 adds a thousands separator, with up to 15 decimals. Values are rounded half away from zero for display only; alarms and expressions keep the full value, and so does the historian unless Round to Format is on. ReadVariable in the runtime API and MCP returns the Format beside the full value. Leave empty to show the value as received.0.00Text
Min RawMinimum raw value for linear scaling.0Number
Max RawMaximum raw value for linear scaling.27648Number
Min ScaledMinimum scaled (engineering) value.0Number
Max ScaledMaximum scaled (engineering) value.100Number
ConverterConverter name applied to the variable value.Celsius_FahrenheitText
DeadbandMinimum value change required before the historian records a new sample.0.5Number
Minimum TimeMinimum time between historian samples regardless of value change.1000ms
Sample GroupSample group name for historian grouping.FastText
HistorianEnables historian logging for this variable.trueBoolean
Round to FormatStores the historian samples of this variable rounded to the decimals of its Format, as a plain number: with Format 0.00 the value 34.30487 is stored as 34.3. The deadband compares the rounded values, so with Deadband 0 a sample is written only when the rounded value changes. On a variable without scaling the Raw value is stored empty, since it equals the value. The live value, alarms, expressions and all interfaces keep the full value. Applies to new samples only; samples already stored keep their values. Requires a Format.falseBoolean
History SourceWhere the trends read the history of this variable: Project default (the History Source with Project default enabled on the History Sources page, or the EnvisionSCADA Historian when no source has it), EnvisionSCADA Historian (the samples recorded while Historian is on) or a History Source of the History Sources page (a query on a Database Connection or the fetch() function of a Python Module script). In the table, an empty History Source is Project default and Historian is the EnvisionSCADA Historian. Live values always come from the variable itself. Test reads the last 24 hours with the settings in the dialog. See the History Sources article.Project defaultEnum
History ReferenceWhat the History Source reads for this variable: the reference passed to fetch(), or @Variable of the History Query. When empty, the History Reference of the source is used, by default the full name of the variable; the field shows it in italics. {Name} is replaced by the full name of the variable. Browse lists the references that a Script source offers.CDT158Text
History ParametersShown for a Script source: optional key=value pairs separated by ;, added to the History Parameters of the source. A key set here replaces the same key of the source. The field shows the History Parameters of the source in italics.scale=0.1Text
Queue SizeServer-side monitored item queue size.1Integer
Discard OldestWhen the queue is full, discard the oldest notification instead of the newest.trueBoolean
Modbus AddressOptional address on the built-in Modbus TCP and Modbus RTU servers where this variable is exposed. The servers are enabled in the Gateways section of the Parameters page. Each instance device keeps its own value.%MW0See Modbus TCP Addressing
OPC UAExposes this variable on the built-in OPC UA server (re-publish). When Historize is also ticked, the Historian data of the variable is readable through OPC UA Historical Access.trueBoolean
WriteableAllows external systems to write this variable through the gateways: the OPC UA Server, the Modbus TCP and Modbus RTU servers, the MQTT publisher when Subscribe is enabled on the publisher, and Kafka when Consumer is enabled on the Kafka device. Writes from pages, actions, scripts and the API are independent of this setting.trueBoolean
MQTT PublisherName of the MQTT publisher that publishes this variable, typed or chosen with the ... button. A variable is published by one publisher, and the name must match a publisher on the MQTT Publishers page. Leave empty to keep the variable unpublished. Writes from the broker need Subscribe on the publisher and Writeable on the variable. See the MQTT Publishers article.CloudIoTText
Kafka DeviceName of the Kafka device this variable is linked to, typed or chosen with the ... button. Every value change of a linked variable is produced to the Producer Topic of the Kafka device while the device is enabled. Writes from the Consumer Topic need Consumer on the Kafka device and Writeable on the variable. Leave empty to keep the variable unlinked. See the Kafka Devices article.KafkaBroker1Text
Kafka Remap DeviceDevice name used for this variable in Kafka messages instead of the name of the device that owns the variable. Inbound messages from the Consumer Topic are matched on this name as well. Leave empty to use the device name.RemotePLC1Text
Kafka Remap VariableVariable name used for this variable in Kafka messages instead of its own name. Inbound messages from the Consumer Topic are matched on this name as well. Leave empty to use the variable name without the device name, for example Pump1_Speed for PLC1.Pump1_Speed on device PLC1.SpeedText

Browsing the Address Space

The Browse button in the toolbar opens the Browse dialog, which shows the server address space as a tree. The dialog opens on the top level of the server and reads each branch only when it is opened, so the dialog is available immediately regardless of the size of the address space.

Press a branch to open it and read the nodes below it. Nodes that hold a value show their Node ID, Data Type, live Value, Units, Min and Max in the columns next to the name. For nodes of type AnalogItemType, the Units, Min and Max columns are filled from the EngineeringUnits and EURange properties of the node on the server.

Tick the checkbox of a node to select it. Ticking the checkbox of a branch reads the whole branch and selects every variable below it, which is the fastest way to take over a complete device. A branch whose variables are partly selected shows a partially ticked checkbox. The footer shows how many of the variables read so far are selected.

Expand All reads and opens the complete address space at once. On a large server this takes the time of a full browse, so open the branches you need instead when the server is large.

Enter text in the search field to list every variable read so far whose name or Node ID contains the text, as a flat list without the tree. Clear the search field to return to the tree. Searching does not change the selection.

Add Selected creates a variable for every selected node, using the browsed name, Node ID, Data Type, Units, Min Raw and Max Raw. With Start names with {Device}. selected, which is the default, each variable name starts with the {Device} replacer, so the same node added on several devices, or on a template device and its instance devices, gives each device its own variable. Clear Start names with {Device}. to use the browsed name as it is. A plain name must be unique across the whole project, and a template device with instance devices requires the {Device} replacer. Nodes that already exist as a variable on the device, with or without the {Device}. prefix, are reported and skipped. When one of the selected nodes cannot be added, the message names its Node ID and no variable is created.

Update Node IDs writes the Node ID of every selected node onto the existing variable of the same name, with or without the {Device}. prefix, which re-points variables after the server address space has changed. Selected nodes without a matching variable on the device are listed in the result message. Both buttons become available once at least one node is selected.

The browsed name is taken from the server. A node with a string Node ID uses the identifier of that Node ID, which carries the path the server itself uses, and a node with a numeric Node ID uses its browse name. Dots are kept, so with Start names with {Device}. selected a node with Node ID ns=2;s=Channel1.Device1.Tag1 is added as the variable {Device}.Channel1.Device1.Tag1 and is referenced as PLC1.Channel1.Device1.Tag1 on a device named PLC1. A dot is only valid between two parts of a name, so a dot at the start or the end of a browsed name is written as an underscore and repeated dots are reduced to one.

Characters that a variable name does not accept are converted. The characters \ / : ; and the double quote are removed, and every other character except letters, digits, underscores, dots and square brackets, such as a space, a dash or #, is written as an underscore.

Variables added by an earlier version keep the name they were created with, for example a name where dots and dashes were written as underscores. Add Selected and Update Node IDs match these variables as well, so adding such a node again skips the existing variable and re-pointing an existing device keeps working after an upgrade.

ControlDescription
ExpanderOpens or closes a branch. Opening a branch reads the nodes directly below it.
Checkbox on a nodeSelects the node. On a branch, selects every variable below it and reads the branch first.
Select all checkboxSelects every variable in the rows currently shown, which is the search result while a search is active.
Expand All / Collapse AllReads and opens the complete address space, or closes every branch again.
SearchLists the variables read so far whose name or Node ID contains the text, as a flat list.
Update Node IDsWrites the Node ID of each selected node onto the existing variable with the same name. Variables created by an earlier version, with underscores in place of dots and dashes, are matched as well.
Add SelectedCreates a variable for each selected node.

Supported Data Types

The Data Type field determines how the OPC UA value is interpreted.

13 rows
TypeDescription
BooleanTrue or false value.
SByteSigned 8-bit integer.
ByteUnsigned 8-bit integer.
Int16Signed 16-bit integer.
UInt16Unsigned 16-bit integer.
Int32Signed 32-bit integer.
UInt32Unsigned 32-bit integer.
Int64Signed 64-bit integer.
UInt64Unsigned 64-bit integer.
DateTimeDate and time value.
Float32-bit IEEE 754 floating point.
Double64-bit IEEE 754 floating point.
StringUTF-8 character string.

Node ID Format

The Node ID field uses the standard OPC UA node identifier format. The namespace index and identifier type are separated by semicolons.

FormatDescriptionExample
ns={n};s={string}String identifier in namespace n.ns=2;s=Channel1.Device1.Tag1
ns={n};i={integer}Numeric identifier in namespace n.ns=2;i=1001
ns={n};g={guid}GUID identifier in namespace n.ns=2;g=12345678-1234-1234-1234-123456789012
ns={n};b={base64}Opaque (byte string) identifier in namespace n.ns=2;b=AQIDBA==

Variable Arrays

An OPC UA variable can expand into an array by setting the Array size field to a value between 2 and 512. The variable itself is the first element and its Name must end in the first index, for example Sim_OPCUA.Temps[0]. All elements share the same Node id: the node is array-valued on the server, the subscription is created once, and the received array is distributed to the elements by position. Writing an element writes only that position of the array on the server.

The element rows are managed by the first element and appear locked in the variable list. Changing the Array size adds or removes elements at the end; renaming the first element renames all elements. The Training Simulator serves the array node Sim_FloatArray for testing.

The Node id is the unit the driver subscribes to, and the node itself decides how its variables read. Every variable on an array-valued node reads the element at its own position, whether it is an element of a Variable Array, a row of a UDT array member whose Node id has no {Index} token, or a single variable, which reads the first element. Variables on a scalar node read the scalar. A variable at a position above 0 on a scalar node, a position the array does not have, a Node id the server rejects and a node that reports a bad status all show the FormatError or Unknown status with one entry in the System Log Viewer, and a write to such a variable is refused with an entry as well.

Notes

The channel state indicator on each device row shows the current connection status.

When Enable Secure Channel is active, the client certificate is selected with Subject Name and the OPC UA server must trust this certificate for the connection to succeed.

On Windows, install the certificate with its private key in the Windows certificate store under Local Computer / Personal, and make sure the EnvisionSCADA service account can read the private key.

On Docker, the certificates are kept in folders under /app/certs/pki: own (client certificate and private key), trusted (trusted server certificates), issuers (CA certificates) and rejected (rejected server certificates). On the first secure connection EnvisionSCADA creates a self-signed client certificate in the own folder, or uses the certificate with the same subject name that is already there. Mount /app/certs as a volume so the certificates are kept when the container is recreated, otherwise a new certificate is created and the OPC UA server has to trust it again. The device events show which client certificate was loaded or created.

Subscriptions allow different update rates for different groups of variables. Assign fast-changing process values to a subscription with a short publishing interval and slow-changing configuration values to a subscription with a longer interval. This optimizes network and server load.

Variables are referenced at runtime using the format DeviceName.VariableName, for example OPCUA1.Pump1_Speed.

A variable starts with the Unknown status and becomes Good with the first value notification the server sends for its Node id. A variable whose Node id the server rejects, or whose node never publishes a value, keeps the Unknown status with its initial value, so a wrong Node id is visible on the page status icon, in the Status field of the runtime API and on the OPC UA server instead of reading as 0 with a Good status. See the Variable Status article for the full list of status values.

Something missing or wrong in this article? Contact us