2 High level method related functions 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 variants which are output of the method 17 if isinstance(methodid, str):
18 methodid = parent.get_child(methodid).nodeid
20 methodid = methodid.nodeid
28 result =
_call_method(parent.server, parent.nodeid, methodid, arguments)
30 if len(result.OutputArguments) == 0:
32 elif len(result.OutputArguments) == 1:
33 return result.OutputArguments[0].Value
35 return [var.Value
for var
in result.OutputArguments]
40 request.ObjectId = parentnodeid
41 request.MethodId = methodid
42 request.InputArguments = arguments
43 methodstocall = [request]
44 results = server.call(methodstocall)
46 res.StatusCode.check()
52 Method decorator to automatically convert 53 arguments and output to and from variants 55 def wrapper(parent, *args):
57 result =
func(parent, *[arg.Value
for arg
in args])
62 result =
func(self, parent, *[arg.Value
for arg
in args])
def call_method(parent, methodid, args)
def func(parent, variant)
def _call_method(server, parentnodeid, methodid, arguments)