Skip to content

Commit c3ef2a6

Browse files
committed
start work on client side
1 parent e67c4b0 commit c3ef2a6

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
@@ -533,4 +534,21 @@ def register_namespace(self, uri):
533534
ns_node.set_value(uries)
534535
return len(uries) - 1
535536

537+
def import_structures(self, nodes=None):
538+
"""
539+
Download xml from given variable node defining custom structures.
540+
If no node is given, attemps to import variables from
541+
"""
542+
if not nodes:
543+
nodes = []
544+
opc_bin = self.nodes.base_data_type.get_child("0:OPC Binary")
545+
for desc in opc_bin.get_children_descriptions():
546+
if desc.BrowseName != ua.QualifiedName("opc.Ua"):
547+
nodes.append(self.get_node(desc.NodeId))
548+
549+
for node in nodes:
550+
xml = node.get_value()
551+
gen = StructGenerator(xml, name)
552+
536553

554+

0 commit comments

Comments
 (0)