Hello,
When I try to add a folder using the Python OPC-UA client from here I get the following error:
opcua.ua.uaerrors._auto.BadNotSupported: "The requested operation is not supported."(BadNotSupported)
The user has the role ReadWrite assigned.
I’m not sure if the code is wrong or I need to change something in Ignition?
Any guidance is much appricated!
Sample code:
from opcua import ua
from opcua import Client
import sys
sys.path.insert(0, "..")
if __name__ == "__main__":
client = Client("opc.tcp://localhost:62541/")
client.set_user("test")
client.set_password("test")
try:
client.connect()
test = client.get_node("ns=2;s=[Sample_Tags]")
print("Info: ", test)
test.add_folder("ns=2;s=[Sample_Tags]/Test", "Test")
finally:
client.disconnect()
Output:
Requested session timeout to be 3600000ms, got 120000ms instead
Info: ns=2;s=[Sample_Tags]
Traceback (most recent call last):
File "/home/simon/Projects/opcua-client/test copy.py", line 31, in <module>
test.add_folder("ns=2;s=[Sample_Tags]/Test", "Test")
File "/home/simon/Projects/opcua-client/venv/lib/python3.8/site-packages/opcua/common/node.py", line 658, in add_folder
return opcua.common.manage_nodes.create_folder(self, nodeid, bname)
File "/home/simon/Projects/opcua-client/venv/lib/python3.8/site-packages/opcua/common/manage_nodes.py", line 41, in create_folder
return node.Node(parent.server, _create_object(parent.server, parent.nodeid, nodeid, qname, ua.ObjectIds.FolderType))
File "/home/simon/Projects/opcua-client/venv/lib/python3.8/site-packages/opcua/common/manage_nodes.py", line 171, in _create_object
results[0].StatusCode.check()
File "/home/simon/Projects/opcua-client/venv/lib/python3.8/site-packages/opcua/ua/uatypes.py", line 218, in check
raise UaStatusCodeError(self.value)
opcua.ua.uaerrors._auto.BadNotSupported: "The requested operation is not supported."(BadNotSupported)