1 from opcua
import Client, ua
2 from opcua.ua import ua_binary
as uabin
15 self.client.disconnect()
18 if __name__ ==
'__main__':
19 with
HelloClient(
"opc.tcp://localhost:40840/freeopcua/server/")
as client:
20 root = client.get_root_node()
21 print(
"Root node is: ", root)
22 objects = client.get_objects_node()
23 print(
"Objects node is: ", objects)
25 hellower = objects.get_child(
"0:Hellower")
26 print(
"Hellower is: ", hellower)
28 resulting_text = hellower.call_method(
"0:SayHello",
False)
31 resulting_text = hellower.call_method(
"1:SayHello2",
True)
34 resulting_array = hellower.call_method(
"1:SayHelloArray",
False)
35 print(resulting_array)
def __exit__(self, exc_type, exc_val, exc_tb)
def __init__(self, endpoint)