Hi Nicolai,
You have to remove the MODBUS RTU master configured from piCtory when using the one from CODESYS ,otherwise there will be device conflict.Then check Codesys Serial port Configuration if it matches with your slave.Restart of the device will be needed for codeys to take the configured serial port from CODESYSControl.cfg.
You can further check in codesys logs for possible errors and could also first simulate with MOdRSim2 Slave to check out further.
https://sourceforge.net/projects/modrssim2/