Can not connect to codesys

This WinError 10038 occurs when I was trying to connect to the codesys project.
How to deal with this error? Any help?

Error connecting to server at opc.tcp://localhost:4840.
Exception during cleanup: [WinError 10038]

Hi! Welcome to the forum.

In the same component where you are seeing this error message, try changing opc.tcp://localhost:4840 to opc.tcp://127.0.0.1:4840 and see it it helps. If the issue remains please write back.

If you’re trying this out for the first time, and also for future visitors to this thread, we have a tutorial for connecting Codesys via OPC UA that goes through how to setup the Codesys project.

Hi, very thankful for your reply. There must be something wrong with my codesys, I reinstalled codesys and connected successfully.
Thanks again for your help. :grinning:

Ok, glad to hear it! Good luck with your project.