File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616from opcua .common import utils
1717from opcua .crypto import security_policies
1818from opcua .common .shortcuts import Shortcuts
19+ from opcua .common .structures_generator import StructGenerator
1920use_crypto = True
2021try :
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+
You can’t perform that action at this time.
0 commit comments