OPC UA client XML schema

Schema file

The connection configuration is defined in XML files. It is based on the standard UA schema for data types which can be found here.

It is formally defined in this schemathis schema.

<xs:schema elementFormDefault="qualified" targetNamespace="http://phoenixcontact.com/OpcUA/PLCnext/UAClientConfig/Types.xsd" 
xmlns:tns="http://phoenixcontact.com/OpcUA/PLCnext/UAClientConfig/Types.xsd" 
xmlns:ua="http://opcfoundation.org/UA/2008/02/Types.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://opcfoundation.org/UA/2008/02/Types.xsd"/>
    <xs:simpleType name="eUAClientGroupType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="Subscribe_0"/>
             <xs:enumeration value="Write_1"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:element type="tns:eUAClientGroupType" name="eUAClientGroupType"/>
    <xs:complexType name="ListOfeUAClientGroupType">
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" type="tns:eUAClientGroupType" name="eUAClientGroupType" nillable="true"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element type="tns:ListOfeUAClientGroupType" name="ListOfeUAClientGroupType" nillable="true"/>
    <xs:complexType name="eUAClientConfiguration">
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" type="xs:string" name="Name"/>
            <xs:element minOccurs="0" maxOccurs="1" type="ua:ListOfString" name="NamespaceArray"/>
            <xs:element minOccurs="0" maxOccurs="1" type="tns:ListOfeUAClientServerConnection" name="ServerConnections"/>
            <xs:element minOccurs="0" maxOccurs="1" type="tns:ListOfeUAClientVariableGroup" name="VariableGroups"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element type="tns:eUAClientConfiguration" name="eUAClientConfiguration"/>
    <xs:complexType name="ListOfeUAClientConfiguration">
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" type="tns:eUAClientConfiguration" name="eUAClientConfiguration" nillable="true"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element type="tns:ListOfeUAClientConfiguration" name="ListOfeUAClientConfiguration" nillable="true"/>
    <xs:complexType name="eUAClientNodeMapping">
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" type="ua:NodeId" name="LocalVariable"/>
            <xs:element minOccurs="0" maxOccurs="1" type="tns:eUAClientRemoteVariableDescriptor" name="RemoteVariableDescriptor"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element type="tns:eUAClientNodeMapping" name="eUAClientNodeMapping"/>
    <xs:complexType name="ListOfeUAClientNodeMapping">
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" type="tns:eUAClientNodeMapping" name="eUAClientNodeMapping" nillable="true"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element type="tns:ListOfeUAClientNodeMapping" name="ListOfeUAClientNodeMapping" nillable="true"/>
    <xs:complexType name="eUAClientRemoteVariableDescriptor">
        <xs:sequence>
            <xs:element minOccurs="0" type="xs:unsignedInt" name="EncodingMask"/>
            <xs:element minOccurs="0" maxOccurs="1" type="xs:string" name="DiscoveryEndpoint"/>
            <xs:element minOccurs="0" maxOccurs="1" type="xs:short" name="ServerIndex"/>
            <xs:element minOccurs="0" maxOccurs="1" type="ua:NodeId" name="NodeId"/>
            <xs:element minOccurs="0" maxOccurs="1" type="xs:string" name="AliasName"/>
            <xs:element minOccurs="0" maxOccurs="1" type="ua:NodeId" name="AliasReferenceTypeFilter"/>
            <xs:element minOccurs="0" maxOccurs="1" type="ua:ListOfRelativePathElement" name="BrowsePath"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element type="tns:eUAClientRemoteVariableDescriptor" name="eUAClientRemoteVariableDescriptor"/>
    <xs:complexType name="ListOfeUAClientRemoteVariableDescriptor">
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" type="tns:eUAClientRemoteVariableDescriptor" name="eUAClientRemoteVariableDescriptor" nillable="true"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element type="tns:ListOfeUAClientRemoteVariableDescriptor" name="ListOfeUAClientRemoteVariableDescriptor" nillable="true"/>
    <xs:complexType name="eUAClientServerConnection">
        <xs:sequence>
            <xs:element minOccurs="0" type="xs:unsignedInt" name="EncodingMask"/>
            <xs:element minOccurs="0" maxOccurs="1" type="ua:EndpointType" name="Endpoint"/>
            <xs:element minOccurs="0" maxOccurs="1" type="ua:UserTokenType" name="UserTokenType"/>
            <xs:element minOccurs="0" maxOccurs="1" type="xs:string" name="UserName"/>
            <xs:element minOccurs="0" maxOccurs="1" type="xs:string" name="Password"/>
            <xs:element minOccurs="0" maxOccurs="1" type="xs:base64Binary" name="CertificateData"/>
            <xs:element minOccurs="0" maxOccurs="1" type="xs:base64Binary" name="TokenData"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element type="tns:eUAClientServerConnection" name="eUAClientServerConnection"/>
    <xs:complexType name="ListOfeUAClientServerConnection">
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" type="tns:eUAClientServerConnection" name="eUAClientServerConnection" nillable="true"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element type="tns:ListOfeUAClientServerConnection" name="ListOfeUAClientServerConnection" nillable="true"/>
    <xs:complexType name="eUAClientVariableGroup">
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" type="tns:eUAClientGroupType" name="GroupType"/>
            <xs:element minOccurs="0" maxOccurs="1" type="xs:double" name="CycleTime"/>
            <xs:element minOccurs="0" maxOccurs="1" type="tns:ListOfeUAClientNodeMapping" name="NodeMappings"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element type="tns:eUAClientVariableGroup" name="eUAClientVariableGroup"/>
    <xs:complexType name="ListOfeUAClientVariableGroup">
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" type="tns:eUAClientVariableGroup" name="eUAClientVariableGroup" nillable="true"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element type="tns:ListOfeUAClientVariableGroup" name="ListOfeUAClientVariableGroup" nillable="true"/>
</xs:schema>
       

Schema documentation

The OPC UA client configuration is based on OPC UA data type definitions. It also references some well-known data types form the OPC UA specification (like NodeId or UserTokenType). The description of these data types can be found in the official OPC UA reference.

Namespace handling

Namespace indices are used instead of namespaces at different places within the XML file. These indices refer to the common namespace table at the top of the XML file.

Note: Maintain all used namespaces in the namespace table. Do not copy the namespace indices from tools like UA Expert (the namespace index of OPC UA server is only valid during a session).

eUAClientConfiguration

eUAClientConfiguration is a subtype of Structure.

Attribute Data type Description
Name String Name of the configuration (not evaluated by the runtime).
NamespaceArray String List of namespaces used within the client configuration document. All namespace indices are referring to this list.
ServerConnections eUAClientServerConnection Array of servers that are used in this configuration document. All server indices are pointing to this list (the first entry has index 1).
VariableGroups eUAClientVariableGroup Groups of variables that are either subscribed or written to other servers.

eUAClientServerConnection

eUAClientServerConnection is a subtype of Structure.

Attribute Data type Description
Endpoint EndpointType Endpoint with Url, SecurityPolicy and SecurityMode.
Note: If the SecurityPolicy is omitted, the client chooses best available.
UserTokenType UserTokenType UserIdentityToken that is used to authenticate to the server. (not used - leave empty)
UserName StringUserName UserName that is used for UserTokenType UserNameIdentityToken.
Password String Password that is used for UserTokenType UserNameIdentityToken.
CertificateData ByteString Certificate that is used for UserTokenType X509IdentityToken. (not used - leave empty)
TokenData ByteString TokenData that is used for UserTokenType IssuedIdentityToken. (not used - leave empty)

eUAClientVariableGroup

eUAClientVariableGroup is a subtype of Structure.

Attribute Data type Description
GroupType eUAClientGroupType Type of variable group (e.g. subscribe or write).
CycleTime Duration Desired update interval to observe the variables.
Variables are only synchronized when the value of the variables changes.
NodeMappings eUAClientNodeMapping List of mappings with local and remote variables.

eUAClientGroupType

eUAClientGroupType is a subtype of Enumeration.

Attribute Description
Subscribe_0 Subscribe to the variables of the remote OPC UA server.
Write_1 Write changed values of local variables to variables of the remote OPC UA server.

eUAClientNodeMapping

eUAClientNodeMapping is a subtype of Structure.

Attribute Data type Description
LocalVariable NodeId NodeId of a variable of the local OPC UA server.
RemoteVariableDescriptor eUAClientRemoteVariableDescriptor Information how to find a node on a remote OPC UA server.

eUAClientRemoteVariableDescriptor

eUAClientRemoteVariableDescriptor is a subtype of Structure.

Attribute Data type Description
DiscoveryEndpoint String The discovery endpoint URL of the OPC UA server containing the desired node or of the discovery server to begin the search. DiscoveryEndpoint allows access to discovery services without a session and without message security. (not used - leave empty)
ServerIndex Int16 1 based index into the servers array of the eUAClientConfiguration. If the ServerIndex is set to -1, it is expected that the DiscoveryEndpoint is that of a single server that contains the desired node (0 is invalid).
NodeId NodeId The root node from which the BrowsePath is followed. If NodeId is present but the DiscoveryEndpoint and ServerURI are omitted, the NodeId is presumed to be local to the device.
AliasName String An alternate way to specify the root node. If ServerURI is present, only that specific server will be used to find the alias. (not used - leave empty)
AliasReferenceTypeFilter NodeId Optional filter for the FindAlias method. Used if the AliasName is specified. (not used - leave empty)
BrowsePath RelativePathElement BrowsePath BrowsePath which uses the NodeId as starting point. (not used - leave empty)

EndpointType

EndpointType is a subtype of Structure. See also OPC UA client security

Attribute Data type Description
endpointUrl String The URL for the Endpoint (e.g. opc.tcp://192.168.1.10:4840).
securityMode MessageSecurityMode The type of message security.
securityPolicyUri String The URI of the SecurityPolicy.
transportProfileUri String The URI of the transportProfile. (not used - leave empty)

Note: If the SecurityPolicy is omitted, the client chooses best available.

MessageSecurityMode

Security mode for messages between client and server.

Attribute Description
None_1 No protection of messages.
Sign_2 Messages are signed.
SignAndEncrypt_3 Messages are signed and encrypted.

NodeId

A NodeId is encoded as a string with the following syntax:

ns=<namespaceindex>;<type>=<value>
  • <namespaceindex> refers to the NamespaceArray of the eUAClientConfiguration (ns=1 is the first entry).
  • <type> can be one of the following characters:
    • i for numeric identifiers
    • s for string identifiers
    • g for guid identifiers     
    • b for binary identifiers
  • <value> is the identifier value encoded as string.

Examples 

  • ns=1;s=Arp.Plc.Eclr/GlobalPlcVariable
  • ns=1;s=Arp.Plc.Eclr/ProgramInstanceName.FBInstanceName.LocalPlcVariable
  • ns=3;g=09087e75-8e5e-499b-954f-f2a9603db28a
  • ns=4;b=M/RbKBsRVkePCePcx24oRA==
     

 


• Published/reviewed: 2024-12-10  ☃  Revision 075 •