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)
| 7 | |
| 8 | |
| 9 | def 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 | |
| 27 | def call_method_full(parent, methodid, *args): |
nothing calls this directly
no test coverage detected