Open JHQRAIN opened 4 years ago
I have no idea what you are asking for and your code isn't formatted at all.
Thank you for answering my question!Well, I mean:“how to print(v) in the main function ”: from opcua import Client
class SubHandler(object): def datachange_notification(self, node, val, data): global v v = val
return v
client = Client("opc.tcp://127.0.0.1:49320") client.connect() tag2 = client.get_node("ns=2;s=test.test.VW100") handler = SubHandler() sub = client.create_subscription(200, handler) handle1 = sub.subscribe_data_change(tag2) print(v)
I want use a value val ,I want determine the variable size of subscription# '' print("Python: New data change event", node, val)''
import sys sys.path.insert(0, "..") import logging
from opcua import Client
class SubHandler(object):
if name == "main":
from IPython import embed