Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List all available variables in server #646

Open
Tenceto opened this issue Jul 10, 2018 · 8 comments
Open

List all available variables in server #646

Tenceto opened this issue Jul 10, 2018 · 8 comments

Comments

@Tenceto
Copy link

Tenceto commented Jul 10, 2018

Hi all,

I was wondering if there is any way to list all the available variables to be measured in a given OPC UA Server. For example, in OpenOPC there is an option that lets you flatten out the entire tree into leaf nodes, freeing the user from needing to be concerned with the hierarchical structure.

Is there a way to do this in OpcUa, without needing to search the entire tree for variable nodes?

@oroulet
Copy link
Member

oroulet commented Jul 10, 2018

I am having a hard time understanding why someone would need such a thing. It is not easier to search in a flat tree than in a hierarchy... In additions servers are supposed to follow some kind of spec explaining where the interesting variables are

@Tenceto
Copy link
Author

Tenceto commented Jul 11, 2018

I'm new to OPC and I'm just learning its basics, so maybe you are right and I'm thinking of doing absurd stuff.

I just wanted to generate an array with all the variable names and their paths that can be found in the server. I think this would be useful if the server is not well-documented and the paths to the variables are not specified anywhere. This would let us read some variables automatically rather than searching for them manually using the functions get_children() and get_root_node().

Is this too cumbersome?

@zerox1212
Copy link
Contributor

Doing what you are asking is not impossible, but I don't think it's in the scope of this library. The user could easily make their own recursive search function that collects all the variable nodes to a dict or something.

@wattzor
Copy link

wattzor commented Sep 10, 2019

Im also looking for this, to get the whole server three in to a dictonary. How did you solve this ?

@oroulet
Copy link
Member

oroulet commented Sep 10, 2019

To state it one more time: if you want to do that you are doing something really wrong. Read and try to understand opcua first

@zerox1212
Copy link
Contributor

@wattzor You will get more help if you try it yourself first and post your code. Accomplishing this is very basic python. If you don't know how to do it you could try stack overflow first.

@wattzor
Copy link

wattzor commented Sep 11, 2019

@wattzor You will get more help if you try it yourself first and post your code. Accomplishing this is very basic python. If you don't know how to do it you could try stack overflow first.

Well i've done a loop that gets the whole three. But its really slow, and sometimes i get dublicates from .get_childrens()

all im wondering if there is quick way to display whats on a server, the loop methode is really slow , thats why i asked how you solved it. I have a bunch of plcs connected and i just need to know there names and what nodes the plc has

@zerox1212
Copy link
Contributor

zerox1212 commented Sep 11, 2019

#863

This is the only way that has been posted on here. As said before, UA is not designed to have flat address space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants