你想要完成什么?结构是相当重要的问题,因为你可以摆脱它。 Onces它的安装运行的服务器并检查它witth他的命令行
opcua-client
这个GUI可能会帮助很多见的服务器的结构。
opcua服务器存在于节点组合之外。他们中的一些标准节点,你会在你运行 编程时许多这些基本的节点可以接收使用最基本的OPC服务器看到:
server.nodes#.
对于你需要找到他们所有自定义节点,你可以通过打电话给孩子来做到这一点。例如:
# To get the root node ALL other nodes are a child fro; this one eventually
root = server.get_root_node()
# To get a child:
root.get_child("0:Objects") #Objects is one of those basic nodes
# You can get a child from a path
# Once again first study the tree with the opcua-client gui
# This gui is installed automatically and under the commane opcua-client
root.get_child(["0:Objects", "0:Server"])
# The above will get the child of Objects called Server
# directly starting at the root node
现在你可以自己创建子节点。你去你想要添加孩子的节点通常: