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
@@ -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+
You can’t perform that action at this time.
0 commit comments