Hey Factory IO team,
Im having multiple problems with both Siemens Tia V20 and Codesys with connecting to your Program.
In Codesys I get a error message right when I want to Configurate the OPC Client:
I get the message: The secure channel has been closed: Remote side closed connection.
With Tia V20 and PLCSIM V20 I cant download your template to the device and get an error here. I tried it with my own programs for PLCSIM and dont have any problems.
What can I do to fix both issues? I would like to use your program as an simulation tool but its sadly not useable right now.
Regards
Hendrik
Hello @h.steinbach.1,
Welcome to the forum!
The error when connecting to Codesys indicates that an OPC server can’t be found at that URL. To fix it, do the following:
1 - If Codesys Control Win is running, please close it.
2 - Start Codesys Control Win V3 on a terminal:
- Find the server URL displayed in the terminal window
- In Factory I/O, Go to FILE > DRIVERS > CONFIGURATION and enter the URL in the OPC Server input field and press Enter to connect:
- Save the scene to keep your changes.
Regarding TIAPortal and S7-PLCSIM:
What error are you getting when downloading the template to PLCSIM?
We have run some tests with TIAPortal V20 and PLCSIM V20, and we were able to download the template to PLCSIM without any issues. We did note that Factory I/O will connect to PLCSIM if you use S7-1200, but currently, it can’t connect to S7-1500. We are looking into this issue and will update you once we have more information.
I’ve also tested TIAPortal V20 with PLCSIM V19, and it worked perfectly, so this could be an alternative. With PLCSIM V19, you can use either S7-1200 or S7-1500.
I hope this helps.
Thank you for your reply, I tried it your way in Codesys but the error message is the same as before.
The secure channel has been closed: Remote side closed connection
In TIA V20 I get following error
I can only put one media per post but I hope this helps
Thank you for your help
The error you are getting in TIAPortal indicates it’s a problem with the CPU you are emulating. I went back to test this; the cause is the CPU version. You have to update it. To do so, in the Project Tree on the left side of the screen, select Device Configuration. Right click on the PLC and select Change device
Choose the CPU you want to use and select the most recent version.
Once you click OK, a window will appear to configure the PLC security settings.
Set up a password and note it down as you’ll probably need it when you try to download to the PLC or SoftPLC. Make sure to disable access control in the PLC access protection section, so that Anonymous login is allowed.
Now you should be able to download to PLCSIM.
I hope this helps.
Thank you, that fixes the problem with PLCSIM.
I’m glad to hear you got it working!
Regarding Codesys, I apologize. I hadn’t noticed the issue with Codesys persists. What port are you using? Is it 4840?
The error could also indicate that a firewall or antivirus is blocking Factory I/O or CodeSys softPLC.
The Port is 4840 yes.
I tried deactivating my antivirus but no luck. can I bypass it in a way?
That’s most likely the issue. The OPC UA standard specifies port 4840 as a reserved port for the local discovery server (LDS). This is an OPC UA service used to browse for OPC UA servers running on a particular computer. It’s the responsibility of an OPC UA server to register itself correctly in the LDS.
If an OPC UA server is registered in the LDS, clients will be able to discover the server’s URL (browse button on Factory I/O). However, an LDS is not required to connect to an OPC UA server if you know the server’s URL.
The problem is that, by default, Codesys uses the OPC UA server on port 4840, just like in your case. You have two possible solutions to fix this issue:
- Uninstall the LDS
- Change Codesys OPC UA port number
=== How to change Codesys OPC UA port number ===
OPC UA ports can be changed by editing the CODESYSControl.cfg file, which is typically located here C:\ProgramData\CODESYS\CODESYSControlWinV3x64\C515D9C. It may vary depending on your system and Codesys version.
- Open this file by using a text editor.
- Uncomment the following line and choose the desired port number (4841 should work fine)
=== How to uninstall the LDS ===
- Open the operating system’s Services Manager under “Start > Control Panel > System and Security > Administrative Tools > Services.”
- Select the “OPC UA Local Discovery Server” service.
- Right-click to open the menu and select STOP.
- Confirm the setting with “OK”
I hope this helps.
As a tip for anybody having the same problem, the file is in your APPDATA folder. just type %APPDATA% in your search bar and you get there.
The LDS service is under Windows tools-> view local services
I changed the port number to 4841 like you sugestet and now have a new error code comming up in Factory IO
I also changed the port to 4851 just to see if it does something but with the same result
Hello @h.steinbach.1,
The error you are now getting indicates that the wrong port is being used.
Did you save the file after editing it?
Did you restart Codesys Control Win?
Did you input the port in Factory I/O?
Thank you so much for your pacient helping me. I got it now to the point that Im connected to the port.
Now I have the issue that the Function Block is not visible in the program.
can that be a problem with codesys to the opc server ? Or have I forgotten a setting?
Are you using a filter in Factory I/O? The filter might return no tags, and in that case, there is nothing to show on the driver’s page.
Did you click “Browse” under Items/Nodes in the driver’s configuration page?
You can also check our Codesys OPC UA tutorial, in case you haven’t. Maybe there is a step there that you missed. You can find it here: Setting up CODESYS OPC UA (SP17 or higher) - FACTORY I/O.