MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / create_method

Function create_method

opcua/common/manage_nodes.py:126–145  ·  view source on GitHub ↗

create a child method object This is only possible on server side!! args are nodeid, browsename, method_to_be_called, [input argument types], [output argument types] or idx, name, method_to_be_called, [input argument types], [output argument types] if argument types is specified

(parent, *args)

Source from the content-addressed store, hash-verified

124
125
126def create_method(parent, *args):
127 """
128 create a child method object
129 This is only possible on server side!!
130 args are nodeid, browsename, method_to_be_called, [input argument types], [output argument types]
131 or idx, name, method_to_be_called, [input argument types], [output argument types]
132 if argument types is specified, child nodes advertising what arguments the method uses and returns will be created
133 a callback is a method accepting the nodeid of the parent as first argument and variants after. returns a list of variants
134 """
135 nodeid, qname = _parse_nodeid_qname(*args[:2])
136 callback = args[2]
137 if len(args) > 3:
138 inputs = args[3]
139 else:
140 inputs = []
141 if len(args) > 4:
142 outputs = args[4]
143 else:
144 outputs = []
145 return node.Node(parent.server, _create_method(parent, nodeid, qname, callback, inputs, outputs))
146
147
148def _create_object(server, parentnodeid, nodeid, qname, objecttype):

Callers

nothing calls this directly

Calls 2

_parse_nodeid_qnameFunction · 0.85
_create_methodFunction · 0.85

Tested by

no test coverage detected