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

Function call_method

opcua/common/methods.py:9–24  ·  view source on GitHub ↗

Call an OPC-UA method. methodid is browse name of child method or the nodeid of method as a NodeId object arguments are variants or python object convertible to variants. which may be of different types returns a list of values or a single value depending on the output of the me

(parent, methodid, *args)

Source from the content-addressed store, hash-verified

7
8
9def call_method(parent, methodid, *args):
10 """
11 Call an OPC-UA method. methodid is browse name of child method or the
12 nodeid of method as a NodeId object
13 arguments are variants or python object convertible to variants.
14 which may be of different types
15 returns a list of values or a single value depending on the output of the method
16 """
17 result = call_method_full(parent, methodid, *args)
18
19 if len(result.OutputArguments) == 0:
20 return None
21 elif len(result.OutputArguments) == 1:
22 return result.OutputArguments[0]
23 else:
24 return result.OutputArguments
25
26
27def call_method_full(parent, methodid, *args):

Callers

nothing calls this directly

Calls 1

call_method_fullFunction · 0.85

Tested by

no test coverage detected