Skip to content

Commit c4037e7

Browse files
committed
start work on client side
1 parent 99cb50f commit c4037e7

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

opcua/client/client.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from opcua.common import utils
1717
from opcua.crypto import security_policies
1818
from opcua.common.shortcuts import Shortcuts
19+
from opcua.common.structures_generator import StructGenerator
1920
use_crypto = True
2021
try:
2122
from opcua.crypto import uacrypto
@@ -550,4 +551,21 @@ def register_namespace(self, uri):
550551
ns_node.set_value(uries)
551552
return len(uries) - 1
552553

554+
def import_structures(self, nodes=None):
555+
"""
556+
Download xml from given variable node defining custom structures.
557+
If no node is given, attemps to import variables from
558+
"""
559+
if not nodes:
560+
nodes = []
561+
opc_bin = self.nodes.base_data_type.get_child("0:OPC Binary")
562+
for desc in opc_bin.get_children_descriptions():
563+
if desc.BrowseName != ua.QualifiedName("opc.Ua"):
564+
nodes.append(self.get_node(desc.NodeId))
565+
566+
for node in nodes:
567+
xml = node.get_value()
568+
gen = StructGenerator(xml, name)
569+
553570

571+

0 commit comments

Comments
 (0)