No our external applications will access the Ignition opc ua server thru the services to browse its address space, subscribe to events, tags etc.
Then your external applications are presumably using some kind of OPC UA toolkit or SDK and you should find code examples that are specific to that SDK.
Ok, that’s what I was also thinking about. I did see the prosys sdk some time back for examples. However you had mentioned on the forum or LinkedIn some python based library. I think it would also be a good reference.
While trying to connect to Ignition OPC UA server with py commands “client=Client(“opc.tcp://127.0.0.1:62541”)” and “client.connect()” on localhost, I get following error:
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
The Ignition server is running on local mode. What could be the problem.
Does it work if you use “localhost” instead of 127.0.0.1? Is the Ignition loopback connection good?
No, the same error
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python38\lib\site-packages\opcua\client\client.py", line 272, in connect self.connect_socket() File "C:\Python38\lib\site-packages\opcua\client\client.py", line 297, in connect_socket self.uaclient.connect_socket(self.server_url.hostname, self.server_url.port) File "C:\Python38\lib\site-packages\opcua\client\ua_client.py", line 256, in connect_socket return self._uasocket.connect_socket(host, port) File "C:\Python38\lib\site-packages\opcua\client\ua_client.py", line 155, in connect_socket sock = socket.create_connection((host, port), timeout=self.timeout) File "C:\Python38\lib\socket.py", line 808, in create_connection raise err File "C:\Python38\lib\socket.py", line 796, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
I don’t know then. Make sure Ignition is actually running, its own loopback connection works, and check the bind address you have configured for the server.
Loopback connection to ignition is enabled. However anonymous access was disabled, I enabled it and saved the changes and tried again but still it gives same error. I don’t know what is “User Source”, it is set to opcua-module, i tried changing it to Default, but same error. Do I have to restart the Ignition server?
You have to restart for anonymous access to be allowed, but that’s not likely to fix the error you’re seeing. Don’t change the user source or you’ll break your loopback connection.
hmmm… let me do some more trial and error.
Take a screenshot of your Config > OPC UA > Server Settings page.
Seems fine, but you’ll eventually need to change your Security Policies to “None,Basic256Sha256” and restart again once you figure out this socket/network error, or the Python client won’t be able to connect.
Thanks a lot , i will try after a while and update you…
I changed the security policy to None and saved the settings, but the same error. Do I need to restart to gateway server or OPC server?
Any change in that settings area requires a restart of the OPC UA module or gateway.
Yes, I restarted the module and I think it connected! However it gives the warning
Requested session timeout to be 3600000ms, got 120000ms instead
So guess its a very basic client without any encryption ! I will just test if I am able to browse the server , that will confirm if its working!
Yes, its working fine, the command objects.get_children() gives:
[Node(FourByteNodeId(i=2253)), Node(StringNodeId(ns=1;s=Devices)), Node(StringNodeId(ns=2;s=Tag Providers))]
It seems to be working fine. I need to test teh remaining functions. Thanks a lot Kevin!
What is the information model used in OPC UA server of Ignition? i.e. Structure of the nodes and references and reference types , name spaces etc? Any write up available? Some guidance will be appreciated.
Other than the nodes belonging to namespace 0 there is no defined information model.
There’s a Devices folder referenced by the Objects folder. Each device instance is represented by its own folder under the Devices folder. Nodes are just BaseDataVariableNodes. Most references are either Organizes or HasComponent.
There are no custom ObjectTypes, VariableTypes, DataTypes, or References.