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 Server tree. The other possibility is to publish data of predefined nodes as MQTT capable nodes.

It is possible to create am instance of an object type by using the resource type Cybus::Node::OpcuaObject

Custom Properties

relativeBrowsePath (string)

path to the referenced node as starting point

startNodeId (string)

starting point for the relative Browse path

referenceNodeId (string)

absolute NodeId to reference

namespaceUrl (string)

namespace url of the node to reference

parent (string)

Reference to parent node Id in the commissioning file

Example Commissioning File

Download: opcua-references-example.yml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
description: Test for placing a ToolType inside a MachineTool instance

metadata:
  name: Tooltype placement test

resources:
  opcuaServer:
    type: Cybus::Server::Opcua
    properties:
      alternateHostname: 192.168.178.46
      securityModes: [ 'None', 'SignAndEncrypt' ]
      securityPolicies: [ 'None', 'Basic256Sha256' ]
      nodesetFiles: [ 'di', 'machinery', 'machineTool' ]
      allowAnonymous: true
      port: 4841

  ######################################
  #
  # referencing the "Machines" folder
  # which got provided by the Machinery
  # nodeset file
  #
  ######################################
  machineRoot:
    type: Cybus::Node::OpcuaReference
    properties:
      parent: !ref opcuaServer
      referenceNodeId: 'i=1001'
      namespaceUrl: 'http://opcfoundation.org/UA/Machinery/'

  ######################################
  #
  # instantiating a MachineToolType
  # from the MachineTool type
  #
  ######################################
  testMachineToolType:
    type: Cybus::Node::OpcuaObject
    properties:
      parent: !ref machineRoot
      browseName: MyMachineToolTypeTest
      objectTypeName: MachineToolType
      sourceNamespaceUrl: 'http://opcfoundation.org/UA/MachineTool/'



  ######################################
  #
  # referencing the "Equipment" subfolder
  # of the instantiated toolType
  #
  ######################################
  EquipmentFolder:
    type: Cybus::Node::OpcuaReference
    properties:
      parent: !ref testMachineToolType
      relativeBrowsePath: '/4:Equipment'

  ######################################
  #
  # add a toolList type
  # of the instantiated toolType
  #
  ######################################
  toolList:
    type: Cybus::Node::OpcuaObject
    properties:
      parent: !ref EquipmentFolder
      browseName: Tools
      objectTypeName: ToolListType
      sourceNamespaceUrl: 'http://opcfoundation.org/UA/MachineTool/'

  
  #########################################
  #
  # instantiating a ToolType and placing it
  # into the tools list folder of the instance
  #
  ########################################
  demoToolInstance:
    type: Cybus::Node::OpcuaObject
    properties:
      parent: !ref toolList
      browseName: DemoTool
      objectTypeName: ToolType
      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 specified as well. Please review the BNF documentation for this:

https://reference.opcfoundation.org/v104/Core/docs/Part4/A.2/

This text needs to be extended to show how to specify a browsepath.