Getting errS7Function (0x500) when trying the Arduino Profinet Demo


I’m trying to read a DB from a Siemens S7-1511 with an Arduino Mega (with W5500 Ethernet shield).
Reading the PLC status works great.
But when trying to read a DB I get errS7Function (0x500).
Found out that this come from the method ‘GetDBSize’.
Here are the relevant values of PDU.RAW:
PDU.RAW[37] = 0x81
PDU.RAW[38] = 0x4
PDU.RAW[39] = 0xA

According to the code the values should be:
PDU.RAW[37] = 0x0
PDU.RAW[38] = 0x0
PDU.RAW[39] = 0xFF

Does someone know where these differences can come from?

There’s not enough information there to help you in any useful capacity.

  • Show the code that is running on the device
  • Show the full platformio.ini
  • Show the full output of the code
  • If the same code is working in the Arduino IDE and only failing in PlatformIO, show the settings of the Arduino IDE, the core version and the output of the sketcht

I’m using Arduino IDE in Version 1.8.12.
From the project i copied the files ‘Platform.h’, ‘Profinet.cpp’ and ‘Profinet.h’ into the Arduino project folder.
The code that is running on the arduino is basically the same code as shown on
The only changes i have made are the local, the PLC and the Gateway IP addresses.

On the PLC i have created DB100. For testing there is only one variable (datatype Byte) in it.

So in general the code is running. Just the communication between Arduino and PLC aren’t working completely.

Okay so you’re not using PlatformIO as your build system but the sketch just isn’t working in the Arduino IDE?

Yes, I’m not using PlatformIO as build system.
I’m using Arduino IDE as build system.

Compiling the code is working fine.
Also loading the compilied code to the arduino board works fine.

The problem occures while the code is running on the arduino board and trying to communicate with the PLC.