Communication Between External Python Program and Ignition

Howdy all!

I spent a while today trying to setup communication between an external Python program and Ignition. I saw forum posts suggesting methods, but no concrete & implemented solutions. As such, I wanted to document the basic steps I’ve taken in case others are looking to accomplish the same thing.

To summarize, I setup my Python program to create an OPC UA server, linked the Ignition client to this server, and easily added tags in the Ignition Designer. Viola, easy connection.

The external Python program uses FreeOpcUa/Opcua-asyncio. A working “minimum viable product” can be found in the example. I simply changed the set_endpoint command to server.set_endpoint(‘opc.tcp://localhost:4840/server/’)
After this, connecting the Ignition Gateway to this server is as simple as pointing Ignition at the server in the Gateway > Config > OPC Connections. Once connected, any variables created in the Python program may be accessed in the Ignition Designer.

I’m not sure if this is the most efficient way to get communication with an outside program, but it works.

I hope this helps somebody!


Thank you for this info. It might be helpful on my ongoing work. Keep sharing and welcome.