2 sys.path.insert(0,
"..")
5 from opcua
import Client
7 from IPython
import embed
13 Subscription Handler. To receive events from server for a subscription 17 print(
"Python: New data change event", node, val)
20 print(
"Python: New event", event.EventType)
25 if __name__ ==
"__main__":
27 logging.basicConfig(level=logging.WARN)
28 client = Client(
"opc.tcp://localhost:53530/OPCUA/SimulationServer/")
32 root = client.get_root_node()
33 print(
"Root is", root)
36 sub = client.create_subscription(500, handler)
37 handle = sub.subscribe_events(evtype=2788)
39 cond = root.get_child([
"0:Types",
"0:EventTypes",
"0:BaseEventType",
"0:ConditionType"])
40 cond.call_method(
"0:ConditionRefresh", ua.Variant(sub.subscription_id, ua.VariantType.UInt32))
def datachange_notification(self, node, val, data)
def event_notification(self, event)