Replies: 1 comment 3 replies
-
|
first of all publishing intervals lower then 50ms are kind of unrealistic in python especialy if you plan to hace many of them! |
Beta Was this translation helpful? Give feedback.
3 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everybody,
I,m new to Python so please be kind.
I got an OPC Sever with several nodes. I want to read them by using subscription as it seems to be the fastest way.
Values are changing in invervals of 5-20 ms. I've set up and subscription handler and everything is working just fine.
But I'm wondering, how to check, which node triggered the data_change function. I want to append the values of the different nodes to individual variables to save them afterwards.
How can i check which nodes triggers the data_change? Do i really have to parse all the Node String? All my nodes are around 20-30 signs and not of equal length. So would be quite complicated.
Thanks a lot
Jack
`from opcua import Client
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import time
valuesN1 = []
valuesN2 = []
valuesN3 = []
class SubHandler(object):
client = Client("my_URL_XYZ")
client.connect()
N1 = client.get_node("ns=12;s=XXX_YYY_ZZZ")
N2 = client.get_node("ns=12;s=XX_YY_ZZ")
N3 = client.get_node("ns=12;s=X_Y_Z")
data = [N1,N2,N3]
handler = SubHandler()
sub = client.create_subscription(10,handler)
handle = sub.subscribe_data_change(data)`
Beta Was this translation helpful? Give feedback.
All reactions