RPI for PLC side. Use "packetinterval" parameter of Function block. You can found parameter in instance DB of FB. If you using RPI less than 32 connection problems occured randomly. Because Siemens PLC is not powerfull CPU for Ethernet/IP
S7-1500 manages to support EIP Communication, S7-1200 does not have enough power (communicates but when loading a new configuration in the PLC, the communication drops). For me, the main problem was the incorrect configuration of the input and output registers on both sides (Robot and PLC). In the robot, the registers are 16 bits, while in the S7 they are 8 bits.