Try this solution suggested here: https://forum.arduino.cc/t/anomalous-behavior-when-uploading-programs-to-opta-plc-using-arduino-plc/1335778/5?u=kkothimbakam