# Communication Between External Python Program and Ignition

**URL:** <https://forum.inductiveautomation.com/t/communication-between-external-python-program-and-ignition/56238>\
**Category:** Ignition\
**Created:** [February 17, 2022, 4:27am UTC](https://forum.inductiveautomation.com/t/communication-between-external-python-program-and-ignition/56238 "2022-02-17T04:27:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luke\_Costello](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@Luke\_Costello](https://forum.inductiveautomation.com/u/Luke_Costello)\
**Post date:** [February 17, 2022, 4:27am UTC](https://forum.inductiveautomation.com/t/communication-between-external-python-program-and-ignition/56238/1 "2022-02-17T04:27:29Z")

</div>

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](https://github.com/FreeOpcUa/opcua-asyncio). A working “minimum viable product” can be found in the [server-minimal.py example](https://github.com/FreeOpcUa/opcua-asyncio/blob/master/examples/server-minimal.py). 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!  
-Luke

---

<div class="post-metadata">

**Author:** ![Alice\_Robinson](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Alice\_Robinson](https://forum.inductiveautomation.com/u/Alice_Robinson)\
**Post date:** [February 17, 2022, 5:45am UTC](https://forum.inductiveautomation.com/t/communication-between-external-python-program-and-ignition/56238/2 "2022-02-17T05:45:12Z")

</div>

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