# Codesys to Factory IO OPC issues

**URL:** <https://community.factoryio.com/t/codesys-to-factory-io-opc-issues/2618>\
**Category:** Drivers\
**Created:** [December 25, 2023, 2:54am UTC](https://community.factoryio.com/t/codesys-to-factory-io-opc-issues/2618 "2023-12-25T02:54:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![randye\_dulaney](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@randye\_dulaney](https://community.factoryio.com/u/randye_dulaney)\
**Post date:** [December 25, 2023, 2:54am UTC](https://community.factoryio.com/t/codesys-to-factory-io-opc-issues/2618/1 "2023-12-25T02:54:35Z")

</div>

I’m having a issue connecting to Factory IO and Codesys using OPC. My Codesys is version 3.5.19.40 and I have Factory IO version 2.5.6. I created the sample project as shown in the Codesys tutorial and compiled and downloaded with no errors. I can attach to the Codesys OPC server with UA Expert and access all the data and perform read and writes with no issues. I can also attach with my Ignition gateway with no issues. Thank you in advance! Modbus TCP works well, too.

![image](https://europe1.discourse-cdn.com/flex017/uploads/factoryio/original/1X/923db1be1bcb7e74032e3da1017198fc4387b6c4.png)

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/factoryio/original/1X/4b55aef6c8e74a5125ed173755b17a582ca2caa7.png)

---

<div class="post-metadata">

**Author:** ![brunovgr](https://dub1.discourse-cdn.com/flex017/user_avatar/community.factoryio.com/brunovgr/32/12_2.png) [@brunovgr](https://community.factoryio.com/u/brunovgr)\
**Post date:** [January 22, 2024, 10:40am UTC](https://community.factoryio.com/t/codesys-to-factory-io-opc-issues/2618/2 "2024-01-22T10:40:39Z")

</div>

Typically, this problem is related to port 4840, which OPC UA Local Discovery Server uses. This service allows UA clients to discover UA servers on the local machine. To see if this is the problem, I recommend that you stop the OPC UA Local Discovery Server service and try to connect to Codesys afterward.

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/factoryio/original/1X/c7ef1f97fe375acd882a98849fc0054d8936ba23.png)

---

<div class="post-metadata">

**Author:** ![randye\_dulaney](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@randye\_dulaney](https://community.factoryio.com/u/randye_dulaney)\
**Post date:** [January 22, 2024, 4:42pm UTC](https://community.factoryio.com/t/codesys-to-factory-io-opc-issues/2618/3 "2024-01-22T16:42:36Z")

</div>

That took care of the problem! I’m a little new at OPC but I’m working at it!  
Thank you!
