PLC connection with codesys issues

Hello, when I was tried with PLC tutorial 1 (the name in the public shared file is python boolean logic) in simumatik and codesys, I followed the instruction but there is some connection problem between simumatik and codesys. the following screenshots are the status of the simumatik and codesys, it may be the problems of URL, but I can’t figure it out now. anyone could help with this? thanks a lot in advance :smiley:

Hello! I am unable to reproduce any issue. Can you describe further in which way you experience the connection problems?


I think i might have the same problem. When i try to add opc.tcp://localhost:4840 as the gateway it does not connect. When connecting to ws:// it connects but in i while (sometimes directly) the gateway sign at the top turns orange (not sure what that means though).

What functions would not work if i´m connected to ws:// and not opc.tcp://localhost:4840? I think everything i have done so far works but its a “easy target” to blame when things don´t work as planned.

I´m connected to Codesys and everything looks fine there from what i can see.


Hello Martin, I think the problem has been shown in the pictures, I have followed the instruction of the simumatik user manual to set the PLC program in very detail in codesys, the simumatik PLC status is standby but not running, and the reminder info. shows that some problems regarding with setup, I viewed some videos on youtube which in Spanish, it seems that every step are the same, but they can build the connection directly, I was confused by this problem for a few days, it must have some problem but I cannot find it. by the way, how can I change my user name from the mysterious numbers to the normal name in this community? thank you

Hello Martin, thanks for your share, can you connect the PLC between simumatik and codesys? From my understanding, the gateway URL and plc URL is different in simumatik platform. the gateway URL showned in the platform is always ws://, but sometimes the info. shows that it connect to “this server”, sometimes connect to “the other server”, the PLC URL “opc.tcp://localhost:4840” is just as the same as the user manual, I haven’t change both of them.

Can you please download the program UAExpert from the address You need to register to install it. This program lets us see connections to codesys so we can rule out some possible causes.

When you have installed the program, open it and press the blue plus icon. You should have the Soft PLC in codesys running. connect to the PLC by clicking “Custom Discovery” and enter the addres (opc.tcp://localhost:4840 in this case). Are you able to connect?

Hello Martin, I am not sure I have done everything 100% correct according to your instruction, the attached pictures are the screenshots during the process, it shows that some problem with connection, please help to check it. thank you for your support.

It would help to see the Gateway logs, but it’s a bit tricky to get them, since they are disabled by default.

Start by killing the gateway via the task manager if it is running.

Simumatik Gateway keep some configuration files in C:/Users/username/Simumatik/gateway
Inside this folder there is a file called

Remove the following lines and save the file.

Restart the gateway. A file will be created in the Simumatik folder called Gateway_launcher_logs.txt
Please mail that one to me :slight_smile:

Regards, Martin


I’m experiencing the same stated problem described in this thread. I have carefully followed each step described in “Tutorial 1: Boolean logic”, but Codesys and Simumatik just won’t communicate with each other. I’m starting to believe that the problem cause is on the Codesys side, is there something different with the latest version?

Edit: I believe I found the problem cause.
It is as I mentioned, there is something wrong with the latest version of Codesys (CODESYS V3.5 SP17). I tried doing the same connections with an earlier version of Codesys (CODESYS V3.5 SP15 Patch 2) and everything seems to be working fine.


Hi Viktor, Thanks for your information, you have reinstalled the Codesys for the old version? I am thinking that the gateway between simumatik and codesys is based on the old version of codesys.

So an update on this issue. Codesys now forces username and password as default. Allowing anonymous login should solve the issue. This can be done by creating a user and then changing the policy. This is documented here Device OPC UA with a CodeSys V3-based controller under “Change communication policy”. We will update our documentation to reflect this change, but hopefully you can get it to work with the information provided in the link :slight_smile:


it’s done, thank you.

hello viktor, please refer to the lastest reply from Martin, I have solved this problem based on this instruction in codesys SP17.

hello Martin, please refer to the lastest reply from Martin Jacobsson, I have solved this problem based on this instruction in codesys SP17.

Martins solution seems to be working great, thank you so much! Now we’re able to program PLC with the latest Codesys version.

Best regards,