OPC UA Server References¶
If you want to use a predefined OPC UA node in your commissioning file, you can use a Node reference to achieve that. One use case of that is placing newly defined nodes at the certain point in the OPC UA server tree. The other possibility is to publish data of predefined nodes as MQTT capable nodes.
It is possible to create an instance of an object type by using the resource
type Cybus::Node::OpcuaObject
Custom ReferenceNode Properties¶
referenceNodeId
(string)¶
reference Nodes in OPC UA server and publish them into the comissioning file context
Example: "MachineToolType"
namespaceUrl
(string)¶
URL of the namespace that contains the the object type to instantiate
Example: "http://opcfoundation.org/UA/MachineTool/"
relativeBrowsePath
(string)¶
This follows the OPC UA specification for relative browse path values relative to the given reference Node Id
Example:
"/Server/ServerCapabilities/OperationLimits/MaxNodesPerBrowse"
startNodeId
(string)¶
Address to the Starting Point for the relative browse path
Example: "ns=0;i=85"
Example Commissioning File¶
Download: opcua-references-example.yml
1---
2description: Test for placing a ToolType inside a MachineTool instance
3
4metadata:
5 name: Tooltype placement test
6
7resources:
8 opcuaServer:
9 type: Cybus::Server::Opcua
10 properties:
11 hostname: 192.168.178.46
12 securityModes: [ 'None', 'SignAndEncrypt' ]
13 securityPolicies: [ 'None', 'Basic256Sha256' ]
14 nodesetFiles: [ 'di', 'machinery', 'machineTool' ]
15 allowAnonymous: true
16 port: 4841
17
18 ######################################
19 #
20 # referencing the "Machines" folder
21 # which got provided by the Machinery
22 # nodeset file
23 #
24 ######################################
25 machineRoot:
26 type: Cybus::Node::OpcuaReference
27 properties:
28 parent: !ref opcuaServer
29 referenceNodeId: 'i=1001'
30 namespaceUrl: 'http://opcfoundation.org/UA/Machinery/'
31
32 ######################################
33 #
34 # instantiating a MachineToolType
35 # from the MachineTool type
36 #
37 ######################################
38 testMachineToolType:
39 type: Cybus::Node::OpcuaObject
40 properties:
41 parent: !ref machineRoot
42 browseName: MyMachineToolTypeTest
43 objectTypeName: MachineToolType
44 sourceNamespaceUrl: 'http://opcfoundation.org/UA/MachineTool/'
45
46
47
48 ######################################
49 #
50 # referencing the "Equipment" subfolder
51 # of the instantiated toolType
52 #
53 ######################################
54 EquipmentFolder:
55 type: Cybus::Node::OpcuaReference
56 properties:
57 parent: !ref testMachineToolType
58 relativeBrowsePath: '/4:Equipment'
59
60 ######################################
61 #
62 # add a toolList type
63 # of the instantiated toolType
64 #
65 ######################################
66 toolList:
67 type: Cybus::Node::OpcuaObject
68 properties:
69 parent: !ref EquipmentFolder
70 browseName: Tools
71 objectTypeName: ToolListType
72 sourceNamespaceUrl: 'http://opcfoundation.org/UA/MachineTool/'
73
74
75 #########################################
76 #
77 # instantiating a ToolType and placing it
78 # into the tools list folder of the instance
79 #
80 ########################################
81 demoToolInstance:
82 type: Cybus::Node::OpcuaObject
83 properties:
84 parent: !ref toolList
85 browseName: DemoTool
86 objectTypeName: ToolType
87 sourceNamespaceUrl: 'http://opcfoundation.org/UA/MachineTool/'
Preexisting nodeIds can be referenced using an absolute nodeId, e.g
ns=1;s=1001
. It is also possible to reference a nodeId by a browsePath from
a certain start point that needs to be specified as well. Please review the BNF
documentation for this:
https://reference.opcfoundation.org/v104/Core/docs/Part4/A.2/