Siemens S7-1200 profinet communication with codesys plc

Thank you. I haven't tried to reboot the computer after disabling the firewall. I will try this way.
If that does not work you may have some device in between the systems that is blocking the traffic.

Are both devices on the same network?
Is there a managed switch or router (if on different networks)?

Switch or router configuration could interfere with PROFINET IO data, if not configured properly.
 
If that does not work you may have some device in between the systems that is blocking the traffic.

Are both devices on the same network?
Is there a managed switch or router (if on different networks)?

Switch or router configuration could interfere with PROFINET IO data, if not configured properly.
Both the devices are on same subnet 192.168.2.2 and 192.168.2.22.

Both Siemens TIA portal and codesys are installed and used on different computer systems. They are connected by ethernet cables to siemens plc as shown in attached image where the extended port hub is highlighted. I can ping both the system so that means there is no issue in connection.
 

Attachments

  • plc.jpg
    plc.jpg
    239.4 KB · Views: 17
Both the devices are on same subnet 192.168.2.2 and 192.168.2.22.

Both Siemens TIA portal and codesys are installed and used on different computer systems. They are connected by ethernet cables to siemens plc as shown in attached image where the extended port hub is highlighted. I can ping both the system so that means there is no issue in connection.
Is there any other network switch in-between the PLC and the Codesys controller?
Just the one switch in the electrical cabinet?

Is the network switch in the cabinet managed?
 
Is there any other network switch in-between the PLC and the Codesys controller?
Just the one switch in the electrical cabinet?

Is the network switch in the cabinet managed?
There is only one switch between PLC and codesys controller.

Currently, I am not using physical codesys controller instead just the software in computer (i.e. Virtual codesys controller).

I need this codesys controller for HMI.

Let me know if it is confusing I will try to explain it better.
 
There is only one switch between PLC and codesys controller.

Currently, I am not using physical codesys controller instead just the software in computer (i.e. Virtual codesys controller).

I need this codesys controller for HMI.

Let me know if it is confusing I will try to explain it better.
This makes sense.
Is the switch in the cabinet managed? Do you know make / model of the switch?

Assuming you imported the GSD properly ito Codesys from the S7 PLC, this still feels like an issue with the Codesys computer, Windows settings are typically the most common issue.

Are there any other applications on the Codesys computer that your IT team might have installed? This can also block communications (in addition to Windows Firewall).
 
I can ping both the system so that means there is no issue in connection.
There's more to networking than PINGs getting through.

Some switches, like Cisco, block PN traffic by default, due to the way they use VLAN0 to apply a priority to the PN frame. It's fixable, often by activating a VOIP setting.

I've also seen errors if there is a mismatch between the Controller and Device PN settings, but your selection of "have the controller tell the IDevice what the parameters are" (whatever the actual wording is) should prevent those. It's a mess if you don't use that setting, even between Siemens PLCs.
 
There's more to networking than PINGs getting through.

Some switches, like Cisco, block PN traffic by default, due to the way they use VLAN0 to apply a priority to the PN frame. It's fixable, often by activating a VOIP setting.

I've also seen errors if there is a mismatch between the Controller and Device PN settings, but your selection of "have the controller tell the IDevice what the parameters are" (whatever the actual wording is) should prevent those. It's a mess if you don't use that setting, even between Siemens PLCs.
Agreed - I was asking some basic questions before going down a rabbit hole of more complex troubleshooting issues. Hence in a follow-up question I asked about the switch and it's configuration to understand if it is managed (or not) before we go on a wild goose chase. I've been burned by this in the past, wasting valuable time on things that are not the likely culprit.

Your points about the PROFINET settings are well taken - but to me those are not as likely as the GSD file (supposedly) is being exported and imported, so configuration of the IO Device (PLC) on the Codesys side should be automatic. I'm just trying to start with the most common, most likely issues - short of being physically present.

@raghu_k
Per mk42's and JRW's suggestion, definitely check the Profinet Device name on the PLC (found in Ethernet address section) vs. the Codesys controller. These need to match too. This should have been automatic when you imported the GSD file.

Also double check you have configured the correct network adapter in the PLC to be the IO device (easy to mix up X1 vs X2...). The PROFINET Interface set up at the IO Device should be the one on the actual network.

If you can provide info on the network switch we could take a peek there and see what potential settings (if any) might need to be looked at.
 
Since there are two posts for the same problem I answered this post with a solution here...
SIEMENS S7-1200 as PROFINET i-device
Thank you for the solution. After this I see that the IO device is visible when scanned for devices in IO controller, refer the attached the screenshots.
We can also see the transfer areas in IO controller due to the installation of GSDML file.

I am not clear about the transfer area being defined in the IO device because it is not clear how exactly is the IO mapping done and how can control the inputs of IO device through the IO controller.
Please let me know how do we do this configuration. scan devices.pngIOs.pngIOdevice_settings.PNG
 
Probably off topic, but Why is your 1200 named EIPScanner? That makes me scared.
 
Hi raghu_k, good to read you have attained some progress. I though my previous slide shows the mapping. Anyways, please see the graphic data blow. I took out the firewall issues and more narrowly concentrate on the IO mapping of cyclic data between the tow PLCs. If the graphic data does not explain in enogh detail, I will think about a way to show this differently.
The Siemens is sending 0xAFBE_ADDE to CoDeSys and getting 0x11223344 at the time of the screenshot. Good luck.
 

Attachments

  • 2024-03-02_CodesysController_S7-1200_iDevice.png
    2024-03-02_CodesysController_S7-1200_iDevice.png
    868.3 KB · Views: 15
Great news. Let's hope the project continues going smoothly from here. I also learned a lot doing this setup and it was good fun too.
 
Hello guys, I am facing another issue after establishing the profinet communication. I am sending the input in bytes from IO device to IO controller (i.e. Codesys controller), how do I convert the inputs from byte to bool in codesys?
 

Similar Topics

Hi all.. I'm working on something that is bugging the heck out of me. I have a S7-1200 setup as an i-device with 128 bytes in, 128 bytes out...
Replies
14
Views
7,183
Hi I'm wanting to basically get data from a Siemens S7-1200 PLC and write it in to my D registers on my Q series PLC. If I went for profinet...
Replies
6
Views
2,274
Hi all, Quoting a system which calls for a Siemens S7-1200 and a Danfoss FC280. Cost-wise, it's much the same whether I use a higher-spec PLC...
Replies
8
Views
4,244
Afternoon all, I'm using TIA Portal V12 SP1 to program a Siemens S7-1200 (Part No. 212 1AE31-0XB0) to control a Siemens Sinamics G120 (Part No...
Replies
4
Views
8,729
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
6
Views
255
Back
Top Bottom