How to set value of a NODE inside the datachange_notification ? #1121
dibyendumca
started this conversation in
Show and tell
Replies: 1 comment 4 replies
-
You can use a async function aswell: class SubHandler(object):
def __init__(self, clientId):
self.clientId = clientId
async def datachange_notification(self, node, value, Data):
if str(node) == "ns=2;i=19":
curStat = self.clientId.get_node("ns=2;i=6")
await curStat.set_value(value) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
**Hello,
I have a requirement as follows.
I want to update the value of a NODE as soon as I get the datachange_notification of another specific NODE.
I have the client code as follows...**
But I could not call this " await curStat.set_value(value) " inside a non async function.
I get the following ERROR...
await curStat.set_value(value)
^
SyntaxError: 'await' outside async function
Beta Was this translation helpful? Give feedback.
All reactions