OPC UA asyncua python: new folder created but server never returns the methods #1177
rolandkroetz
started this conversation in
General
Replies: 1 comment
-
This is more a problem of the server. Did you check in UAExpert if the method exists after a function call? Also maybe the method returns a invalid nodeid on error? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to create a folder on an OPC UA-Server. I use the python asyncua lib. I receive the the NodeId of new folder which is stored in new_folder_id. In the next step I need to create a file. Therefore I need to use the CreateFile method. In the while loop I ask periodically (every 3 seconds) the server if the methods like CreateFile are created for the new folder. By purpose I programmed and endless loop to see if receive a positive response. The problem is that even after a couple of minutes the loop does not terminate. Any ideas why? Code is also in the attached text file
from asyncua import Client
import asyncio
async with Client(url=self._endpoint) as client:
Create the directory on the OPC server
while True:
new_folder = client.get_node(new_folder_id)
methods = await new_folder.get_methods()
if len(methods):
break
asyncio.sleep(3)
code.txt
Beta Was this translation helpful? Give feedback.
All reactions