OPC UA Publisher Adapter
This adapter connects to an OPC UA Server to read and write data from/to a machine in a Technical Process.
Properties
Operation | Operation executed by the adapter Possible values:
|
Parameters
Adapter | Adapter main class (do not change!) Possible values: de.softproject.integration.adapter.opcua.OpcUaPublisherAdapter: Main class (default) |
url | Server URL Possible values: Any valid URL, e.g. |
user | Username to connect to the server Possible values: Any string with the user name, e.g. |
password | Password to connect to the server Possible values: Any string with the password, e.g. |
securityMode | Security Mode and Server Policies Possible values:
|
autoReconnect | Specifies whether the client should automatically reconnect to the server or not. |
| Node index Possible values: Any integer with the node index, e.g. |
| Node identifier Possible values: Any string with the node identifier, e.g. |
| Type of the node identifier Possible values:
|
| Options to retrieve the history of a specific node Possible values:
|
from | Start date with the format Possible values: Any date with the appropriate format, e.g. |
to | End date with the format Possible values: Any date with the appropriate format, e.g. |
interval | Interval value in seconds Possible values: Any whole time with the interval in seconds, e.g. |
arrayDelimiter | Character to separate the values within an array Possible values: Any character (default |
Status values
1 | The adapter operation was executed successfully |
-1 | An error occurred while executing the adapter |
Input
For the Read
and Write
operations, the adapter expects a specific XML document with the following elements:
nodeIndex
(Integer)nodeIdentifier
(String)nodeIdentifierType
(String , Numeric)attributeId
(Integer)
- Use the
ListNodesAttributtesId
operation to call the node attribute ID. - You specify arrays by enclosing the values in square brackets, for example [997, 998, 999].
Example input for the READ operation
<?xml version="1.0" encoding="UTF-8"
<RootElement>
<NodeID nodeIndex="5" nodeIdentifier="Counter1" nodeIdentifierType="String" attributeId="13"></NodeID>
<NodeID nodeIndex="5" nodeIdentifier="Square1" nodeIdentifierType="String" attributeId="13"></NodeID>
<NodeID nodeIndex="5" nodeIdentifier="Triangle1" nodeIdentifierType="String" attributeId="13"></NodeID>
<NodeID nodeIndex="0" nodeIdentifier="2256" nodeIdentifierType="Numeric" attributeId="5"></NodeID>
</RootElement>
Example input for the WRITE operation without arrays
<?xml version="1.0" encoding="UTF-8"
<RootElement>
<NodeID nodeIndex="5" nodeIdentifier="Counter1" nodeIdentifierType="String" attributeId="13">999</NodeID>
<NodeID nodeIndex="5" nodeIdentifier="Square1" nodeIdentifierType="String" attributeId="13">9636</NodeID>
<NodeID nodeIndex="5" nodeIdentifier="Triangle1" nodeIdentifierType="String" attributeId="13">TestData</NodeID>
<NodeID nodeIndex="0" nodeIdentifier="2256" nodeIdentifierType="Numeric" attributeId="5">Testing</NodeID>
</RootElement>
Example input for the WRITE operation with arrays
<?xml version="1.0" encoding="UTF-8"?>
<RootElement>
<NodeID nodeIndex="6" nodeIdentifier="BooleanArray" nodeIdentifierType="String" attributeId="13">[true, true, true, true, true]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="ByteArray" nodeIdentifierType="String" attributeId="13">[1, 2, 3, 4, 5]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="ByteStringArray" nodeIdentifierType="String" attributeId="13">[[3] 0x010203, [3] 0x040506, [3] 0x070809, [3] 0x010101]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="DateTimeArray" nodeIdentifierType="String" attributeId="13">[2021-01-23 09:33:08.0031200 GMT, 2021-02-23 09:33:08.0031200 GMT]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="DoubleArray" nodeIdentifierType="String" attributeId="13">[1.0, 2.0, 3.0, 4.0, 5.0]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="FloatArray" nodeIdentifierType="String" attributeId="13">[1.0, 2.0, 3.0, 4.0, 5.0]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="GUIDArrayArray" nodeIdentifierType="String" attributeId="13">[66c6a6fa-79a8-4a47-b0d4-6416f3836bf5, abdb9e68-dd91-4a85-84a1-54a1620209fd]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="Int16Array" nodeIdentifierType="String" attributeId="13">[1, 2, 3, 4, 5]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="Int32Array" nodeIdentifierType="String" attributeId="13">[1, 2, 3, 4, 5]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="Int64Array" nodeIdentifierType="String" attributeId="13">[1, 2, 3, 4, 5]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="LocalizedTextArray" nodeIdentifierType="String" attributeId="13">[(de) Text1, (de) Text2, (de) Text3, (de) Text4, (de) Text5, (de) Text0]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="QualifiedNameArray" nodeIdentifierType="String" attributeId="13">[Default Binary, Default XML, Default Binary, Default XML, Default Binary]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="SByteArray" nodeIdentifierType="String" attributeId="13">[1, 2, 3, 4, 5]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="StringArray" nodeIdentifierType="String" attributeId="13">[testString1, testString2, testString3, testString4, testString5]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="UInt16Array" nodeIdentifierType="String" attributeId="13">[1, 2, 3, 4, 5]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="UInt32Array" nodeIdentifierType="String" attributeId="13">[1, 2, 3, 4, 5]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="UInt64Array" nodeIdentifierType="String" attributeId="13">[1, 2, 3, 4, 5]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="VariantArray" nodeIdentifierType="String" attributeId="13">[true, true, true, true, true, true]</NodeID>
<NodeID nodeIndex="6" nodeIdentifier="XmlElementArray" nodeIdentifierType="String" attributeId="13"><![CDATA[[<?xml version="1.0" encoding="utf-8" standalone="no"?>
<testElement1/>
, <?xml version="1.0" encoding="utf-8" standalone="no"?>
<testElement2/>
, <?xml version="1.0" encoding="utf-8" standalone="no"?>
<testElement3/>
, <?xml version="1.0" encoding="utf-8" standalone="no"?>
<testElement4/>
, <?xml version="1.0" encoding="utf-8" standalone="no"?>
<testElement5/>
]]]></NodeID>
</RootElement>
Output
The adapter outputs a specific XML document with the result:
Sample output for the READ operation
<?xml version="1.0" encoding="UTF-8"
<Result>
<NodeID statusCode="GOOD" nodeIndex="5" nodeIdentifier="Counter1" nodeIdentifierType="String">999</NodeID>
<NodeID statusCode="GOOD" nodeIndex="5" nodeIdentifier="Square1" nodeIdentifierType="String">9636.0</NodeID>
<NodeID statusCode="GOOD" nodeIndex="5" nodeIdentifier="Triangle1" nodeIdentifierType="String">1.5999999955515</NodeID>
<NodeID statusCode="GOOD" nodeIndex="0" nodeIdentifier="2256" nodeIdentifierType="Numeric">The current status of the server</NodeID>
</Result>
Example output for the WRITE operation
<?xml version="1.0" encoding="UTF-8"
<RootElement>
<NodeID nodeIndex="5" nodeIdentifier="Counter1" nodeIdentifierType="String">SUCCESS</NodeID>
<NodeID nodeIndex="5" nodeIdentifier="Square1" nodeIdentifierType="String">SUCCESS</NodeID>
<NodeID nodeIndex="5" nodeIdentifier="Triangle1">XML malformed - Invalid value format to write into the Node attribute</NodeID>
<NodeID nodeIndex="0" nodeIdentifier="2256">Bad_NotWritable (0x803B0000) "The access level does not allow writing to the Node</NodeID>
</RootElement>