tutorial_nodescontents.rst 5.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. Manipulating node attributes
  2. ============================
  3. In our last tutorial, we created some nodes using both the server and the client side API. In this tutorial, we will explore how to manipulate the contents of nodes.
  4. Getting and setting node attributes
  5. -----------------------------------
  6. ```UA_(Server|Client)_(get|set)AttributeValue( ..., UA_AttributeId attributeId, void* value);```
  7. +----------------------------------------+-----+-----+-------------------------+
  8. | Attribute Name | get | set | Expected type for void* |
  9. +========================================+=====+=====+=========================+
  10. | UA_ATTRIBUTEID_NODEID | ✔ | ✘ | UA_NodeId |
  11. +----------------------------------------+-----+-----+-------------------------+
  12. | UA_ATTRIBUTEID_NODECLASS | ✔ | ✘ | UA_NodeClass | UA_UInt32|
  13. +----------------------------------------+-----+-----+-------------------------+
  14. | UA_ATTRIBUTEID_BROWSENAME | ✔ | ✔ | UA_QualifiedName |
  15. +----------------------------------------+-----+-----+-------------------------+
  16. | UA_ATTRIBUTEID_DISPLAYNAME | ✔ | ✔ | UA_LocalizedText |
  17. +----------------------------------------+-----+-----+-------------------------+
  18. | UA_ATTRIBUTEID_DESCRIPTION | ✔ | ✔ | UA_LocalizedText |
  19. +----------------------------------------+-----+-----+-------------------------+
  20. | UA_ATTRIBUTEID_WRITEMASK | ✔ | ✔ | UA_UInt32 |
  21. +----------------------------------------+-----+-----+-------------------------+
  22. | UA_ATTRIBUTEID_USERWRITEMASK | ✔ | ✔ | UA_UInt32 |
  23. +----------------------------------------+-----+-----+-------------------------+
  24. | UA_ATTRIBUTEID_ISABSTRACT | ✔ | ✔ | UA_Boolean |
  25. +----------------------------------------+-----+-----+-------------------------+
  26. | UA_ATTRIBUTEID_SYMMETRIC | ✔ | ✔ | UA_Boolean |
  27. +----------------------------------------+-----+-----+-------------------------+
  28. | UA_ATTRIBUTEID_INVERSENAME | ✔ | ✔ | UA_LocalizedText |
  29. +----------------------------------------+-----+-----+-------------------------+
  30. | UA_ATTRIBUTEID_CONTAINSNOLOOPS | ✔ | ✔ | UA_Boolean |
  31. +----------------------------------------+-----+-----+-------------------------+
  32. | UA_ATTRIBUTEID_EVENTNOTIFIER | ✔ | ✔ | UA_Byte |
  33. +----------------------------------------+-----+-----+-------------------------+
  34. | UA_ATTRIBUTEID_VALUE | ✔ | ✔ | UA_Variant |
  35. +----------------------------------------+-----+-----+-------------------------+
  36. | UA_ATTRIBUTEID_DATATYPE | ✔ | ✘ | UA_NodeId |
  37. +----------------------------------------+-----+-----+-------------------------+
  38. | UA_ATTRIBUTEID_VALUERANK | ✔ | ✘ | UA_Int32 |
  39. +----------------------------------------+-----+-----+-------------------------+
  40. | UA_ATTRIBUTEID_ARRAYDIMENSIONS | ✔ | ✘ | UA_UInt32 |
  41. +----------------------------------------+-----+-----+-------------------------+
  42. | UA_ATTRIBUTEID_ACCESSLEVEL | ✔ | ✔ | UA_UInt32 |
  43. +----------------------------------------+-----+-----+-------------------------+
  44. | UA_ATTRIBUTEID_USERACCESSLEVEL | ✔ | ✔ | UA_UInt32 |
  45. +----------------------------------------+-----+-----+-------------------------+
  46. | UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL | ✔ | ✔ | UA_Double |
  47. +----------------------------------------+-----+-----+-------------------------+
  48. | UA_ATTRIBUTEID_HISTORIZING | ✔ | ✔ | UA_Boolean |
  49. +----------------------------------------+-----+-----+-------------------------+
  50. | UA_ATTRIBUTEID_EXECUTABLE | ✔ | ✔ | UA_Boolean |
  51. +----------------------------------------+-----+-----+-------------------------+
  52. | UA_ATTRIBUTEID_USEREXECUTABLE | ✔ | ✔ | UA_Boolean |
  53. +----------------------------------------+-----+-----+-------------------------+
  54. The Basenode attributes NodeId and NodeClass uniquely identify that node and cannot be changed (changing them is equal to creating a new node). The DataType, ValueRank and ArrayDimensions are not part of the node attributes in open62541, but instead contained in the UA_Variant data value of that a variable or variableType node (change the value to change these as well).
  55. Setting Variable contents
  56. -------------------------
  57. DataSource nodes and callbacks
  58. ------------------------------
  59. ```UA_Server_addDataSourceVariableNode()```
  60. Iterating over Child nodes
  61. --------------------------
  62. ``` UA_(Server|Client)_forEachChildNodeCall();```
  63. Examining node copies
  64. ---------------------
  65. ``` UA_(Server|Client)_getNodeCopy()```
  66. ``` UA_(Server|Client)_destroyNodeCopy()```
  67. Compile XML Namespaces
  68. ----------------------
  69. Stasiks comfy CMake method.
  70. Manual script call.
  71. Creating object instances
  72. -------------------------
  73. ``` UA_(Server|Client)_createInstanceOf()```